Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/rb/spec/integration/selenium/webdriver/firefox/profile_spec.rb
1865 views
1
# frozen_string_literal: true
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
module Firefox
25
describe Profile, exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :firefox}] do
26
let(:profile) { described_class.new }
27
28
before do
29
profile['browser.startup.homepage'] = url_for('simpleTest.html')
30
profile['browser.startup.page'] = 1
31
end
32
33
it 'instantiates the browser with the correct profile' do
34
reset_driver!(profile: profile) do |driver|
35
expect { wait(5).until { driver.find_element(id: 'oneline') } }.not_to raise_error
36
end
37
end
38
39
it 'is able to use the same profile more than once',
40
exclude: {driver: :remote, rbe: true, reason: 'Cannot start 2+ drivers at once.'} do
41
reset_driver!(profile: profile) do |driver1|
42
expect { wait(5).until { driver1.find_element(id: 'oneline') } }.not_to raise_error
43
reset_driver!(profile: profile) do |driver2|
44
expect { wait(5).until { driver2.find_element(id: 'oneline') } }.not_to raise_error
45
end
46
end
47
end
48
end
49
end # Firefox
50
end # WebDriver
51
end # Selenium
52
53