Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-11-01 22:04:24 +0300
committerMike Greiling <mike@pixelcog.com>2017-11-01 22:04:24 +0300
commit3f3875dbf93b5e6b02d3f4320145f5a5bd8b42dc (patch)
tree6c19c560d8f6010c88459fa31beec8ff882c33db
parent2304550b4357167cbbd8c18697994f6bf4ba9ce9 (diff)
make window resizing more resiliant on small screens when headless mode is off
-rw-r--r--spec/support/capybara.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index e196455206e..9f672bc92fc 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -41,13 +41,17 @@ RSpec.configure do |config|
end
config.before(:example, :js) do
+ session = Capybara.current_session
+
allow(Gitlab::Application.routes).to receive(:default_url_options).and_return(
- host: Capybara.current_session.server.host,
- port: Capybara.current_session.server.port,
+ host: session.server.host,
+ port: session.server.port,
protocol: 'http')
# 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
config.after(:example, :js) do |example|