Example #1
0
def test_debugger_address_true_fission_override(session):
    debugger_address = session.capabilities.get("moz:debuggerAddress")
    assert debugger_address is not None

    host, port = debugger_address.split(":")
    assert host == "localhost"
    assert port.isnumeric()

    # Fetch the browser version via the debugger address
    http = HTTPRequest(host, int(port))
    with http.get("/json/version") as response:
        data = json.loads(response.read())
        assert session.capabilities["browserVersion"] in data["Browser"]

    # Allow Fission to be enabled when setting the preference
    with using_context(session, "chrome"):
        assert (session.execute_script(
            """return Services.appinfo.fissionAutostart""") is True)
Example #2
0
def test_debugger_address_true_fission_disabled(session):
    debugger_address = session.capabilities.get("moz:debuggerAddress")
    assert debugger_address is not None

    host, port = debugger_address.split(":")
    assert host == "localhost"
    assert port.isnumeric()

    # Fetch the browser version via the debugger address
    http = HTTPRequest(host, int(port))
    with http.get("/json/version") as response:
        data = json.loads(response.read())
        assert session.capabilities["browserVersion"] in data["Browser"]

    # Force disabling Fission until Remote Agent is compatible
    with using_context(session, "chrome"):
        assert (session.execute_script(
            """return Services.appinfo.fissionAutostart""") is False)
Example #3
0
def test_debugger_address_true(new_session, configuration):
    capabilities = dict(configuration["capabilities"])
    capabilities["moz:debuggerAddress"] = True

    response, _ = new_session({"capabilities": {"alwaysMatch": capabilities}})
    result = assert_success(response)

    debugger_address = result["capabilities"].get("moz:debuggerAddress")
    assert debugger_address is not None

    host, port = debugger_address.split(":")
    assert host == "localhost"
    assert port.isnumeric()

    # Fetch the browser version via the debugger address
    http = HTTPRequest(host, int(port))
    with http.get("/json/version") as response:
        data = json.loads(response.read())
        assert result["capabilities"]["browserVersion"] in data["Browser"]
def http(session):
    return HTTPRequest(session.transport.host, session.transport.port)
Example #5
0
def http(configuration):
    return HTTPRequest(configuration["host"], configuration["port"])