Skip to content

Commit

Permalink
rb - fix chrome options for detach (issue 2418)
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jul 15, 2016
1 parent 1870e66 commit 0a4b995
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions rb/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Ruby:
service class (issue 1797)
* Option `:timeout` was removed from IE server (issue 1797)

Chrome:
* Remove override of default chromedriver behavior for chrome.detach (issue 2418)

Firefox:
* Rename wires to geckodriver
* Change default usage from FirefoxDriver to geckodriver
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/chrome/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def create_capabilities(opts)
chrome_options['binary'] = Chrome.path if Chrome.path
chrome_options['nativeEvents'] = true if native_events
chrome_options['verbose'] = true if verbose
chrome_options['detach'] = detach != false
chrome_options['detach'] = true if detach
chrome_options['noWebsiteTestingDefaults'] = true if no_website_testing_defaults
chrome_options['prefs'] = prefs if prefs

Expand Down
14 changes: 7 additions & 7 deletions rb/spec/unit/selenium/webdriver/chrome/bridge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ module Chrome
expect(caps['chrome.verbose']).to be true
end

it 'sets the chrome.detach capability' do
Bridge.new(http_client: http) # true by default
it 'does not set the chrome.detach capability by default' do
Bridge.new(http_client: http)

expect(caps['chromeOptions']['detach']).to be true
expect(caps['chrome.detach']).to be true
expect(caps['chromeOptions']['detach']).to be nil
expect(caps['chrome.detach']).to be nil
end

it 'sets the prefs capability' do
Expand All @@ -79,10 +79,10 @@ module Chrome
end

it 'lets the user override chrome.detach' do
Bridge.new(http_client: http, detach: false)
Bridge.new(http_client: http, detach: true)

expect(caps['chromeOptions']['detach']).to be false
expect(caps['chrome.detach']).to be false
expect(caps['chromeOptions']['detach']).to be true
expect(caps['chrome.detach']).to be true
end

it 'lets the user override chrome.noWebsiteTestingDefaults' do
Expand Down

0 comments on commit 0a4b995

Please sign in to comment.