Path: blob/trunk/rb/spec/integration/selenium/webdriver/chrome/options_spec.rb
1865 views
# frozen_string_literal: true12# Licensed to the Software Freedom Conservancy (SFC) under one3# or more contributor license agreements. See the NOTICE file4# distributed with this work for additional information5# regarding copyright ownership. The SFC licenses this file6# to you under the Apache License, Version 2.0 (the7# "License"); you may not use this file except in compliance8# with the License. You may obtain a copy of the License at9#10# http://www.apache.org/licenses/LICENSE-2.011#12# Unless required by applicable law or agreed to in writing,13# software distributed under the License is distributed on an14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15# KIND, either express or implied. See the License for the16# specific language governing permissions and limitations17# under the License.1819require_relative '../spec_helper'2021module Selenium22module WebDriver23module Chrome24describe Options, exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :chrome}] do25it 'passes emulated device correctly' do26reset_driver!(emulation: {device_name: 'Nexus 5'}) do |driver|27ua = driver.execute_script 'return window.navigator.userAgent'28expect(ua).to include('Nexus 5')29end30end3132it 'passes emulated user agent correctly' do33reset_driver!(emulation: {user_agent: 'foo;bar'}) do |driver|34ua = driver.execute_script 'return window.navigator.userAgent'35expect(ua).to eq('foo;bar')36end37end3839it 'passes args correctly' do40reset_driver!(args: ['--user-agent=foo;bar']) do |driver|41ua = driver.execute_script 'return window.navigator.userAgent'42expect(ua).to eq('foo;bar')43end44end45end46end # Chrome47end # WebDriver48end # Selenium495051