Skip to content

Commit 805bf1f

Browse files
committed
Update Firefox profile specs to use W3C-compliant API
1 parent 88c0fd6 commit 805bf1f

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@ def read_generated_prefs(from = nil)
3232
File.read(File.join(dir, 'user.js'))
3333
end
3434

35-
def profile_opts
36-
if GlobalTestEnv.driver == :remote
37-
opt = {desired_capabilities: GlobalTestEnv.remote_capabilities.dup}
38-
opt[:desired_capabilities][:firefox_profile] = profile
39-
opt[:url] = GlobalTestEnv.remote_server.webdriver_url if GlobalTestEnv.remote_server?
40-
opt
41-
else
42-
options = Options.new
43-
options.profile = profile
44-
45-
{options: options}
46-
end
47-
end
48-
4935
it 'should set additional preferences' do
5036
profile['foo.number'] = 123
5137
profile['foo.boolean'] = true
@@ -175,15 +161,15 @@ def profile_opts
175161
end
176162

177163
it 'should instantiate the browser with the correct profile' do
178-
create_driver!(profile_opts) do |driver|
164+
create_driver!(options: Options.new(profile: profile)) do |driver|
179165
expect { wait(5).until { driver.find_element(id: 'oneline') } }.not_to raise_error
180166
end
181167
end
182168

183169
it 'should be able to use the same profile more than once' do
184-
create_driver!(profile_opts) do |driver1|
170+
create_driver!(options: Options.new(profile: profile)) do |driver1|
185171
expect { wait(5).until { driver1.find_element(id: 'oneline') } }.not_to raise_error
186-
create_driver!(profile_opts) do |driver2|
172+
create_driver!(options: Options.new(profile: profile)) do |driver2|
187173
expect { wait(5).until { driver2.find_element(id: 'oneline') } }.not_to raise_error
188174
end
189175
end

0 commit comments

Comments
 (0)