From bcc0540f41b76c4eb4cd3e8f5e36b51552099b86 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Tue, 19 Oct 2021 10:26:40 +0200 Subject: [PATCH] Fixed tests. --- spec/support/capybara/selenium_driver.rb | 10 ++++++++-- test/browser_test_helper.rb | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spec/support/capybara/selenium_driver.rb b/spec/support/capybara/selenium_driver.rb index 27cec8e10..c7ea66997 100644 --- a/spec/support/capybara/selenium_driver.rb +++ b/spec/support/capybara/selenium_driver.rb @@ -27,7 +27,10 @@ Capybara.register_driver(:zammad_chrome) do |app| options[:url] = ENV['REMOTE_URL'] end - Capybara::Selenium::Driver.new(app, **options) + Capybara::Selenium::Driver.new(app, **options).tap do |driver| + # Selenium 4 installs a default file_detector which finds wrong files/directories such as zammad/test. + driver.browser.file_detector = nil + end end Capybara.register_driver(:zammad_firefox) do |app| @@ -48,5 +51,8 @@ Capybara.register_driver(:zammad_firefox) do |app| options[:url] = ENV['REMOTE_URL'] end - Capybara::Selenium::Driver.new(app, **options) + Capybara::Selenium::Driver.new(app, **options).tap do |driver| + # Selenium 4 installs a default file_detector which finds wrong files/directories such as zammad/test. + driver.browser.file_detector = nil + end end diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 59c740058..02c77165f 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -131,10 +131,10 @@ class TestCase < ActiveSupport::TestCase caps.version = ENV['BROWSER_VERSION'] end - # (ironically) required for timeout checks - # https://github.com/zalando/zalenium/issues/469#issuecomment-371417340 - # https://opensource.zalando.com/zalenium/#usage - caps['idleTimeout'] = 300 + # # (ironically) required for timeout checks + # # https://github.com/zalando/zalenium/issues/469#issuecomment-371417340 + # # https://opensource.zalando.com/zalenium/#usage + # caps['idleTimeout'] = 300 http_client = Selenium::WebDriver::Remote::Http::Default.new( open_timeout: 120,