make window resizing more resiliant on small screens when headless mode is off
This commit is contained in:
parent
2304550b43
commit
3f3875dbf9
|
@ -41,13 +41,17 @@ RSpec.configure do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
config.before(:example, :js) do
|
config.before(:example, :js) do
|
||||||
|
session = Capybara.current_session
|
||||||
|
|
||||||
allow(Gitlab::Application.routes).to receive(:default_url_options).and_return(
|
allow(Gitlab::Application.routes).to receive(:default_url_options).and_return(
|
||||||
host: Capybara.current_session.server.host,
|
host: session.server.host,
|
||||||
port: Capybara.current_session.server.port,
|
port: session.server.port,
|
||||||
protocol: 'http')
|
protocol: 'http')
|
||||||
|
|
||||||
# reset window size between tests
|
# reset window size between tests
|
||||||
Capybara.current_session.current_window.resize_to(1240, 1400)
|
unless session.current_window.size == [1240, 1400]
|
||||||
|
session.current_window.resize_to(1240, 1400) rescue nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
config.after(:example, :js) do |example|
|
config.after(:example, :js) do |example|
|
||||||
|
|
Loading…
Reference in New Issue