Skip to content

Commit 592c37b

Browse files
committed
rb - change firefox_nightly references to wires
1 parent f78afdb commit 592c37b

File tree

4 files changed

+81
-78
lines changed

4 files changed

+81
-78
lines changed

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

Lines changed: 0 additions & 72 deletions
This file was deleted.

rb/spec/integration/selenium/webdriver/spec_support/guards.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def current_env
7777
:platform => Platform.os,
7878
:native => GlobalTestEnv.native_events?,
7979
:window_manager => !!ENV['DESKTOP_SESSION'],
80-
:w3c => GlobalTestEnv.w3c?(:browser_name => GlobalTestEnv.driver)
80+
:w3c => GlobalTestEnv.driver == :wires
8181
}
8282
end
8383

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def initialize
3636
def browser
3737
if driver == :remote
3838
(ENV['WD_REMOTE_BROWSER'] || :firefox).to_sym
39-
elsif driver == :firefox_nightly
39+
elsif driver == :wires
4040
:firefox
4141
else
4242
driver
@@ -108,10 +108,6 @@ def native_events?
108108
@native_events ||= !!ENV['native']
109109
end
110110

111-
def w3c?(opt = {})
112-
Remote::W3CCapabilities.w3c?(opt)
113-
end
114-
115111
def url_for(filename)
116112
url = app_server.where_is filename
117113
url.sub!("127.0.0.1", "10.0.2.2") if browser == :android
@@ -131,6 +127,8 @@ def create_driver
131127
create_remote_driver
132128
when :firefox
133129
create_firefox_driver
130+
when :wires
131+
create_wires_driver
134132
when :chrome
135133
create_chrome_driver
136134
when :iphone
@@ -193,6 +191,10 @@ def create_firefox_driver
193191
end
194192
end
195193

194+
def create_wires_driver
195+
WebDriver::Driver.for :firefox, {wires: true}
196+
end
197+
196198
def create_chrome_driver
197199
binary = ENV['chrome_binary']
198200
if binary
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# encoding: utf-8
2+
#
3+
# Licensed to the Software Freedom Conservancy (SFC) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The SFC licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
require_relative '../spec_helper'
21+
22+
module Selenium
23+
module WebDriver
24+
25+
compliant_on :driver => :wires do
26+
describe Firefox do
27+
28+
context "when designated firefox installation includes Marionette" do
29+
before(:all) { Firefox::Binary.path = "/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin" }
30+
after { @driver.quit }
31+
32+
# Currently versions that support Wires do not support Legacy Firefox Extension
33+
xit "Does not use wires by default" do
34+
@driver = Selenium::WebDriver.for :firefox
35+
expect(@driver.instance_variable_get('@bridge').instance_variable_get('@launcher')).to_not be_nil
36+
end
37+
38+
it "Uses Wires when initialized with :desired_capabilities" do
39+
caps = Selenium::WebDriver::Remote::W3CCapabilities.firefox
40+
expect { @driver = Selenium::WebDriver.for :firefox, :desired_capabilities => caps }.to_not raise_exception
41+
end
42+
43+
it "Uses Wires when initialized with wires option" do
44+
@driver = Selenium::WebDriver.for :firefox, {wires: true}
45+
expect(@driver.instance_variable_get('@bridge').instance_variable_get('@launcher')).to be_nil
46+
end
47+
end
48+
49+
context "when designated firefox installation does not include Marionette" do
50+
before(:all) { Firefox::Binary.path = "/Applications/Firefox.app/Contents/MacOS/firefox-bin" }
51+
let(:message) { /Firefox Version \d\d does not support W3CCapabilities/ }
52+
53+
it "Does not use Wires by default" do
54+
driver = Selenium::WebDriver.for :firefox
55+
expect(driver.instance_variable_get('@bridge').instance_variable_get('@launcher')).to_not be_nil
56+
driver.quit
57+
end
58+
59+
it "Raises Wires Exception when initialized with :desired_capabilities" do
60+
caps = Selenium::WebDriver::Remote::W3CCapabilities.firefox
61+
opt = {:desired_capabilities => caps}
62+
expect { @driver = Selenium::WebDriver.for :firefox, opt }.to raise_exception ArgumentError, message
63+
end
64+
65+
it "Raises Wires Exception when initialized with wires option" do
66+
expect{@driver = Selenium::WebDriver.for :firefox, {wires: true}}.to raise_exception ArgumentError, message
67+
end
68+
end
69+
70+
end
71+
end
72+
end # WebDriver
73+
end # Selenium

0 commit comments

Comments
 (0)