Skip to content

Commit 63e0aa8

Browse files
committed
rb - update to latest geckodriver
1 parent 89495c9 commit 63e0aa8

File tree

5 files changed

+25
-36
lines changed

5 files changed

+25
-36
lines changed

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

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

169169
binary_names.each do |binary_name|
170170
paths.each do |path|
171-
exe = File.join(path, binary_name)
171+
exe = Dir.glob(File.join(path, binary_name)).first
172+
next unless exe
172173
return exe if File.executable?(exe)
173174
end
174175
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ class Service
2929
SOCKET_LOCK_TIMEOUT = 45
3030
STOP_TIMEOUT = 5
3131
DEFAULT_PORT = 4444
32-
MISSING_TEXT = "Unable to find Mozilla Wires. Please download the executable from https://github.com/jgraham/wires/releases"
32+
MISSING_TEXT = "Unable to find geckodriver. Please download the executable from https://github.com/mozilla/geckodriver/releases"
3333

3434
def self.executable_path
3535
@executable_path ||= (
36-
path = Platform.find_binary "wires"
36+
path = Platform.find_binary("geckodriver*") || Platform.find_binary("wires*")
3737
path or raise Error::WebDriverError, MISSING_TEXT
3838
Platform.assert_executable path
3939

@@ -109,7 +109,7 @@ def connect_until_stable
109109
@socket_poller = SocketPoller.new @host, @port, START_TIMEOUT
110110

111111
unless @socket_poller.connected?
112-
raise Error::WebDriverError, "unable to connect to Mozilla Wires #{@host}:#{@port}"
112+
raise Error::WebDriverError, "unable to connect to Mozilla geckodriver #{@host}:#{@port}"
113113
end
114114
end
115115

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@ 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
}
4038

4139
KNOWN = [
4240
:remote_session_id,
43-
:specification_level,
4441
:xul_app_id,
4542
:raise_accessibility_exceptions,
4643
:rotatable,
@@ -113,8 +110,6 @@ def json_create(data)
113110
caps.platform_name = data.delete("platformName") if data.key? "platformName"
114111
caps.platform_version = data.delete("platformVersion") if data.key? "platformVersion"
115112
caps.accept_ssl_certs = data.delete("acceptSslCerts") if data.key? "acceptSslCerts"
116-
caps.takes_screenshot = data.delete("takesScreenshot") if data.key? "takesScreenshot"
117-
caps.takes_element_screenshot = data.delete("takesElementScreenshot") if data.key? "takesElementScreenshot"
118113
caps.page_load_strategy = data.delete("pageLoadStrategy") if data.key? "pageloadStrategy"
119114
proxy = data.delete('proxy')
120115
caps.proxy = Proxy.json_create(proxy) unless proxy.nil? || proxy.empty?
@@ -127,7 +122,6 @@ def json_create(data)
127122
data.delete('cssSelectorsEnabled')
128123

129124
# Marionette Specific
130-
caps[:specification_level] = data.delete("specificationLevel")
131125
caps[:xul_app_id] = data.delete("XULappId")
132126
caps[:raise_accessibility_exceptions] = data.delete('raisesAccessibilityExceptions')
133127
caps[:rotatable] = data.delete('rotatable')
@@ -146,8 +140,6 @@ def json_create(data)
146140
# @option :platform_name [Symbol] one of :any, :win, :mac, or :x
147141
# @option :platform_version [String] required platform version number
148142
# @option :accept_ssl_certs [Boolean] does the driver accept SSL Cerfifications?
149-
# @option :takes_screenshot [Boolean] can this driver take screenshots?
150-
# @option :takes_element_screenshot [Boolean] can this driver take element screenshots?
151143
# @option :proxy [Selenium::WebDriver::Proxy, Hash] proxy configuration
152144
#
153145
# @api public

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

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,13 @@ def restart_remote_server(path = nil)
5050
expect(driver1.capabilities.platform_name).to_not be_nil
5151
expect(driver1.capabilities.platform_version).to_not be_nil
5252
expect(driver1.capabilities.accept_ssl_certs).to be == false
53-
expect(driver1.capabilities.takes_screenshot).to be == true
54-
expect(driver1.capabilities.takes_element_screenshot).to be == true
5553
expect(driver1.capabilities.page_load_strategy).to be == 'normal'
5654
expect(driver1.capabilities.proxy).to be_nil
5755
if GlobalTestEnv.driver == :remote
5856
expect(driver1.capabilities.remote_session_id).to match /^\h{8}-\h{4}-\h{4}-\h{4}-\h{10}/
5957
else
6058
expect(driver1.capabilities.remote_session_id).to be_nil
6159
end
62-
expect(driver1.capabilities.specification_level).to be == '1'
6360
expect(driver1.capabilities.raise_accessibility_exceptions).to be == false
6461
expect(driver1.capabilities.rotatable).to be == false
6562
ensure
@@ -75,7 +72,7 @@ def restart_remote_server(path = nil)
7572
driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt
7673

7774
default_version = driver1.capabilities.version
78-
expect { driver1.capabilities.specification_level }.to_not raise_exception NoMethodError
75+
expect { driver1.capabilities.browser_version }.to_not raise_exception NoMethodError
7976
driver1.quit
8077

8178
if GlobalTestEnv.driver == :remote
@@ -87,7 +84,7 @@ def restart_remote_server(path = nil)
8784
driver2 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt
8885

8986
expect(driver2.capabilities.version).to_not be == default_version
90-
expect { driver2.capabilities.specification_level }.to_not raise_exception NoMethodError
87+
expect { driver2.capabilities.browser_version }.to_not raise_exception NoMethodError
9188
driver2.quit
9289
ensure
9390
Firefox::Binary.reset_path!
@@ -97,44 +94,43 @@ def restart_remote_server(path = nil)
9794

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

112105
compliant_on :browser => :marionette do
113106
# This passes in isolation, but can not run in suite due to combination of
114107
# https://bugzilla.mozilla.org/show_bug.cgi?id=1228107 & https://github.com/SeleniumHQ/selenium/issues/1150
115-
it "Uses Wires when setting marionette option in driver initialization" do
108+
it "Uses geckodriver when setting marionette option in driver initialization" do
116109
@opt[:marionette] = true
117110
driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt
118111

119-
expect(driver1.capabilities[:takes_element_screenshot]).to_not be_nil
112+
expect(driver1.capabilities[:browser_version]).to_not be_nil
120113
driver1.quit
121114
end
122115
end
123116

124117
# test with firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=1228121
125118
compliant_on :browser => :firefox do
126-
it "Does not use wires when marionette option is not set" do
119+
it "Does not use geckodriver when marionette option is not set" do
127120
driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt
128121

129-
expect { driver1.capabilities.specification_level }.to raise_exception NoMethodError
122+
expect { driver1.capabilities.browser_version }.to raise_exception NoMethodError
130123
driver1.quit
131124
end
132125
end
133126

134127
compliant_on :driver => :marionette do
135-
context 'when shared example' do
136-
before { driver }
137-
it_behaves_like "driver that can be started concurrently", :marionette
128+
# https://github.com/mozilla/geckodriver/issues/58
129+
not_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
133+
end
138134
end
139135
end
140136
end
@@ -150,7 +146,7 @@ def restart_remote_server(path = nil)
150146
end
151147
end
152148

153-
it "Raises Wires Exception when setting marionette option in capabilities" do
149+
it "Raises geckodriver Exception when setting marionette option in capabilities" do
154150
begin
155151
caps = Selenium::WebDriver::Remote::Capabilities.firefox(:marionette => true,
156152
:firefox_binary => ENV['PRE_MARIONETTE_BINARY'])
@@ -161,7 +157,7 @@ def restart_remote_server(path = nil)
161157
end
162158
end
163159

164-
it "Raises Wires Exception when setting marionette option in driver initialization" do
160+
it "Raises geckodriver Exception when setting marionette option in driver initialization" do
165161
begin
166162
caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_binary => ENV['PRE_MARIONETTE_BINARY'])
167163
@opt.merge!(:marionette => true, :desired_capabilities => caps)

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)