Path: blob/trunk/py/test/unit/selenium/webdriver/wpewebkit/wpewebkit_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.wpewebkit.options import Options212223@pytest.fixture24def options():25return Options()262728def test_starts_with_default_capabilities(options):29from selenium.webdriver import DesiredCapabilities3031caps = DesiredCapabilities.WPEWEBKIT.copy()32caps.update({"pageLoadStrategy": PageLoadStrategy.normal})33assert options._caps == caps343536def test_set_binary_location(options):37options.binary_location = "/foo/bar"38assert options._binary_location == "/foo/bar"394041def test_get_binary_location(options):42options._binary_location = "/foo/bar"43assert options.binary_location == "/foo/bar"444546def test_creates_capabilities(options):47options._arguments = ["foo"]48options._binary_location = "/bar"49caps = options.to_capabilities()50opts = caps.get(Options.KEY)51assert opts52assert "foo" in opts["args"]53assert opts["binary"] == "/bar"545556def test_is_a_baseoptions(options):57from selenium.webdriver.common.options import BaseOptions5859assert isinstance(options, BaseOptions)606162