Ejemplo n.º 1
0
               {"proxytype": "system"}, {"PROXYTYPE": "system"}, {"proxyType": None},
               {"proxyType": 1}, {"proxyType": []}, {"proxyType": {"value": "system"}},
               {" proxyType": "system"}, {"proxyType ": "system"}, {"proxyType ": " system"},
               {"proxyType": "system "}]),
    ("timeouts", [1, [], "{}", False, {"pageLOAD": 10}, {"page load": 10},
                  {"page load": 10}, {"pageLoad": "10"}, {"pageLoad": {"value": 10}},
                  {"invalid": 10}, {"pageLoad": -1}, {"pageLoad": 2**64},
                  {"pageLoad": None}, {"pageLoad": 1.1}, {"pageLoad": 10, "invalid": 10},
                  {" pageLoad": 10}, {"pageLoad ": 10}]),
    ("unhandledPromptBehavior", [1, [], {}, False, "DISMISS", "dismissABC", "Accept",
                                 " dismiss", "dismiss "])
]

@pytest.mark.parametrize("body", [lambda key, value: {"alwaysMatch": {key: value}},
                                  lambda key, value: {"firstMatch": [{key: value}]}])
@pytest.mark.parametrize("key,value", flatten(product(*item) for item in invalid_data))
def test_invalid_values(new_session, add_browser_capabilites, body, key, value):
    capabilities = body(key, value)
    if "alwaysMatch" in capabilities:
        capabilities["alwaysMatch"] = add_browser_capabilites(capabilities["alwaysMatch"])
    else:
        capabilities["firstMatch"][0] = add_browser_capabilites(capabilities["firstMatch"][0])
    with pytest.raises(error.InvalidArgumentException):
        resp = new_session({"capabilities": capabilities})


invalid_extensions = [
    "firefox",
    "firefox_binary",
    "firefoxOptions",
    "chromeOptions",
Ejemplo n.º 2
0
#META: timeout=long

import pytest

from conftest import product, flatten

from support.create import valid_data


@pytest.mark.parametrize("key,value",
                         flatten(product(*item) for item in valid_data))
def test_valid(new_session, key, value):
    resp = new_session({"capabilities": {"alwaysMatch": {key: value}}})