From 12c065154809cc1ea075753e54b3eb51477a748a Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Mon, 26 Nov 2018 09:54:00 -0800 Subject: [PATCH] Stop skipping window tests and pend #maximize tests for headless Chrome --- .travis.yml | 2 -- spec/selenium_spec_chrome.rb | 4 ++-- spec/selenium_spec_chrome_remote.rb | 2 -- spec/selenium_spec_firefox.rb | 1 - spec/selenium_spec_firefox_remote.rb | 2 -- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 344da106..b60c76d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,6 @@ env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true - JAVA_OPTS=-Djava.security.egd=file:/dev/urandom - # matrix: - # - WINDOW_TEST=true addons: apt: diff --git a/spec/selenium_spec_chrome.rb b/spec/selenium_spec_chrome.rb index dcbcf5be..d1cd06d8 100644 --- a/spec/selenium_spec_chrome.rb +++ b/spec/selenium_spec_chrome.rb @@ -30,8 +30,6 @@ module TestSessions end skipped_tests = %i[response_headers status_code trigger] -# skip window tests when headless for now - closing a window not supported by chromedriver/chrome -skipped_tests << :windows if ENV['TRAVIS'] && (ENV['SKIP_WINDOW'] || ENV['HEADLESS']) $stdout.puts `#{Selenium::WebDriver::Chrome.driver_path} --version` if ENV['CI'] @@ -39,6 +37,8 @@ Capybara::SpecHelper.run_specs TestSessions::Chrome, CHROME_DRIVER.to_s, capybar case example.metadata[:full_description] when /#click_link can download a file$/ skip 'Need to figure out testing of file downloading on windows platform' if Gem.win_platform? + when /Capybara::Session selenium_chrome Capybara::Window#maximize/ + pending "Chrome headless doesn't support maximize" if ENV['HEADLESS'] end end diff --git a/spec/selenium_spec_chrome_remote.rb b/spec/selenium_spec_chrome_remote.rb index 3e8df801..7c9a8f6b 100644 --- a/spec/selenium_spec_chrome_remote.rb +++ b/spec/selenium_spec_chrome_remote.rb @@ -60,8 +60,6 @@ TestSessions::Chrome.driver.browser.file_detector = lambda do |args| end skipped_tests = %i[response_headers status_code trigger download] -# skip window tests when headless for now - closing a window not supported by chromedriver/chrome -skipped_tests << :windows if ENV['TRAVIS'] && (ENV['SKIP_WINDOW'] || ENV['HEADLESS']) Capybara::SpecHelper.run_specs TestSessions::Chrome, CHROME_REMOTE_DRIVER.to_s, capybara_skip: skipped_tests do |example| case example.metadata[:full_description] diff --git a/spec/selenium_spec_firefox.rb b/spec/selenium_spec_firefox.rb index e45e2e18..2fce1b2f 100644 --- a/spec/selenium_spec_firefox.rb +++ b/spec/selenium_spec_firefox.rb @@ -42,7 +42,6 @@ module TestSessions end skipped_tests = %i[response_headers status_code trigger] -skipped_tests << :windows if ENV['TRAVIS'] && ENV['SKIP_WINDOW'] $stdout.puts `#{Selenium::WebDriver::Firefox.driver_path} --version` if ENV['CI'] diff --git a/spec/selenium_spec_firefox_remote.rb b/spec/selenium_spec_firefox_remote.rb index 297dce81..b66b4d32 100644 --- a/spec/selenium_spec_firefox_remote.rb +++ b/spec/selenium_spec_firefox_remote.rb @@ -56,8 +56,6 @@ TestSessions::RemoteFirefox.driver.browser.file_detector = lambda do |args| end skipped_tests = %i[response_headers status_code trigger download] -# skip window tests when headless for now - closing a window not supported by chromedriver/chrome -skipped_tests << :windows if ENV['TRAVIS'] && (ENV['SKIP_WINDOW'] || ENV['HEADLESS']) Capybara::SpecHelper.run_specs TestSessions::RemoteFirefox, FIREFOX_REMOTE_DRIVER.to_s, capybara_skip: skipped_tests do |example| case example.metadata[:full_description]