|
21 | 21 |
|
22 | 22 | module Selenium |
23 | 23 | module WebDriver |
24 | | - describe Firefox do |
25 | | - def restart_remote_server |
26 | | - server = GlobalTestEnv.reset_remote_server |
27 | | - server.start |
28 | | - server.webdriver_url |
29 | | - end |
| 24 | + compliant_on browser: :marionette do |
| 25 | + describe Firefox do |
| 26 | + def restart_remote_server |
| 27 | + server = GlobalTestEnv.reset_remote_server |
| 28 | + server.start |
| 29 | + server.webdriver_url |
| 30 | + end |
30 | 31 |
|
31 | | - before(:all) do |
32 | | - driver |
33 | | - quit_driver |
34 | | - end |
| 32 | + before(:all) do |
| 33 | + driver |
| 34 | + quit_driver |
| 35 | + end |
35 | 36 |
|
36 | | - before do |
37 | | - @opt = {} |
38 | | - @opt[:url] = restart_remote_server if GlobalTestEnv.driver == :remote |
39 | | - end |
| 37 | + before(:each) do |
| 38 | + @opt = {} |
| 39 | + @opt[:url] = restart_remote_server if GlobalTestEnv.driver == :remote |
| 40 | + end |
40 | 41 |
|
41 | | - compliant_on browser: :marionette do |
42 | 42 | it 'creates default capabilities' do |
| 43 | + driver_name = GlobalTestEnv.driver |
| 44 | + driver_name = :firefox if driver_name == :marionette |
| 45 | + |
43 | 46 | begin |
44 | | - @opt[:marionette] = true |
45 | | - driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt |
| 47 | + driver1 = Selenium::WebDriver.for driver_name, @opt |
46 | 48 | expect(driver1.capabilities.browser_version).to match(/^\d\d\./) |
47 | 49 | expect(driver1.capabilities.platform_name).to_not be_nil |
48 | 50 | expect(driver1.capabilities.platform_version).to_not be_nil |
@@ -85,47 +87,26 @@ def restart_remote_server |
85 | 87 | end |
86 | 88 | end |
87 | 89 | end |
88 | | - end |
89 | 90 |
|
90 | | - compliant_on browser: :marionette do |
91 | | - it 'Uses geckodriver when setting marionette option in capabilities' do |
92 | | - caps = Selenium::WebDriver::Remote::Capabilities.firefox(marionette: true) |
93 | | - @opt[:desired_capabilities] = caps |
94 | | - expect { @driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt }.to_not raise_exception |
95 | | - @driver1.quit |
96 | | - end |
97 | | - |
98 | | - compliant_on browser: :marionette do |
99 | | - # This passes in isolation, but can not run in suite due to combination of |
100 | | - # https://bugzilla.mozilla.org/show_bug.cgi?id=1228107 & https://github.com/SeleniumHQ/selenium/issues/1150 |
101 | | - it 'Uses Wires when setting marionette option in driver initialization' do |
102 | | - @opt[:marionette] = true |
103 | | - driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt |
104 | | - |
105 | | - expect(driver1.capabilities[:browser_version]).to_not be_nil |
106 | | - driver1.quit |
| 91 | + # https://github.com/mozilla/geckodriver/issues/58 |
| 92 | + not_compliant_on browser: :marionette do |
| 93 | + context 'when shared example' do |
| 94 | + it_behaves_like 'driver that can be started concurrently', :marionette |
107 | 95 | end |
108 | 96 | end |
109 | 97 |
|
110 | | - # test with firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=1228121 |
111 | | - compliant_on browser: :firefox do |
112 | | - it 'Does not use geckodriver when marionette option is not set' do |
| 98 | + # Test in isolation: https://bugzilla.mozilla.org/show_bug.cgi?id=1228121 |
| 99 | + not_compliant_on browser: :marionette do |
| 100 | + it 'Does not use geckodriver when marionette option is set to false' do |
| 101 | + caps = Remote::Capabilities.firefox(marionette: false) |
| 102 | + @opt[:desired_capabilities] = caps |
| 103 | + |
113 | 104 | driver1 = Selenium::WebDriver.for GlobalTestEnv.driver, @opt |
114 | 105 |
|
115 | 106 | expect { driver1.capabilities.browser_version }.to raise_exception NoMethodError |
116 | 107 | driver1.quit |
117 | 108 | end |
118 | 109 | end |
119 | | - |
120 | | - compliant_on driver: :marionette do |
121 | | - # https://github.com/mozilla/geckodriver/issues/58 |
122 | | - not_compliant_on driver: :marionette do |
123 | | - context 'when shared example' do |
124 | | - before { driver } |
125 | | - it_behaves_like 'driver that can be started concurrently', :marionette |
126 | | - end |
127 | | - end |
128 | | - end |
129 | 110 | end |
130 | 111 | end |
131 | 112 | end # WebDriver |
|
0 commit comments