Path: blob/trunk/py/test/unit/selenium/webdriver/safari/safari_options_tests.py
1990 views
# Licensed to the Software Freedom Conservancy (SFC) under one1# or more contributor license agreements. See the NOTICE file2# distributed with this work for additional information3# regarding copyright ownership. The SFC licenses this file4# to you under the Apache License, Version 2.0 (the5# "License"); you may not use this file except in compliance6# with the License. You may obtain a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing,11# software distributed under the License is distributed on an12# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13# KIND, either express or implied. See the License for the14# specific language governing permissions and limitations15# under the License.1617import pytest1819from selenium.webdriver.common.options import PageLoadStrategy20from selenium.webdriver.safari.options import Options212223@pytest.fixture24def options():25return Options()262728def test_starts_with_default_capabilities(options):29from selenium.webdriver import DesiredCapabilities3031caps = DesiredCapabilities.SAFARI.copy()32caps.update({"pageLoadStrategy": PageLoadStrategy.normal})33assert options._caps == caps343536def test_is_a_baseoptions(options):37from selenium.webdriver.common.options import BaseOptions3839assert isinstance(options, BaseOptions)404142def test_can_set_automatic_inspection(options):43options.automatic_inspection = True44assert options.automatic_inspection is True45assert options._caps.get(Options.AUTOMATIC_INSPECTION) is True464748def test_can_set_automatic_profiling(options):49options.automatic_profiling = True50assert options.automatic_profiling is True51assert options._caps.get(Options.AUTOMATIC_PROFILING) is True525354def test_setting_technology_preview_changes_browser_name(options):55from selenium.webdriver import DesiredCapabilities5657BROWSER_NAME = "browserName"58assert options._caps.get(BROWSER_NAME) == DesiredCapabilities.SAFARI[BROWSER_NAME]5960options.use_technology_preview = True61assert options._caps.get(BROWSER_NAME) == options.SAFARI_TECH_PREVIEW6263options.use_technology_preview = False64assert options._caps.get(BROWSER_NAME) == DesiredCapabilities.SAFARI[BROWSER_NAME]656667