Skip to content

Commit

Permalink
Merge pull request #2447 from teamcapybara/drop_w3c_testing
Browse files Browse the repository at this point in the history
Remove references to non-W3C mode from testing code - it's obsolete and hasn't actually been tested in a while
  • Loading branch information
twalpole committed Jan 30, 2021
2 parents 2c45388 + 55df73c commit 84acc29
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
7 changes: 1 addition & 6 deletions spec/selenium_spec_chrome.rb
Expand Up @@ -12,7 +12,7 @@

browser_options = ::Selenium::WebDriver::Chrome::Options.new
browser_options.headless! if ENV['HEADLESS']
browser_options.add_option(:w3c, ENV['W3C'] != 'false')

# Chromedriver 77 requires setting this for headless mode on linux
# Different versions of Chrome/selenium-webdriver require setting differently - jus set them all
browser_options.add_preference('download.default_directory', Capybara.save_path)
Expand Down Expand Up @@ -87,8 +87,6 @@ module TestSessions
pending "Chrome headless doesn't support maximize" if ENV['HEADLESS']
when /Capybara::Window#fullscreen should be able to fullscreen the window/
skip 'Chromedriver hangs on attempts to fullscreen in headless mode' if ENV['HEADLESS']
when /node #right_click delay should delay the mouse up/
skip "Legacy selenium doesn't support separate right button down/up" if ENV['W3C'] == 'false'
end
end

Expand Down Expand Up @@ -185,10 +183,7 @@ module TestSessions
end

describe 'log access' do
before { skip 'Only makes sense in W3C mode' if ENV['W3C'] == 'false' }

it 'does not error getting log types' do
skip if Gem::Requirement.new('< 75.0.3770.90').satisfied_by? chromedriver_version
expect do
session.driver.browser.manage.logs.available_types
end.not_to raise_error
Expand Down
5 changes: 0 additions & 5 deletions spec/selenium_spec_chrome_remote.rb
Expand Up @@ -62,8 +62,6 @@ module TestSessions
'Capybara::Session selenium_chrome_remote #attach_file with multipart form should fire change once for each set of files uploaded',
'Capybara::Session selenium_chrome_remote #attach_file with multipart form should fire change once when uploading multiple files from empty'
pending "Selenium with Remote Chrome doesn't support multiple file upload" unless selenium_gte?(3.14)
when /node #right_click delay should delay the mouse up/
skip "Legacy selenium doesn't support separate right button down/up" if ENV['W3C'] == 'false'
end
end

Expand All @@ -78,10 +76,7 @@ module TestSessions
end

describe 'log access' do
before { skip 'Only makes sense in W3C mode' if ENV['W3C'] == 'false' }

it 'does not error when getting log types' do
skip unless Gem::Requirement.new('>= 75.0.3770.90').satisfied_by? chromedriver_version
expect do
session.driver.browser.manage.logs.available_types
end.not_to raise_error
Expand Down
1 change: 0 additions & 1 deletion spec/selenium_spec_safari.rb
Expand Up @@ -16,7 +16,6 @@

browser_options = ::Selenium::WebDriver::Safari::Options.new
# browser_options.headless! if ENV['HEADLESS']
# browser_options.add_option(:w3c, !!ENV['W3C'])

Capybara.register_driver :selenium_safari do |app|
Capybara::Selenium::Driver.new(app, browser: :safari, options: browser_options, timeout: 30).tap do |driver|
Expand Down
4 changes: 0 additions & 4 deletions spec/shared_selenium_node.rb
Expand Up @@ -61,8 +61,6 @@
end

it 'will use native displayed if told to' do
pending "Chromedriver < 76.0.3809.25 doesn't support native displayed in W3C mode" if chrome_lt?(76, session) && (ENV['W3C'] != 'false')

session.driver.options[:native_displayed] = true
session.visit('/form')
session.find(:css, '#address1_city', visible: true)
Expand All @@ -71,8 +69,6 @@
end

it "won't use native displayed if told not to" do
skip 'Non-W3C uses native' if chrome?(session) && (ENV['W3C'] == 'false')

session.driver.options[:native_displayed] = false
session.visit('/form')
session.find(:css, '#address1_city', visible: true)
Expand Down

0 comments on commit 84acc29

Please sign in to comment.