Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/rb/spec/integration/selenium/webdriver/edge/options_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 Edge
25
describe Options, exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :edge}] do
26
it 'passes emulated device correctly' do
27
reset_driver!(emulation: {device_name: 'Nexus 5'}) do |driver|
28
ua = driver.execute_script 'return window.navigator.userAgent'
29
expect(ua).to include('Nexus 5')
30
end
31
end
32
33
it 'passes emulated user agent correctly' do
34
reset_driver!(emulation: {user_agent: 'foo;bar'}) do |driver|
35
ua = driver.execute_script 'return window.navigator.userAgent'
36
expect(ua).to eq('foo;bar')
37
end
38
end
39
40
it 'passes args correctly' do
41
reset_driver!(args: ['--user-agent=foo;bar']) do |driver|
42
ua = driver.execute_script 'return window.navigator.userAgent'
43
expect(ua).to eq('foo;bar')
44
end
45
end
46
end
47
end # Edge
48
end # WebDriver
49
end # Selenium
50
51