diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 6e61d24b9cb..076bab8fcc4 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -289,6 +289,7 @@ RSpec.configure do |config| options.add_argument("--no-sandbox") options.add_argument("--disable-dev-shm-usage") options.add_argument("--mute-audio") + options.add_argument("--force-device-scale-factor=1") end Capybara.register_driver :selenium_chrome do |app| @@ -310,6 +311,7 @@ RSpec.configure do |config| options.add_argument("--disable-dev-shm-usage") options.add_emulation(device_name: "iPhone 12 Pro") options.add_argument("--mute-audio") + options.add_argument("--force-device-scale-factor=1") end Capybara.register_driver :selenium_mobile_chrome do |app| diff --git a/spec/system/page_objects/components/sidebar_header_dropdown.rb b/spec/system/page_objects/components/sidebar_header_dropdown.rb index 9f481b5cc8b..d07cbc669c4 100644 --- a/spec/system/page_objects/components/sidebar_header_dropdown.rb +++ b/spec/system/page_objects/components/sidebar_header_dropdown.rb @@ -42,8 +42,8 @@ module PageObjects end def click_outside - dropdown = page.find(SIDEBAR_HAMBURGER_DROPDOWN) - dropdown.click(x: dropdown.rect.width + 1, y: 1) + width = page.evaluate_script("document.body.clientWidth") + page.find("body").click(x: width - 1, y: 1) end end end