| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
import pytest |
| 19 |
|
| 20 |
from selenium.webdriver.common.options import PageLoadStrategy |
| 21 |
from selenium.webdriver.wpewebkit.options import Options |
| 22 |
|
| 23 |
|
| 24 |
@pytest.fixture |
| 25 |
def options(): |
| 26 |
return Options() |
| 27 |
|
| 28 |
|
| 29 |
def test_starts_with_default_capabilities(options): |
| 30 |
from selenium.webdriver import DesiredCapabilities |
| 31 |
|
| 32 |
caps = DesiredCapabilities.WPEWEBKIT.copy() |
| 33 |
caps.update({"pageLoadStrategy": PageLoadStrategy.normal}) |
| 34 |
assert options._caps == caps |
| 35 |
|
| 36 |
|
| 37 |
def test_set_binary_location(options): |
| 38 |
options.binary_location = "/foo/bar" |
| 39 |
assert options._binary_location == "/foo/bar" |
| 40 |
|
| 41 |
|
| 42 |
def test_get_binary_location(options): |
| 43 |
options._binary_location = "/foo/bar" |
| 44 |
assert options.binary_location == "/foo/bar" |
| 45 |
|
| 46 |
|
| 47 |
def test_creates_capabilities(options): |
| 48 |
options._arguments = ["foo"] |
| 49 |
options._binary_location = "/bar" |
| 50 |
caps = options.to_capabilities() |
| 51 |
opts = caps.get(Options.KEY) |
| 52 |
assert opts |
| 53 |
assert "foo" in opts["args"] |
| 54 |
assert opts["binary"] == "/bar" |
| 55 |
|
| 56 |
|
| 57 |
def test_is_a_baseoptions(options): |
| 58 |
from selenium.webdriver.common.options import BaseOptions |
| 59 |
|
| 60 |
assert isinstance(options, BaseOptions) |