Skip to content

Commit 3c0e38c

Browse files
committed
rb - update to latest geckodriver
1 parent 9f51796 commit 3c0e38c

File tree

6 files changed

+23
-33
lines changed

6 files changed

+23
-33
lines changed

rb/lib/selenium/webdriver/common/platform.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def find_binary(*binary_names)
164164

165165
binary_names.each do |binary_name|
166166
paths.each do |path|
167-
exe = File.join(path, binary_name)
167+
exe = Dir.glob(File.join(path, binary_name)).first
168+
next unless exe
168169
return exe if File.executable?(exe)
169170
end
170171
end

rb/lib/selenium/webdriver/firefox.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module Firefox
4141
DEFAULT_ASSUME_UNTRUSTED_ISSUER = true
4242
DEFAULT_LOAD_NO_FOCUS_LIB = false
4343

44-
MISSING_TEXT = "Unable to find Mozilla Wires. Please download the executable from https://github.com/jgraham/wires/releases"
44+
MISSING_TEXT = "Unable to find Mozilla geckodriver. Please download the executable from https://github.com/mozilla/geckodriver/releases"
4545

4646
def self.driver_path=(path)
4747
Platform.assert_executable path
@@ -50,7 +50,7 @@ def self.driver_path=(path)
5050

5151
def self.driver_path
5252
@driver_path ||= begin
53-
path = Platform.find_binary("wires")
53+
path = Platform.find_binary("geckodriver*") || Platform.find_binary("wires*")
5454
path or raise Error::WebDriverError, MISSING_TEXT
5555
Platform.assert_executable path
5656

rb/lib/selenium/webdriver/firefox/service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def start_process
3838
@process.io.inherit!
3939
elsif Platform.windows?
4040
# workaround stdio inheritance issue
41-
# https://github.com/jgraham/wires/issues/48
41+
# https://github.com/mozilla/geckodriver/issues/48
4242
@process.io.stdout = @process.io.stderr = File.new(Platform.null_device, 'w')
4343
end
4444

@@ -57,7 +57,7 @@ def stop_server
5757
end
5858

5959
def cannot_connect_error_text
60-
"unable to connect to Mozilla Wires #{@host}:#{@port}"
60+
"unable to connect to Mozilla geckodriver #{@host}:#{@port}"
6161
end
6262

6363
end # Service

rb/lib/selenium/webdriver/remote/w3c_capabilities.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class W3CCapabilities
3232
:platform_name => :any,
3333
:platform_version => :any,
3434
:accept_ssl_certs => false,
35-
:takes_screenshot => false,
36-
:takes_element_screenshot => false,
3735
:page_load_strategy => 'normal',
3836
:proxy => nil
3937
}
@@ -112,8 +110,6 @@ def json_create(data)
112110
caps.platform_name = data.delete("platformName") if data.key? "platformName"
113111
caps.platform_version = data.delete("platformVersion") if data.key? "platformVersion"
114112
caps.accept_ssl_certs = data.delete("acceptSslCerts") if data.key? "acceptSslCerts"
115-
caps.takes_screenshot = data.delete("takesScreenshot") if data.key? "takesScreenshot"
116-
caps.takes_element_screenshot = data.delete("takesElementScreenshot") if data.key? "takesElementScreenshot"
117113
caps.page_load_strategy = data.delete("pageLoadStrategy") if data.key? "pageloadStrategy"
118114
proxy = data.delete('proxy')
119115
caps.proxy = Proxy.json_create(proxy) unless proxy.nil? || proxy.empty?
@@ -144,8 +140,6 @@ def json_create(data)
144140
# @option :platform_name [Symbol] one of :any, :win, :mac, or :x
145141
# @option :platform_version [String] required platform version number
146142
# @option :accept_ssl_certs [Boolean] does the driver accept SSL Cerfifications?
147-
# @option :takes_screenshot [Boolean] can this driver take screenshots?
148-
# @option :takes_element_screenshot [Boolean] can this driver take element screenshots?
149143
# @option :proxy [Selenium::WebDriver::Proxy, Hash] proxy configuration
150144
#
151145
# @api public

rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ def restart_remote_server
4848
expect(driver1.capabilities.platform_name).to_not be_nil
4949
expect(driver1.capabilities.platform_version).to_not be_nil
5050
expect(driver1.capabilities.accept_ssl_certs).to be == false
51-
expect(driver1.capabilities.takes_screenshot).to be == true
52-
expect(driver1.capabilities.takes_element_screenshot).to be == true
5351
expect(driver1.capabilities.page_load_strategy).to be == 'normal'
5452
expect(driver1.capabilities.proxy).to be_nil
5553
if GlobalTestEnv.driver == :remote
@@ -90,46 +88,43 @@ def restart_remote_server
9088
end
9189
end
9290

93-
context "when designated firefox binary includes Marionette" do
94-
compliant_on :browser => :marionette do
95-
# This passes in isolation, but can not run in suite due to combination of
96-
# https://bugzilla.mozilla.org/show_bug.cgi?id=1228107 & https://github.com/SeleniumHQ/selenium/issues/1150
97-
not_compliant_on :driver => :resmote do
98-
it "Uses Wires when setting marionette option in capabilities" do
99-
caps = Selenium::WebDriver::Remote::Capabilities.firefox(:marionette => true)
100-
@opt[:desired_capabilities] = caps
101-
expect { @driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt }.to_not raise_exception
102-
@driver1.quit
103-
end
104-
end
91+
compliant_on :browser => :marionette do
92+
it "Uses geckodriver when setting marionette option in capabilities" do
93+
caps = Selenium::WebDriver::Remote::Capabilities.firefox(:marionette => true)
94+
@opt[:desired_capabilities] = caps
95+
expect { @driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt }.to_not raise_exception
96+
@driver1.quit
10597
end
10698

10799
compliant_on :browser => :marionette do
108100
# This passes in isolation, but can not run in suite due to combination of
109101
# https://bugzilla.mozilla.org/show_bug.cgi?id=1228107 & https://github.com/SeleniumHQ/selenium/issues/1150
110-
it "Uses Wires when setting marionette option in driver initialization" do
102+
it "Uses geckodriver when setting marionette option in driver initialization" do
111103
@opt[:marionette] = true
112104
driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt
113105

114-
expect(driver1.capabilities[:takes_element_screenshot]).to_not be_nil
106+
expect(driver1.capabilities[:browser_version]).to_not be_nil
115107
driver1.quit
116108
end
117109
end
118110

119111
# test with firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=1228121
120112
compliant_on :browser => :firefox do
121-
it "Does not use wires when marionette option is not set" do
113+
it "Does not use geckodriver when marionette option is not set" do
122114
driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt
123115

124-
expect { driver1.capabilities.browser_version }.to raise_exception NoMethodError
116+
expect { driver1.capabilities.browser_version }.to raise_exception NoMethodError
125117
driver1.quit
126118
end
127119
end
128120

129121
compliant_on :driver => :marionette do
130-
context 'when shared example' do
131-
before { driver }
132-
it_behaves_like "driver that can be started concurrently", :marionette
122+
# https://github.com/mozilla/geckodriver/issues/58
123+
not_compliant_on :driver => :marionette do
124+
context 'when shared example' do
125+
before { driver }
126+
it_behaves_like "driver that can be started concurrently", :marionette
127+
end
133128
end
134129
end
135130
end

rb/spec/integration/selenium/webdriver/target_locator_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
let(:new_window) { driver.window_handles.find { |handle| handle != driver.window_handle } }
2828

29-
# https://github.com/jgraham/wires/issues/52
29+
# https://github.com/mozilla/geckodriver/issues/52
3030
not_compliant_on :browser => :marionette do
3131
# https://github.com/SeleniumHQ/selenium/issues/1795
3232
not_compliant_on :driver => :remote, :browser => [:edge, :marionette] do

0 commit comments

Comments
 (0)