diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/support/capybara.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r-- | spec/support/capybara.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 66fce4fddf1..ab55cf97ab4 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -50,6 +50,10 @@ Capybara.register_driver :chrome do |app| ) options = Selenium::WebDriver::Chrome::Options.new + + # Force the browser's scale factor to prevent inconsistencies on high-res devices + options.add_argument('--force-device-scale-factor=1') + options.add_argument("window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}") # Chrome won't work properly in a Docker container in sandbox mode @@ -123,6 +127,10 @@ RSpec.configure do |config| port: session.server.port, protocol: 'http') + # CSRF protection is disabled by default. We only enable this for JS specs because some forms + # require Javascript to set the CSRF token. + allow_any_instance_of(ActionController::Base).to receive(:protect_against_forgery?).and_return(true) + # reset window size between tests unless session.current_window.size == CAPYBARA_WINDOW_SIZE begin |