Skip to content

Commit 0c26592

Browse files
committed
rb - marionette works on remote driver
1 parent af83fc9 commit 0c26592

File tree

14 files changed

+251
-236
lines changed

14 files changed

+251
-236
lines changed

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ task :test_rb => [
253253
"//rb:remote-chrome-test",
254254
"//rb:remote-firefox-test",
255255
"//rb:remote-phantomjs-test",
256-
("//rb:wires-test" if ENV['MARIONETTE_PATH']),
257-
("//rb:remote-wires-test" if ENV['MARIONETTE_PATH']),
256+
("//rb:marionette-test" if ENV['MARIONETTE_PATH']),
257+
("//rb:remote-marionette-test" if ENV['MARIONETTE_PATH']),
258258
("//rb:safari-test" if mac?),
259259
("//rb:remote-safari-test" if mac?),
260260
("//rb:ie-test" if windows?),

rb/build.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rubygem(
1313
"//rb:remote",
1414
"//rb:rc-client",
1515
"//rb:safari",
16-
"//rb:wires"
16+
"//rb:marionette"
1717
]
1818
)
1919

@@ -113,7 +113,7 @@ ruby_test(name = "edge",
113113
deps = [ ":edge" ]
114114
)
115115

116-
ruby_test(name = "wires",
116+
ruby_test(name = "marionette",
117117
srcs = [
118118
"spec/integration/selenium/webdriver/*_spec.rb",
119119
"spec/integration/selenium/webdriver/firefox/**/*_spec.rb"
@@ -300,7 +300,7 @@ ruby_test(name = "remote-edge",
300300
]
301301
)
302302

303-
ruby_test(name = "remote-wires",
303+
ruby_test(name = "remote-marionette",
304304
srcs = [
305305
"spec/integration/selenium/webdriver/*_spec.rb",
306306
"spec/integration/selenium/webdriver/remote/**/*_spec.rb"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class W3CCapabilities
2828

2929
DEFAULTS = {
3030
:browser_name => '',
31-
:browser_version => '',
31+
:browser_version => :any,
3232
:platform_name => :any,
33-
:platform_version => false,
33+
:platform_version => :any,
3434
:accept_ssl_certs => false,
3535
:takes_screenshot => false,
3636
:takes_element_screenshot => false,
37-
:page_load_strategy => false,
37+
:page_load_strategy => 'normal',
3838
:proxy => nil
3939
}
4040

@@ -72,7 +72,7 @@ def firefox(opts = {})
7272
alias_method :ff, :firefox
7373

7474
def w3c?(opts = {})
75-
return false unless opts[:desired_capabilities].is_a?(W3CCapabilities) || opts.delete(:wires)
75+
return false unless opts[:desired_capabilities].is_a?(W3CCapabilities) || opts.delete(:marionette)
7676
Firefox::Binary.path = ENV['MARIONETTE_PATH'] if ENV['MARIONETTE_PATH']
7777
firefox_version = Firefox::Binary.version
7878
raise ArgumentError, "Firefox Version #{firefox_version} does not support W3CCapabilities" if firefox_version < 43

rb/spec/integration/selenium/webdriver/driver_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
end
2727

2828
# Marionette BUG - AutomatedTester: "I need to add pagesource back and add it to the spec"
29-
not_compliant_on :driver => :wires do
29+
not_compliant_on :driver => :marionette do
3030
it "should get the page source" do
3131
driver.navigate.to url_for("xhtmlTest.html")
3232
expect(driver.page_source).to match(%r[<title>XHTML Test Page</title>]i)
@@ -215,7 +215,7 @@
215215
end
216216

217217
# Marionette BUG - Not finding local javascript for execution
218-
not_compliant_on :driver => :wires do
218+
not_compliant_on({:driver => :marionette}, {:browser => :marionette}) do
219219
it "should be able to call functions on the page" do
220220
driver.navigate.to url_for("javascriptPage.html")
221221
driver.execute_script("displayMessage('I like cheese');")
@@ -278,7 +278,7 @@
278278
end
279279

280280
# Edge BUG - https://connect.microsoft.com/IE/feedback/details/1849991/
281-
not_compliant_on :browser => :edge do
281+
not_compliant_on({:browser => :edge}, {:driver => :remote, :browser => :marionette}) do
282282
it "times out if the callback is not invoked" do
283283
expect {
284284
# Script is expected to be async and explicitly callback, so this should timeout.

rb/spec/integration/selenium/webdriver/element_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
end
2828

2929
# Marionette BUG - AutomatedTester: "known bug with execute script"
30-
not_compliant_on :driver => :wires do
30+
not_compliant_on :driver => :marionette do
3131
it "should submit" do
3232
driver.navigate.to url_for("formPage.html")
3333
wait(5).until {driver.find_elements(:id, "submitButton").size > 0}
@@ -53,9 +53,9 @@
5353
# FIXME - Find alternate implementation for File Uploads
5454
# TODO - Figure out if/how this works on Firefox/Chrome without Remote server
5555
# PhantomJS on windows issue: https://github.com/ariya/phantomjs/issues/10993
56-
not_compliant_on({:browser => [:android, :iphone, :safari, :edge]},
57-
{:browser => :phantomjs, :platform => :windows},
58-
{:driver => :wires}) do
56+
not_compliant_on({:browser => [:android, :iphone, :safari, :edge, :marionette]},
57+
{:browser => :phantomjs, :platform => [:windows, :linux]},
58+
{:driver => :marionette}) do
5959
it "should handle file uploads" do
6060
driver.navigate.to url_for("formPage.html")
6161

@@ -133,7 +133,7 @@
133133
end
134134

135135
# Location not currently supported in Spec, but should be?
136-
not_compliant_on :driver => :wires do
136+
not_compliant_on :driver => :marionette do
137137
it "should get location" do
138138
driver.navigate.to url_for("xhtmlTest.html")
139139
loc = driver.find_element(:class, "header").location
@@ -156,7 +156,7 @@
156156
# Marionette BUG:
157157
# GET /session/f7082a32-e685-2843-ad2c-5bb6f376dac5/element/b6ff4468-ed6f-7c44-be4b-ca5a3ea8bf26/size
158158
# did not match a known command"
159-
not_compliant_on :driver => :wires do
159+
not_compliant_on :driver => :marionette do
160160
it "should get size" do
161161
driver.navigate.to url_for("xhtmlTest.html")
162162
size = driver.find_element(:class, "header").size

rb/spec/integration/selenium/webdriver/firefox/wires_spec.rb renamed to rb/spec/integration/selenium/webdriver/firefox/marionette_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module WebDriver
4848
end
4949
end
5050

51-
compliant_on :driver => :wires do
51+
compliant_on({:driver => :remote, :browser => :marionette}, {:driver => :marionette}) do
5252

5353
context "when designated firefox installation includes Marionette" do
5454

@@ -60,15 +60,15 @@ module WebDriver
6060
end.to_not raise_exception
6161
end
6262

63-
it "Uses Wires when initialized with wires option" do
64-
temp_driver = Selenium::WebDriver.for :firefox, {wires: true}
63+
it "Uses Wires when initialized with marionette option" do
64+
temp_driver = Selenium::WebDriver.for :firefox, {marionette: true}
6565
expect(temp_driver.instance_variable_get('@bridge').instance_variable_get('@launcher')).to be_nil
6666
temp_driver.quit
6767
end
6868
end
6969
end
7070

71-
compliant_on :driver => :wires do
71+
compliant_on({:driver => :remote, :browser => :marionette}, {:driver => :marionette}) do
7272

7373
context "when designated firefox installation does not include Marionette" do
7474
before(:each) do
@@ -85,8 +85,8 @@ module WebDriver
8585
expect { Selenium::WebDriver.for :firefox, opt }.to raise_exception ArgumentError, message
8686
end
8787

88-
it "Raises Wires Exception when initialized with wires option" do
89-
expect{Selenium::WebDriver.for :firefox, {wires: true}}.to raise_exception ArgumentError, message
88+
it "Raises Wires Exception when initialized with marionette option" do
89+
expect{Selenium::WebDriver.for :firefox, {marionette: true}}.to raise_exception ArgumentError, message
9090
end
9191
end
9292
end

rb/spec/integration/selenium/webdriver/keyboard_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ module Selenium
2323
module WebDriver
2424

2525
# Marionette BUG - Interactions Not Supported
26-
not_compliant_on({:browser => [:chrome, :android, :iphone, :safari]},
27-
{:driver => :wires}) do
26+
not_compliant_on({:browser => [:chrome, :android, :iphone, :safari, :marionette]},
27+
{:driver => :marionette}) do
2828
describe Keyboard do
2929
it "sends keys to the active element" do
3030
driver.navigate.to url_for("bodyTypingTest.html")

rb/spec/integration/selenium/webdriver/mouse_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module WebDriver
2525
describe Mouse do
2626

2727
# Marionette BUG - Interactions Not Supported
28-
not_compliant_on({:browser => [:android, :iphone, :safari]},
29-
{:driver => :wires}) do
28+
not_compliant_on({:browser => [:android, :iphone, :safari, :marionette]},
29+
{:driver => :marionette}) do
3030
it "clicks an element" do
3131
driver.navigate.to url_for("formPage.html")
3232
driver.mouse.click driver.find_element(:id, "imageButton")

rb/spec/integration/selenium/webdriver/options_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module WebDriver
2424
describe Options do
2525

2626
# Not supported in W3C Spec
27-
not_compliant_on :driver => :wires do
27+
not_compliant_on :driver => :marionette do
2828
describe 'logs' do
2929
compliant_on :driver => [:firefox] do
3030
it 'can fetch available log types' do
@@ -50,7 +50,7 @@ module WebDriver
5050
end
5151
end
5252

53-
not_compliant_on :browser => :ie do
53+
not_compliant_on({:browser => :ie}) do
5454
describe "cookie management" do
5555
it "should get all" do
5656
driver.navigate.to url_for("xhtmlTest.html")
@@ -85,8 +85,8 @@ module WebDriver
8585
end
8686

8787
# Marionette BUG - Failed to convert expiry to Date
88-
not_compliant_on({:browser => [:ie, :android, :iphone, :safari]},
89-
{:driver => :wires}) do
88+
not_compliant_on({:browser => [:ie, :android, :iphone, :safari, :marionette]},
89+
{:driver => :marionette}) do
9090
it "should use DateTime for expires" do
9191
driver.navigate.to url_for("xhtmlTest.html")
9292

rb/spec/integration/selenium/webdriver/spec_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ class Object
3737
c.include(WebDriver::SpecSupport::Helpers)
3838
c.before(:suite) do
3939
if GlobalTestEnv.driver == :remote
40-
GlobalTestEnv.remote_server.start
40+
server = GlobalTestEnv.remote_server
41+
if GlobalTestEnv.browser == :marionette
42+
server << "-Dwebdriver.firefox.bin=#{ENV['MARIONETTE_PATH']}"
43+
end
44+
server.start
4145
end
4246
end
4347

@@ -52,4 +56,4 @@ class Object
5256

5357
$stdout.sync = true
5458
GlobalTestEnv.unguarded = !!ENV['noguards']
55-
WebDriver::SpecSupport::Guards.print_env
59+
WebDriver::SpecSupport::Guards.print_env

0 commit comments

Comments
 (0)