Same structure, fewer concepts to hold at once
Reach-through chains go from 70 to 3, and the three left are the definitions of the properties that replaced them - the one place allowed to know the shape of the tree. FrameDispatcher wrote `self.page.actions` thirty-eight times, so thirty-eight places knew where the actions engine lives; now one does. The worst was in RouteDispatcher, five levels on a single line, and it escaped the first pass because that class was not on my list. server.py loses 263 lines. The seventeen leaf helpers touched no class and sat BETWEEN the classes, so reading ElementHandleDispatcher you fell into `_serialize` on the way to FrameDispatcher. They are now in `_marshal` (shaping protocol values) and `_profile` (writing the profile) rather than one `_helpers`, which is the bucket every project grows and nobody can name. factory.py disappears into transport.py: it chose between two transports when one is left, which is literally a module that exists to call another one. Its typo guard went with it - it protected against running the driver by accident, and there is no driver. The message for anyone who still has INVPW_TRANSPORT=driver set stays: 0.7.4 shipped with it as the default. And the six methods the two entry points had identical are one definition. `_session` was created on 2026-07-27 for exactly this and the duplication outlived its own creation: it had extracted the functions, not the methods that call them. The two classes use the same fourteen attributes of `self` across those six, and the ASTs of the bodies compare equal - what made them look different was comments worded differently. What was NOT removed, which is the half that matters: the transport's worker threads (every Juggler operation blocks; on the event loop they would kill asyncio.gather), the out-of-perimeter `_impl` classes (they produce a refusal that NAMES the feature; without them it is AttributeError), `protocol.py` (it is the frozen reference the generator's --check compares against - the move was planned and withdrawn once its function was found), and splitting the mutually recursive dispatcher graph, which would buy navigation with import cycles. The net was built FIRST: upstream_regressions.py does not ask for green - 162 of 698 pass - it asks that none of the 162 stop. Its first real run reports no regressions. Two gates learned something from the refactor. check_unresolved_names.py only walked methods inside classes, so it reported "clean" while a moved helper used `json` with no import - the two new modules have no classes at all. Widened to module-level functions, plus the false positive that widening produced (`__file__` is not a builtin): 13 selftest cases to 16. And a rule this cost three separate breakages to learn: an import is not unused because the file holding it does not use it. Something can be reaching a name THROUGH it - another module's import, or a monkeypatch target. The second time, it had been verified with a precise AST analysis of uses inside the file, which is structurally unable to see it.
This commit is contained in:
1 parent
9f426d365b
commit
e247b733c6
20 files changed
+1697
-705
No files matched your search
@@ -51,6 +51,13 @@ def _module_names(tree: ast.AST) -> set:
|
||||
known |= {a.asname or a.name.split(".")[0]
|
||||
for n in ast.walk(tree) if isinstance(n, (ast.Import, ast.ImportFrom))
|
||||
for a in n.names}
|
||||
# ⛔ THE MODULE DUNDERS, which are not builtins and are not imports:
|
||||
# Python puts them in the module namespace itself. They only became
|
||||
# reachable when this gate started walking module-level functions, and
|
||||
# `__file__` in a plain function is the commonest of them by far - it was
|
||||
# the first false positive the widening produced.
|
||||
known |= {"__file__", "__name__", "__doc__", "__package__", "__spec__",
|
||||
"__loader__", "__builtins__", "__path__"}
|
||||
return known | set(dir(builtins))
|
||||
|
||||
|
||||
@@ -108,13 +115,27 @@ def unresolved(source: str, where: str = "<source>") -> list:
|
||||
tree = ast.parse(source)
|
||||
known = _module_names(tree)
|
||||
out = []
|
||||
|
||||
def scan(fn, owner):
|
||||
bound = _bound_in(fn)
|
||||
for n in ast.walk(fn):
|
||||
if isinstance(n, ast.Name) and isinstance(n.ctx, ast.Load):
|
||||
if n.id not in bound and n.id not in known:
|
||||
out.append((where, owner, fn.name, n.id, n.lineno))
|
||||
|
||||
for cls in [n for n in ast.walk(tree) if isinstance(n, ast.ClassDef)]:
|
||||
for fn in [n for n in cls.body if isinstance(n, _FUNCTIONS)]:
|
||||
bound = _bound_in(fn)
|
||||
for n in ast.walk(fn):
|
||||
if isinstance(n, ast.Name) and isinstance(n.ctx, ast.Load):
|
||||
if n.id not in bound and n.id not in known:
|
||||
out.append((where, cls.name, fn.name, n.id, n.lineno))
|
||||
scan(fn, cls.name)
|
||||
# ⛔ MODULE-LEVEL FUNCTIONS TOO, and they were invisible until
|
||||
# 2026-08-29. This gate was written against a file of dispatcher classes,
|
||||
# so it walked classes and nothing else; a plain function was never looked
|
||||
# at. It cost a real defect the day a refactor moved seventeen leaf helpers
|
||||
# into two new modules with no classes at all: one of them used `json`
|
||||
# without importing it, this gate reported "none in 103 files", and the
|
||||
# failure surfaced as a NameError out of one test - which is the exact
|
||||
# shape it exists to catch before a caller does.
|
||||
for fn in [n for n in tree.body if isinstance(n, _FUNCTIONS)]:
|
||||
scan(fn, "<module>")
|
||||
return out
|
||||
|
||||
|
||||
@@ -129,6 +150,12 @@ SELFTEST = [
|
||||
"class A:\n def op(self):\n v = 1\n return v\n", 0),
|
||||
("a module-level name is not a fault",
|
||||
"H = 1\nclass A:\n def op(self):\n return H\n", 0),
|
||||
("a MODULE-LEVEL FUNCTION using a name nobody imported",
|
||||
"def helper(x):\n return json.dumps(x)\n", 1),
|
||||
("the same module-level function with the import present",
|
||||
"import json\ndef helper(x):\n return json.dumps(x)\n", 0),
|
||||
("__file__ in a module-level function is not a fault",
|
||||
"def where():\n return __file__\n", 0),
|
||||
("an import is not a fault",
|
||||
"import json\nclass A:\n def op(self):\n return json\n", 0),
|
||||
("a builtin is not a fault",
|
||||
|
||||
@@ -164,6 +164,10 @@ def main() -> int:
|
||||
help="the sync arm first: it is the one our own API mirrors")
|
||||
p.add_argument("-k", dest="selection", default=None)
|
||||
p.add_argument("--timeout", default="60")
|
||||
p.add_argument("--junit-xml", dest="junit", default=None,
|
||||
help="write a JUnit XML too: it is the only per-test record "
|
||||
"this suite produces, and `upstream_regressions.py` "
|
||||
"needs it")
|
||||
p.add_argument("--per-file", action="store_true",
|
||||
help="one pytest process per file: mandatory on the async "
|
||||
"arm, see `_per_file`")
|
||||
@@ -182,6 +186,10 @@ def main() -> int:
|
||||
"-q", "--no-header", "-rN"]
|
||||
if a.selection:
|
||||
argv += ["-k", a.selection]
|
||||
if a.junit:
|
||||
# ⛔ An absolute path: pytest runs with `cwd=SUITE`, so a relative one
|
||||
# lands inside the vendored copy, which nothing is allowed to write to.
|
||||
argv += ["--junitxml", str(pathlib.Path(a.junit).resolve())]
|
||||
|
||||
import os
|
||||
env = dict(os.environ)
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
"""No test that passes today may fail tomorrow.
|
||||
|
||||
⛔ THIS IS THE NET A REFACTOR NEEDS, and "the suite stays green" is not
|
||||
available as one: of the 698 sync tests, 163 pass. Most of the red is either a
|
||||
decision this package took on purpose - `perimeter.py` refuses 77 names - or a
|
||||
hole nobody has filled yet. A gate that asked for green would be red forever
|
||||
and would teach people to skip it.
|
||||
|
||||
So the question is narrower, and answerable without any green: **did anything
|
||||
that worked stop working?**
|
||||
|
||||
⛔ READ FROM A JUNIT XML, AND THE FIRST VERSION READ THE PROGRESS LINE INSTEAD.
|
||||
That looked cheap - pytest prints one character per test as it goes, in
|
||||
collection order, so zipping it against `--collect-only` seemed to give the
|
||||
same map without re-running anything. It is wrong, and by a margin a spot check
|
||||
would have missed: on the real report there are **711 characters for 698
|
||||
collected tests**. A test that fails and then errors in teardown prints TWO.
|
||||
Pairing them would have attributed every outcome after the thirteenth
|
||||
double-printing test to the wrong test, and the map would have looked
|
||||
plausible. The length check refused it, which is the only reason it was caught.
|
||||
|
||||
A JUnit XML has one entry per test with its outcome. It costs a flag.
|
||||
|
||||
python scripts/upstream_baseline.py <binary> --junit-xml out.xml
|
||||
python scripts/upstream_regressions.py --record out.xml
|
||||
python scripts/upstream_regressions.py --check out.xml
|
||||
python scripts/upstream_regressions.py --selftest
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
sys.stdout.reconfigure(encoding="utf-8")
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parent.parent
|
||||
#: Where the reference lives. Committed on purpose: a net kept out of the
|
||||
#: repository is a net that disagrees with the branch it is protecting.
|
||||
REFERENCE = ROOT / "tests" / "gates" / "upstream_baseline.json"
|
||||
|
||||
|
||||
def outcomes(xml_text: str) -> dict:
|
||||
"""test id -> "passed" | "failed" | "error" | "skipped".
|
||||
|
||||
⛔ A `<testcase>` WITH NO CHILD IS THE ONLY PASS. JUnit says what went
|
||||
wrong by adding a child element - `failure`, `error`, `skipped` - and says
|
||||
a pass by adding nothing. Reading it the other way round, looking for a
|
||||
positive marker, silently turns every pass into an unknown.
|
||||
"""
|
||||
root = ET.fromstring(xml_text)
|
||||
out = {}
|
||||
for case in root.iter("testcase"):
|
||||
name = "%s::%s" % (case.get("classname", ""), case.get("name", ""))
|
||||
esito = "passed"
|
||||
for child in case:
|
||||
tag = child.tag
|
||||
if tag in ("failure", "error", "skipped"):
|
||||
esito = tag if tag != "failure" else "failed"
|
||||
break
|
||||
# ⛔ A test can be recorded twice - a failure in the call phase and an
|
||||
# error in teardown. The WORSE outcome wins, so a teardown error can
|
||||
# never mask a passing call phase.
|
||||
if out.get(name, "passed") == "passed":
|
||||
out[name] = esito
|
||||
return out
|
||||
|
||||
|
||||
def compare(before: dict, after: dict) -> tuple:
|
||||
"""(regressions, repairs, disappeared). Only the first fails the gate."""
|
||||
regressions, repairs, gone = [], [], []
|
||||
for test, was in sorted(before.items()):
|
||||
now = after.get(test)
|
||||
if now is None:
|
||||
gone.append(test)
|
||||
elif was == "passed" and now != "passed":
|
||||
regressions.append((test, was, now))
|
||||
elif was != "passed" and now == "passed":
|
||||
repairs.append((test, was, now))
|
||||
return regressions, repairs, gone
|
||||
|
||||
|
||||
def _xml(*cases: tuple) -> str:
|
||||
parts = ['<testsuites><testsuite name="p">']
|
||||
for classname, name, child in cases:
|
||||
parts.append('<testcase classname="%s" name="%s">' % (classname, name))
|
||||
if child:
|
||||
parts.append("<%s message='x'/>" % child)
|
||||
parts.append("</testcase>")
|
||||
parts.append("</testsuite></testsuites>")
|
||||
return "".join(parts)
|
||||
|
||||
|
||||
def _selftest() -> int:
|
||||
before = outcomes(_xml(("a", "t1", None), ("a", "t2", None),
|
||||
("b", "t3", "failure")))
|
||||
cases = [
|
||||
("identical", _xml(("a", "t1", None), ("a", "t2", None),
|
||||
("b", "t3", "failure")), 0),
|
||||
("a passing test turns red", _xml(("a", "t1", None), ("a", "t2", "failure"),
|
||||
("b", "t3", "failure")), 1),
|
||||
("a passing test turns into an error",
|
||||
_xml(("a", "t1", None), ("a", "t2", "error"), ("b", "t3", "failure")), 1),
|
||||
("a red one heals: NOT a regression",
|
||||
_xml(("a", "t1", None), ("a", "t2", None), ("b", "t3", None)), 0),
|
||||
("a passing test turns into a skip: IS a regression",
|
||||
_xml(("a", "t1", None), ("a", "t2", "skipped"), ("b", "t3", "failure")), 1),
|
||||
]
|
||||
broken = 0
|
||||
for label, xml, expected in cases:
|
||||
found, _, _ = compare(before, outcomes(xml))
|
||||
if len(found) != expected:
|
||||
broken += 1
|
||||
print(" %-50s %s (%d regressions, expected %d)"
|
||||
% (label, "ok" if len(found) == expected else "BROKEN",
|
||||
len(found), expected))
|
||||
|
||||
# ⛔ the case the progress-line version got wrong: one test recorded twice,
|
||||
# a failing call phase and an erroring teardown. It must not read as a pass.
|
||||
twice = _xml(("a", "t1", "failure"), ("a", "t1", "error"))
|
||||
read_back = outcomes(twice)
|
||||
ok = read_back.get("a::t1") == "failed"
|
||||
if not ok:
|
||||
broken += 1
|
||||
print(" %-50s %s (read %r)"
|
||||
% ("a test recorded twice is not a pass", "ok" if ok else "BROKEN",
|
||||
read_back.get("a::t1")))
|
||||
|
||||
# and a test the reference knows that is no longer collected must not be
|
||||
# silently counted as fine.
|
||||
_, _, gone = compare(before, outcomes(_xml(("a", "t1", None))))
|
||||
ok2 = len(gone) == 2
|
||||
if not ok2:
|
||||
broken += 1
|
||||
print(" %-50s %s (%d)" % ("tests that vanished are reported",
|
||||
"ok" if ok2 else "BROKEN", len(gone)))
|
||||
print("selftest: %d cases, %d broken" % (len(cases) + 2, broken))
|
||||
return 1 if broken else 0
|
||||
|
||||
|
||||
def main() -> int:
|
||||
p = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||
p.add_argument("report", nargs="?", help="a JUnit XML from the baseline")
|
||||
p.add_argument("--record", action="store_true")
|
||||
p.add_argument("--check", action="store_true")
|
||||
p.add_argument("--selftest", action="store_true")
|
||||
a = p.parse_args()
|
||||
if a.selftest:
|
||||
return _selftest()
|
||||
if not a.report:
|
||||
p.error("a JUnit XML is needed")
|
||||
|
||||
now = outcomes(pathlib.Path(a.report).read_text(encoding="utf-8",
|
||||
errors="replace"))
|
||||
if a.record:
|
||||
REFERENCE.parent.mkdir(parents=True, exist_ok=True)
|
||||
REFERENCE.write_bytes(json.dumps(now, indent=1, sort_keys=True)
|
||||
.encode("utf-8"))
|
||||
counts: dict = {}
|
||||
for v in now.values():
|
||||
counts[v] = counts.get(v, 0) + 1
|
||||
print("recorded %d tests in %s" % (len(now), REFERENCE.name))
|
||||
print(" " + " ".join("%s=%d" % kv for kv in sorted(counts.items())))
|
||||
return 0
|
||||
|
||||
if not REFERENCE.exists():
|
||||
print("no reference recorded yet: run with --record first")
|
||||
return 2
|
||||
before = json.loads(REFERENCE.read_text(encoding="utf-8"))
|
||||
regressions, repairs, gone = compare(before, now)
|
||||
|
||||
for test, was, is_now in regressions:
|
||||
print("REGRESSION %s: %s -> %s" % (test, was, is_now))
|
||||
if repairs:
|
||||
print("(%d test(s) got BETTER, which this gate does not refuse)"
|
||||
% len(repairs))
|
||||
if gone:
|
||||
print("(%d recorded test(s) were not collected this time)" % len(gone))
|
||||
if regressions:
|
||||
print()
|
||||
print("UPSTREAM REGRESSIONS: %d test(s) that passed no longer do."
|
||||
% len(regressions))
|
||||
return 1
|
||||
print("UPSTREAM REGRESSIONS: none. %d recorded, %d of them passing."
|
||||
% (len(before), sum(1 for v in before.values() if v == "passed")))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,189 @@
|
||||
"""Turning protocol values into Python ones, and back.
|
||||
|
||||
⛔ THESE ARE LEAVES, WHICH IS WHY THEY COULD MOVE AT ALL. Not one of them
|
||||
mentions a dispatcher class: they take a value and return a value. `server.py`
|
||||
holds a mutually recursive object graph - a page makes frames, a frame makes
|
||||
element handles, a handle points back at its frame - and splitting THAT across
|
||||
modules buys navigation with import cycles, which is a bad trade. These do not
|
||||
have the problem, and they were scattered BETWEEN the classes: reading
|
||||
`ElementHandleDispatcher` you fell into `_serialize` on the way to
|
||||
`FrameDispatcher`.
|
||||
|
||||
They are re-exported from `server.py`, so nothing that imported them from
|
||||
there has to move.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
|
||||
def _as_callable(expression: str) -> str:
|
||||
"""Wrap an expression so it can always be CALLED with the argument.
|
||||
|
||||
<M> PLAYWRIGHT SENDS BOTH FORMS DOWN THE SAME FIELD. `page.evaluate("1+1")`
|
||||
and `page.evaluate("() => document.title")` arrive as the same
|
||||
`expression` string, and the client does not say which is which. Evaluating
|
||||
the raw string works for the first and, for the second, produces a FUNCTION
|
||||
OBJECT: no error, no exception, and the caller gets None back for a call
|
||||
that looked fine.
|
||||
|
||||
Measured on 2026-08-27: `page.evaluate("() => !!x")` answered None, and the
|
||||
assertion that caught it read like the browser had changed behaviour.
|
||||
|
||||
So the string is wrapped and the result called if it turned out to be a
|
||||
function. Deciding by shape - does it start with `(` or `function` or
|
||||
`async` - is the version that gets it wrong: `(1+2)` starts with a
|
||||
parenthesis and is not a function.
|
||||
"""
|
||||
return ("(() => { const r = (%s);"
|
||||
" return typeof r === 'function' ? r(ARG) : r; })()" % expression)
|
||||
|
||||
|
||||
def _deserialize(value: Any) -> Any:
|
||||
"""The tagged union Playwright sends for an ARGUMENT, back to a value."""
|
||||
if not isinstance(value, dict):
|
||||
return value
|
||||
if "value" in value and "handles" in value:
|
||||
return _deserialize(value["value"])
|
||||
for tag, convert in (("n", lambda v: v), ("s", lambda v: v),
|
||||
("b", lambda v: v)):
|
||||
if tag in value:
|
||||
return convert(value[tag])
|
||||
if "v" in value:
|
||||
return {"null": None, "undefined": None, "NaN": float("nan"),
|
||||
"Infinity": float("inf"),
|
||||
"-Infinity": float("-inf")}.get(value["v"])
|
||||
if "a" in value:
|
||||
return [_deserialize(x) for x in value["a"]]
|
||||
if "o" in value:
|
||||
return {e["k"]: _deserialize(e["v"]) for e in value["o"]}
|
||||
return None
|
||||
|
||||
|
||||
def _with_argument(params: Dict) -> str:
|
||||
"""The expression, callable, with the caller's argument substituted in."""
|
||||
argument = _deserialize(params.get("arg"))
|
||||
return _as_callable(params["expression"]).replace(
|
||||
"ARG", json.dumps(argument, default=str))
|
||||
|
||||
|
||||
def _js_string(value: str) -> str:
|
||||
"""A Python string as a JavaScript literal.
|
||||
|
||||
⛔ `json.dumps` and never manual quoting: the html handed to `set_content`
|
||||
is arbitrary, and a single quote, a backslash or a line separator inside it
|
||||
would close the literal early. That exact defect - an apostrophe closing a
|
||||
single-quoted JavaScript string - broke the driver bundle on 2026-08-24.
|
||||
"""
|
||||
return json.dumps(value)
|
||||
|
||||
|
||||
def _guid_of(value: Any) -> Optional[str]:
|
||||
if isinstance(value, dict) and "guid" in value:
|
||||
return value["guid"]
|
||||
return None
|
||||
|
||||
|
||||
def _serialize(value: Any, counter: Optional[Dict] = None) -> Any:
|
||||
"""A Python value in the shape `parse_result` expects.
|
||||
|
||||
⛔ Playwright does not send bare JSON: it sends a tagged union, and
|
||||
`_connection.parse_value` reads the TAG. A bare `True` where `{"b": true}`
|
||||
is expected does not raise - it falls through to the object branch and comes
|
||||
back as something else entirely.
|
||||
"""
|
||||
if counter is None:
|
||||
counter = {"n": 0}
|
||||
if value is None:
|
||||
return {"v": "null"}
|
||||
if isinstance(value, bool):
|
||||
return {"b": value}
|
||||
if isinstance(value, (int, float)):
|
||||
return {"n": value}
|
||||
if isinstance(value, str):
|
||||
return {"s": value}
|
||||
if isinstance(value, (list, tuple)):
|
||||
# <M> `id` IS MANDATORY on a list and on an object, and its absence is
|
||||
# a KeyError deep inside `parse_value`, not a message. Playwright uses
|
||||
# it to rebuild cyclic references: every container is registered under
|
||||
# its id so a later `{"ref": id}` can point back at it. We never emit a
|
||||
# `ref` - the values crossing here come from JSON and cannot be cyclic
|
||||
# - but the id has to be there anyway, because the reader indexes on it
|
||||
# unconditionally.
|
||||
counter["n"] += 1
|
||||
return {"a": [_serialize(x, counter) for x in value], "id": counter["n"]}
|
||||
if isinstance(value, dict):
|
||||
counter["n"] += 1
|
||||
return {"o": [{"k": k, "v": _serialize(v, counter)}
|
||||
for k, v in value.items()], "id": counter["n"]}
|
||||
return {"s": str(value)}
|
||||
|
||||
|
||||
# ── network ─────────────────────────────────────────────────────────────────
|
||||
def _headers_array(raw) -> List[Dict[str, str]]:
|
||||
"""Headers as the ARRAY of pairs the client expects, never a dict.
|
||||
|
||||
⛔ `RawHeaders` iterates over `[{"name": ..., "value": ...}]` and a dict
|
||||
iterates over its KEYS, so handing one over does not raise: it produces a
|
||||
header list whose every value is missing, and `response.headers` comes back
|
||||
full of empty strings. Juggler already sends the array form; this exists so
|
||||
a caller-built dict cannot slip through.
|
||||
"""
|
||||
if isinstance(raw, dict):
|
||||
return [{"name": k, "value": str(v)} for k, v in raw.items()]
|
||||
out = []
|
||||
for entry in raw or []:
|
||||
if isinstance(entry, dict) and "name" in entry:
|
||||
out.append({"name": entry["name"],
|
||||
"value": str(entry.get("value", ""))})
|
||||
return out
|
||||
|
||||
|
||||
def _resource_type(params: Dict) -> str:
|
||||
"""⛔ Juggler says `cause`, Playwright says `resourceType`, and the two
|
||||
vocabularies only partly overlap. An unmapped cause becomes `other`, which
|
||||
is what upstream does too - guessing a nicer name would make
|
||||
`request.resource_type` disagree with itself between the two transports."""
|
||||
cause = (params.get("cause") or params.get("internalCause") or "").lower()
|
||||
return {
|
||||
"document": "document", "subdocument": "document",
|
||||
"stylesheet": "stylesheet", "script": "script",
|
||||
"image": "image", "imageset": "image",
|
||||
"font": "font", "media": "media",
|
||||
"xmlhttprequest": "xhr", "fetch": "fetch",
|
||||
"websocket": "websocket", "beacon": "other",
|
||||
}.get(cause, "other")
|
||||
|
||||
|
||||
def _button(name: Optional[str]) -> int:
|
||||
return {"left": 0, "middle": 1, "right": 2}.get(name or "left", 0)
|
||||
|
||||
|
||||
def _console_text(args: list) -> str:
|
||||
"""⛔ The console arguments arrive as remote objects, not as text. Reading
|
||||
`value` works for a primitive and gives nothing for an object, so the
|
||||
preview is used when there is one - which is what the driver shows too."""
|
||||
pieces = []
|
||||
for a in args:
|
||||
if not isinstance(a, dict):
|
||||
pieces.append(str(a))
|
||||
elif "value" in a:
|
||||
pieces.append(str(a["value"]))
|
||||
elif a.get("preview"):
|
||||
pieces.append(str(a["preview"]))
|
||||
elif a.get("unserializableValue"):
|
||||
pieces.append(str(a["unserializableValue"]))
|
||||
else:
|
||||
pieces.append(str(a.get("type") or "object"))
|
||||
return " ".join(pieces)
|
||||
|
||||
|
||||
def _location(raw) -> Dict:
|
||||
"""⛔ ALWAYS a location, never None: `_browser_context.py` casts it and
|
||||
falls back only on a missing KEY, so a null here becomes an AttributeError
|
||||
somewhere else entirely."""
|
||||
raw = raw or {}
|
||||
return {"url": raw.get("url") or "",
|
||||
"lineNumber": raw.get("lineNumber") or raw.get("line") or 0,
|
||||
"columnNumber": raw.get("columnNumber") or raw.get("column") or 0}
|
||||
@@ -0,0 +1,144 @@
|
||||
"""Writing the profile a Firefox launch is given, and reading back what it is.
|
||||
|
||||
⛔ Leaves, like the ones in `_marshal`: none of them mentions a dispatcher.
|
||||
What they have in common is a different subject - a directory on disk and the
|
||||
`user.js` inside it - which is why they are not in the same module. One
|
||||
`_helpers.py` holding both would be the bucket every project grows and nobody
|
||||
can name.
|
||||
|
||||
Re-exported from `server.py`: `tests/gates/prefs_byte_parity.py` and the
|
||||
transport tests import `_write_user_js`, `_host_of` and `_domain_matches` from
|
||||
there.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import pathlib
|
||||
import shutil
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
|
||||
def _remove_profile(directory: str) -> None:
|
||||
"""Take away a profile WE created. Never one the caller named.
|
||||
|
||||
⛔ IT MUST NOT RAISE. This runs while the session is already going away,
|
||||
and on Windows a file can still be held for a moment after the process that
|
||||
owned it exits. A profile left behind is a few dozen megabytes; an
|
||||
exception here would be a shutdown that fails for a reason nobody cares
|
||||
about, on a path the caller has already stopped watching.
|
||||
"""
|
||||
import shutil
|
||||
shutil.rmtree(directory, ignore_errors=True)
|
||||
|
||||
|
||||
def _write_user_js(profile_dir: str, prefs: Dict) -> int:
|
||||
"""The prefs, into the profile, BEFORE the browser starts.
|
||||
|
||||
⛔ WITHOUT THIS THE PYTHON PATH LAUNCHES A BROWSER THAT IS NOT THE PRODUCT,
|
||||
and it does so silently. Two hundred prefs arrive in `firefoxUserPrefs` on
|
||||
every `launch`, and the first draft of this server threw them away and
|
||||
started Firefox on an empty temporary profile. Everything worked - pages
|
||||
loaded, clicks landed, the tests were green - and every stealth declaration
|
||||
the package exists to make was simply absent.
|
||||
|
||||
It was caught by a closed shadow root, of all things: the engine patch that
|
||||
lets a locator reach inside one is gated on `StealthEngineActive()`, which
|
||||
is a pref. The same probe found the root through `_juggler` directly and
|
||||
lost it through the public API, and the only difference between those two
|
||||
arms was who wrote the profile. A gate for a completely different feature
|
||||
is what made the absence visible; nothing was checking for it directly.
|
||||
|
||||
⛔ AND THEY ARE WRITTEN, NOT SENT. Our fork already removed prefs from the
|
||||
protocol - `Browser.enable` does not accept them any more - because a
|
||||
browser configured on the second launch is a browser that was wrong on the
|
||||
first. This mirrors what the driver's `defaultArgs` does, in Python.
|
||||
|
||||
⛔ Gecko HAS NO FLOAT PREF TYPE: a fraction must be written as a STRING, or
|
||||
the parser fails on that line and IGNORES EVERY LINE AFTER IT. That is not
|
||||
a hypothetical - `ui.textScaleFactor` written as a number once killed the
|
||||
browser on the second context, and the failure looked nothing like a prefs
|
||||
problem.
|
||||
"""
|
||||
import os
|
||||
lines = []
|
||||
# ⛔ INSERTION ORDER, NOT SORTED. The driver uses `Object.keys()`, and the
|
||||
# two writers have to agree BYTE FOR BYTE - sorting produces a file that is
|
||||
# equally correct and not identical. Caught by
|
||||
# `tests/gates/prefs_byte_parity.py` on its very first real run, which is
|
||||
# the whole argument for keeping a judge around.
|
||||
for name in prefs:
|
||||
value = prefs[name]
|
||||
if isinstance(value, bool):
|
||||
rendered = "true" if value else "false"
|
||||
elif isinstance(value, int):
|
||||
rendered = str(value)
|
||||
elif isinstance(value, float):
|
||||
# ⛔ A string, deliberately. See the docstring.
|
||||
rendered = json.dumps(str(value))
|
||||
else:
|
||||
rendered = json.dumps(str(value))
|
||||
lines.append('user_pref(%s, %s);' % (json.dumps(name), rendered))
|
||||
os.makedirs(profile_dir, exist_ok=True)
|
||||
# ⛔ NO HEADER COMMENT, and no sorting either. The driver writes neither,
|
||||
# and this file has to match the driver's BYTE FOR BYTE - that is the
|
||||
# criterion item 1 was written with. A header is one line of difference in
|
||||
# a comparison whose whole value is that it finds differences.
|
||||
body = "\n".join(lines) + "\n"
|
||||
# ⛔ `write_bytes`: on Windows a text-mode write translates every newline,
|
||||
# and a prefs file is read by the browser, not by git.
|
||||
with open(os.path.join(profile_dir, "user.js"), "wb") as handle:
|
||||
handle.write(body.encode("utf-8"))
|
||||
return len(lines)
|
||||
|
||||
|
||||
def _read_version(executable: str) -> str:
|
||||
"""The base version, from `application.ini` next to the binary.
|
||||
|
||||
⛔ Read, never assumed: this project has three separate incidents where a
|
||||
folder name or a guess about the version sent a whole evening of
|
||||
measurements against the wrong build.
|
||||
"""
|
||||
import pathlib
|
||||
ini = pathlib.Path(executable).parent / "application.ini"
|
||||
try:
|
||||
for line in ini.read_text(encoding="utf-8",
|
||||
errors="replace").splitlines():
|
||||
if line.startswith("Version="):
|
||||
return line.split("=", 1)[1].strip()
|
||||
except OSError:
|
||||
pass
|
||||
return "0.0"
|
||||
|
||||
|
||||
def _only_set(params: Dict) -> Dict:
|
||||
"""The parameters that were actually given, with the absent ones REMOVED.
|
||||
|
||||
⛔ IN A CLOSED-WORLD SCHEMA, `null` AND ABSENT ARE DIFFERENT ANSWERS.
|
||||
Juggler validates every field it is handed: an Optional that arrives as
|
||||
`null` is not "not provided", it is a value of the wrong type, and the
|
||||
command is REJECTED at runtime with `Object "<root>.clip" is undefined,
|
||||
but has some scheme`. Measured on 2026-08-28 on `Page.screenshot`, whose
|
||||
clip and quality are both optional and were both being sent as null.
|
||||
|
||||
⛔ AND THIS IS NOT DONE INSIDE `Connection.send`, tempting as that is:
|
||||
some commands mean something BY sending null. `Browser.setGeolocationOverride`
|
||||
with `geolocation: null` CLEARS the override, and stripping it there would
|
||||
turn "stop pretending to be somewhere" into "do nothing".
|
||||
"""
|
||||
return {k: v for k, v in params.items() if v is not None}
|
||||
|
||||
|
||||
def _host_of(url: str) -> str:
|
||||
"""The host of a url, without importing a parser for three characters."""
|
||||
without_scheme = url.split("://", 1)[-1]
|
||||
return without_scheme.split("/", 1)[0].split(":", 1)[0].lower()
|
||||
|
||||
|
||||
def _domain_matches(cookie_domain: str, host: str) -> bool:
|
||||
"""⛔ A LEADING DOT MEANS "AND EVERY SUBDOMAIN", and dropping it turns a
|
||||
site-wide cookie into one that matches nothing. Comparing the two strings
|
||||
directly is the version that looks right and returns an empty list."""
|
||||
domain = (cookie_domain or "").lstrip(".").lower()
|
||||
if not domain or not host:
|
||||
return False
|
||||
return host == domain or host.endswith("." + domain)
|
||||
@@ -1,88 +0,0 @@
|
||||
"""Which transport the package uses, and the switch that keeps both judgeable.
|
||||
|
||||
⛔ THE NODE DRIVER IS NOT DEAD CODE: IT IS THE JUDGE. The Python server
|
||||
answers the same protocol the driver answers, so the only honest way to know it
|
||||
answers CORRECTLY is to run the same session through both and compare. Deleting
|
||||
it would leave this path with nothing to be measured against, which is the shape
|
||||
of mistake this project has paid for before - a build that agrees with itself.
|
||||
|
||||
⛔ And the bundle it lives in has THREE other jobs that have nothing to do with
|
||||
Node the runtime: `prefs_byte_parity.py` reads the driver's `user.js` rules from
|
||||
it on every run rather than copying them, and `gen_injected_source.py` and
|
||||
`gen_key_layout.py` generate from it. Deleting the folder would turn three
|
||||
derived facts back into hand-copied ones.
|
||||
|
||||
INVPW_TRANSPORT=juggler the Python server in this package (default)
|
||||
INVPW_TRANSPORT=driver the Node driver, kept as the judge and the way back
|
||||
|
||||
⛔ THE DEFAULT FLIPPED ON 2026-08-28, AND IT FLIPPED ON EVIDENCE. It was
|
||||
DRIVER while this matured, on the reasoning that a half-finished server which
|
||||
silently became the default would turn every user's session into an experiment.
|
||||
What made it flip is not that the code looks done - it is four measurements
|
||||
taken the same day, on one code state:
|
||||
|
||||
* `run_e2e.py`: **188 passed on BOTH transports**, zero failures;
|
||||
* `judge_both_transports.py`: 50 green on both, **0 red only on ours**;
|
||||
* `diff_protocol.py`: **parity** on methods, parameter names, object types,
|
||||
initializer fields, events AND parentage;
|
||||
* the realness gates, run on this path for the first time: `fppro_full`
|
||||
ALL CRITICAL FLAGS CLEAN 18/18, `fppro_consistency` PASS 43/43,
|
||||
`observable_crossings` no crossings.
|
||||
|
||||
⛔ AND THE DRIVER STAYS REACHABLE, deliberately. It is not dead weight: it is
|
||||
the only second arm this project has, and `judge_both_transports.py` and
|
||||
`diff_protocol.py` exist only while there are two. It costs a user nothing -
|
||||
nothing downloads Node unless this variable asks for it - and it is the way back
|
||||
if a session ever behaves differently on the new path.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
#: The environment variable, named once so nothing can spell it two ways.
|
||||
CHOICE_ENV = "INVPW_TRANSPORT"
|
||||
|
||||
DRIVER = "driver"
|
||||
JUGGLER = "juggler"
|
||||
|
||||
|
||||
def chosen() -> str:
|
||||
"""Which transport this process wants. Refuses an unknown name.
|
||||
|
||||
⛔ REFUSES instead of falling back to the default: a typo in the variable
|
||||
would otherwise run the driver while the caller believed they were testing
|
||||
the Python path, and every measurement taken that way would be a
|
||||
measurement of the wrong arm. This project has a rule about exactly that -
|
||||
a bench arm that is not what it says it is.
|
||||
"""
|
||||
value = (os.environ.get(CHOICE_ENV) or JUGGLER).strip().lower()
|
||||
if value not in (DRIVER, JUGGLER):
|
||||
raise ValueError(
|
||||
"%s=%r is not a transport: use %r (the Node driver) or %r (the "
|
||||
"Python server)." % (CHOICE_ENV, value, DRIVER, JUGGLER))
|
||||
return value
|
||||
|
||||
|
||||
def make_transport(loop: asyncio.AbstractEventLoop) -> Any:
|
||||
"""The transport the Connection should speak through."""
|
||||
if chosen() == JUGGLER:
|
||||
from .server import JugglerServer
|
||||
from .transport import InProcessTransport
|
||||
return InProcessTransport(loop, JugglerServer())
|
||||
# ⛔ THE NAME IS STILL ACCEPTED AND THE DRIVER IS GONE, and that is a
|
||||
# deliberate pair. Refusing the name outright would leave a caller who set
|
||||
# the variable months ago with `ValueError: not a transport` and no idea
|
||||
# what happened to it; this says what was removed, when, and how to get a
|
||||
# second arm back for a comparison.
|
||||
raise RuntimeError(
|
||||
"the Node driver was removed on 2026-08-28: this package no longer "
|
||||
"ships `_driver/` and no longer downloads node. "
|
||||
"What replaced it is the in-process Python server, which is now the "
|
||||
"default - unset %s and it runs. "
|
||||
"To get the old arm back for a COMPARISON (which is the only thing it "
|
||||
"was still for): check out the last commit that carried it into a git "
|
||||
"worktree and point INVPW_DRIVER_TREE at it. Both "
|
||||
"`judge_both_transports.py` and `diff_protocol.py` read that variable."
|
||||
% CHOICE_ENV)
|
||||
@@ -90,6 +90,19 @@ class Lifecycle:
|
||||
"""Stop listening. Called when the page this follows goes away."""
|
||||
self.c.remove_listener(self._route)
|
||||
|
||||
def frame(self, frame_id: str):
|
||||
"""The frame with this id, or None.
|
||||
|
||||
⛔ HERE AND NOT AT THE CALLER, because how frames are kept is this
|
||||
object's business. Callers used to reach in with
|
||||
`self.lifecycle.frames.get(id)` - two of them - and each one of those
|
||||
also asserted that `frames` is a dict keyed by id. `_frame()` below
|
||||
CREATES one when it is missing, which is right for an event arriving
|
||||
for a frame we never saw attach and wrong for a caller that only wants
|
||||
to look: the two readings need two names.
|
||||
"""
|
||||
return self.frames.get(frame_id)
|
||||
|
||||
# ── event intake ────────────────────────────────────────────────────────
|
||||
def _on_event(self, method: str, p: dict) -> None:
|
||||
with self._cv:
|
||||
|
||||
@@ -41,72 +41,27 @@ from .injected import InjectedScript
|
||||
from .keyboard import MODIFIER_MASK
|
||||
from .lifecycle import Lifecycle
|
||||
|
||||
|
||||
def _as_callable(expression: str) -> str:
|
||||
"""Wrap an expression so it can always be CALLED with the argument.
|
||||
|
||||
<M> PLAYWRIGHT SENDS BOTH FORMS DOWN THE SAME FIELD. `page.evaluate("1+1")`
|
||||
and `page.evaluate("() => document.title")` arrive as the same
|
||||
`expression` string, and the client does not say which is which. Evaluating
|
||||
the raw string works for the first and, for the second, produces a FUNCTION
|
||||
OBJECT: no error, no exception, and the caller gets None back for a call
|
||||
that looked fine.
|
||||
|
||||
Measured on 2026-08-27: `page.evaluate("() => !!x")` answered None, and the
|
||||
assertion that caught it read like the browser had changed behaviour.
|
||||
|
||||
So the string is wrapped and the result called if it turned out to be a
|
||||
function. Deciding by shape - does it start with `(` or `function` or
|
||||
`async` - is the version that gets it wrong: `(1+2)` starts with a
|
||||
parenthesis and is not a function.
|
||||
"""
|
||||
return ("(() => { const r = (%s);"
|
||||
" return typeof r === 'function' ? r(ARG) : r; })()" % expression)
|
||||
# ⛔ RE-EXPORTED ON PURPOSE, not merely imported. These leaf helpers moved out
|
||||
# of this file so that the classes below read as one story instead of being
|
||||
# interleaved with functions - but `tests/gates/prefs_byte_parity.py` and the
|
||||
# transport tests import `_write_user_js`, `_serialize`, `_host_of` and
|
||||
# `_domain_matches` from HERE, and a move that breaks its callers to tidy a
|
||||
# file is not a tidy-up. One definition, two names to reach it.
|
||||
from ._marshal import (_as_callable, _button, _console_text, _deserialize,
|
||||
_guid_of, _headers_array, _js_string, _location,
|
||||
_resource_type, _serialize, _with_argument)
|
||||
from ._profile import (_domain_matches, _host_of, _only_set, _read_version,
|
||||
_remove_profile, _write_user_js)
|
||||
|
||||
|
||||
|
||||
|
||||
def _deserialize(value: Any) -> Any:
|
||||
"""The tagged union Playwright sends for an ARGUMENT, back to a value."""
|
||||
if not isinstance(value, dict):
|
||||
return value
|
||||
if "value" in value and "handles" in value:
|
||||
return _deserialize(value["value"])
|
||||
for tag, convert in (("n", lambda v: v), ("s", lambda v: v),
|
||||
("b", lambda v: v)):
|
||||
if tag in value:
|
||||
return convert(value[tag])
|
||||
if "v" in value:
|
||||
return {"null": None, "undefined": None, "NaN": float("nan"),
|
||||
"Infinity": float("inf"),
|
||||
"-Infinity": float("-inf")}.get(value["v"])
|
||||
if "a" in value:
|
||||
return [_deserialize(x) for x in value["a"]]
|
||||
if "o" in value:
|
||||
return {e["k"]: _deserialize(e["v"]) for e in value["o"]}
|
||||
return None
|
||||
|
||||
|
||||
def _with_argument(params: Dict) -> str:
|
||||
"""The expression, callable, with the caller's argument substituted in."""
|
||||
argument = _deserialize(params.get("arg"))
|
||||
return _as_callable(params["expression"]).replace(
|
||||
"ARG", json.dumps(argument, default=str))
|
||||
|
||||
|
||||
def _js_string(value: str) -> str:
|
||||
"""A Python string as a JavaScript literal.
|
||||
|
||||
⛔ `json.dumps` and never manual quoting: the html handed to `set_content`
|
||||
is arbitrary, and a single quote, a backslash or a line separator inside it
|
||||
would close the literal early. That exact defect - an apostrophe closing a
|
||||
single-quoted JavaScript string - broke the driver bundle on 2026-08-24.
|
||||
"""
|
||||
return json.dumps(value)
|
||||
|
||||
|
||||
def _guid_of(value: Any) -> Optional[str]:
|
||||
if isinstance(value, dict) and "guid" in value:
|
||||
return value["guid"]
|
||||
return None
|
||||
|
||||
|
||||
# ── the leaves we do not implement, and say so ──────────────────────────────
|
||||
@@ -242,13 +197,21 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
super().__init__(server, frame,
|
||||
{"preview": preview or "JSHandle@node"})
|
||||
|
||||
# ⛔ Same reason as `page` just above, one level further: an element handle
|
||||
# reaches the injected script through the frame and the page, and thirteen
|
||||
# call sites used to spell that path out.
|
||||
@property
|
||||
def injected(self) -> "InjectedScript":
|
||||
return self.page.injected
|
||||
|
||||
|
||||
@property
|
||||
def page(self) -> "PageDispatcher":
|
||||
return self.frame.page
|
||||
|
||||
def op_dispose(self, params: Dict) -> Any:
|
||||
try:
|
||||
self.page.injected.dispose(self.frame.frame_id, self.object_id)
|
||||
self.injected.dispose(self.frame.frame_id, self.object_id)
|
||||
except Exception:
|
||||
# ⛔ A handle whose context is already gone is not an error worth
|
||||
# raising: the caller is tidying up, and the node it pointed at
|
||||
@@ -258,7 +221,7 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
return None
|
||||
|
||||
def op_bounding_box(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.bounding_box(
|
||||
return {"value": self.injected.bounding_box(
|
||||
self.frame.frame_id, self.object_id)}
|
||||
|
||||
def op_evaluate(self, params: Dict) -> Any:
|
||||
@@ -285,7 +248,7 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
It was found by diffing the protocol against the Node driver: the
|
||||
driver's `click` carried a `position` and ours did not.
|
||||
"""
|
||||
return {"value": _serialize(self.page.injected.call(
|
||||
return {"value": _serialize(self.injected.call(
|
||||
self.frame.frame_id,
|
||||
"(injected, el) => { const r = (%s);"
|
||||
" return typeof r === 'function' ? r(el, %s) : r; }"
|
||||
@@ -294,27 +257,27 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
{"objectId": self.object_id}))}
|
||||
|
||||
def op_text_content(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.text_content(
|
||||
return {"value": self.injected.text_content(
|
||||
self.frame.frame_id, self.object_id)}
|
||||
|
||||
def op_inner_text(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.inner_text(
|
||||
return {"value": self.injected.inner_text(
|
||||
self.frame.frame_id, self.object_id)}
|
||||
|
||||
def op_inner_html(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.inner_html(
|
||||
return {"value": self.injected.inner_html(
|
||||
self.frame.frame_id, self.object_id)}
|
||||
|
||||
def op_input_value(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.input_value(
|
||||
return {"value": self.injected.input_value(
|
||||
self.frame.frame_id, self.object_id)}
|
||||
|
||||
def op_get_attribute(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.get_attribute(
|
||||
return {"value": self.injected.get_attribute(
|
||||
self.frame.frame_id, self.object_id, params["name"])}
|
||||
|
||||
def op_get_property(self, params: Dict) -> Any:
|
||||
object_id = self.page.injected.call(
|
||||
object_id = self.injected.call(
|
||||
self.frame.frame_id,
|
||||
"(injected, o, n) => o[n]",
|
||||
{"objectId": self.object_id}, params["name"], by_value=False)
|
||||
@@ -326,13 +289,13 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
large object this is the most expensive call in the file, which is why
|
||||
`json_value` exists and should be preferred when the values are
|
||||
serialisable."""
|
||||
names = self.page.injected.call(
|
||||
names = self.injected.call(
|
||||
self.frame.frame_id,
|
||||
"(injected, o) => o === Object(o) ? Object.keys(o) : []",
|
||||
{"objectId": self.object_id}) or []
|
||||
out = []
|
||||
for name in names:
|
||||
object_id = self.page.injected.call(
|
||||
object_id = self.injected.call(
|
||||
self.frame.frame_id, "(injected, o, n) => o[n]",
|
||||
{"objectId": self.object_id}, name, by_value=False)
|
||||
handle = ElementHandleDispatcher(self.server, self.frame, object_id)
|
||||
@@ -351,9 +314,9 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
just given.
|
||||
"""
|
||||
if getattr(self, "world", "utility") == "main":
|
||||
return {"value": _serialize(self.page.injected.json_value_in(
|
||||
return {"value": _serialize(self.injected.json_value_in(
|
||||
self.frame.frame_id, "main", self.object_id))}
|
||||
return {"value": _serialize(self.page.injected.call(
|
||||
return {"value": _serialize(self.injected.call(
|
||||
self.frame.frame_id, "(injected, o) => o",
|
||||
{"objectId": self.object_id}))}
|
||||
|
||||
@@ -388,39 +351,6 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
return {"frame": frame.channel}
|
||||
|
||||
|
||||
def _serialize(value: Any, counter: Optional[Dict] = None) -> Any:
|
||||
"""A Python value in the shape `parse_result` expects.
|
||||
|
||||
⛔ Playwright does not send bare JSON: it sends a tagged union, and
|
||||
`_connection.parse_value` reads the TAG. A bare `True` where `{"b": true}`
|
||||
is expected does not raise - it falls through to the object branch and comes
|
||||
back as something else entirely.
|
||||
"""
|
||||
if counter is None:
|
||||
counter = {"n": 0}
|
||||
if value is None:
|
||||
return {"v": "null"}
|
||||
if isinstance(value, bool):
|
||||
return {"b": value}
|
||||
if isinstance(value, (int, float)):
|
||||
return {"n": value}
|
||||
if isinstance(value, str):
|
||||
return {"s": value}
|
||||
if isinstance(value, (list, tuple)):
|
||||
# <M> `id` IS MANDATORY on a list and on an object, and its absence is
|
||||
# a KeyError deep inside `parse_value`, not a message. Playwright uses
|
||||
# it to rebuild cyclic references: every container is registered under
|
||||
# its id so a later `{"ref": id}` can point back at it. We never emit a
|
||||
# `ref` - the values crossing here come from JSON and cannot be cyclic
|
||||
# - but the id has to be there anyway, because the reader indexes on it
|
||||
# unconditionally.
|
||||
counter["n"] += 1
|
||||
return {"a": [_serialize(x, counter) for x in value], "id": counter["n"]}
|
||||
if isinstance(value, dict):
|
||||
counter["n"] += 1
|
||||
return {"o": [{"k": k, "v": _serialize(v, counter)}
|
||||
for k, v in value.items()], "id": counter["n"]}
|
||||
return {"s": str(value)}
|
||||
|
||||
|
||||
# ── frame ───────────────────────────────────────────────────────────────────
|
||||
@@ -492,9 +422,30 @@ class FrameDispatcher(Dispatcher):
|
||||
{"url": url, "name": name,
|
||||
"loadStates": load_states or ["commit"]})
|
||||
|
||||
# ── the engines, which belong to the page ───────────────────────────────
|
||||
#
|
||||
# ⛔ PROPERTIES, AND THE POINT IS HOW MANY PLACES KNOW. A frame does its
|
||||
# work through three engines it does not own - the actionability loop, the
|
||||
# injected script and the lifecycle - and each one used to be reached by
|
||||
# climbing: `self.page.actions`, thirty-eight times across this class.
|
||||
# Thirty-eight places knew that the actions engine lives on the page. Now
|
||||
# one does, and thirty-eight read as what they mean.
|
||||
@property
|
||||
def actions(self) -> "Actions":
|
||||
return self.page.actions
|
||||
|
||||
@property
|
||||
def injected(self) -> "InjectedScript":
|
||||
return self.page.injected
|
||||
|
||||
@property
|
||||
def lifecycle(self) -> "Lifecycle":
|
||||
return self.page.lifecycle
|
||||
|
||||
|
||||
# ── navigation ──────────────────────────────────────────────────────────
|
||||
def op_goto(self, params: Dict) -> Any:
|
||||
result = self.page.lifecycle.goto(
|
||||
result = self.lifecycle.goto(
|
||||
params["url"], frame_id=self.frame_id,
|
||||
until=params.get("waitUntil") or "load",
|
||||
timeout=(params.get("timeout") or 30000) / 1000.0)
|
||||
@@ -506,14 +457,14 @@ class FrameDispatcher(Dispatcher):
|
||||
|
||||
# ── reading ─────────────────────────────────────────────────────────────
|
||||
def op_title(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.title(self.frame_id)}
|
||||
return {"value": self.injected.title(self.frame_id)}
|
||||
|
||||
def op_content(self, params: Dict) -> Any:
|
||||
return {"value": self.page.injected.content(self.frame_id)}
|
||||
return {"value": self.injected.content(self.frame_id)}
|
||||
|
||||
def op_query_selector(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
object_id = self.page.injected.query_selector(frame_id, selector)
|
||||
object_id = self.injected.query_selector(frame_id, selector)
|
||||
if not object_id:
|
||||
return {"element": None}
|
||||
handle = ElementHandleDispatcher(
|
||||
@@ -522,37 +473,37 @@ class FrameDispatcher(Dispatcher):
|
||||
|
||||
def _with_element(self, params: Dict, read):
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
object_id = self.page.injected.query_selector(frame_id, selector)
|
||||
object_id = self.injected.query_selector(frame_id, selector)
|
||||
if not object_id:
|
||||
raise ProtocolException("no element matches %r" % selector)
|
||||
try:
|
||||
return {"value": read(object_id)}
|
||||
finally:
|
||||
self.page.injected.dispose(frame_id, object_id)
|
||||
self.injected.dispose(frame_id, object_id)
|
||||
|
||||
def op_text_content(self, params: Dict) -> Any:
|
||||
return self._with_element(params, lambda o: self.page.injected
|
||||
return self._with_element(params, lambda o: self.injected
|
||||
.text_content(self.frame_id, o))
|
||||
|
||||
def op_inner_text(self, params: Dict) -> Any:
|
||||
return self._with_element(params, lambda o: self.page.injected
|
||||
return self._with_element(params, lambda o: self.injected
|
||||
.inner_text(self.frame_id, o))
|
||||
|
||||
def op_inner_html(self, params: Dict) -> Any:
|
||||
return self._with_element(params, lambda o: self.page.injected
|
||||
return self._with_element(params, lambda o: self.injected
|
||||
.inner_html(self.frame_id, o))
|
||||
|
||||
def op_input_value(self, params: Dict) -> Any:
|
||||
return self._with_element(params, lambda o: self.page.injected
|
||||
return self._with_element(params, lambda o: self.injected
|
||||
.input_value(self.frame_id, o))
|
||||
|
||||
def op_get_attribute(self, params: Dict) -> Any:
|
||||
return self._with_element(params, lambda o: self.page.injected
|
||||
return self._with_element(params, lambda o: self.injected
|
||||
.get_attribute(self.frame_id, o,
|
||||
params["name"]))
|
||||
|
||||
def _state(self, params: Dict, state: str) -> Any:
|
||||
return self._with_element(params, lambda o: self.page.injected
|
||||
return self._with_element(params, lambda o: self.injected
|
||||
.element_state(self.frame_id, o, state))
|
||||
|
||||
def op_is_visible(self, params: Dict) -> Any:
|
||||
@@ -590,7 +541,7 @@ class FrameDispatcher(Dispatcher):
|
||||
Everything else in this file stays in utility on purpose. This one
|
||||
method leaves, because the caller asked for it.
|
||||
"""
|
||||
return {"value": _serialize(self.page.injected.evaluate_in_main(
|
||||
return {"value": _serialize(self.injected.evaluate_in_main(
|
||||
self.frame_id, _with_argument(params)))}
|
||||
|
||||
# ── acting ──────────────────────────────────────────────────────────────
|
||||
@@ -692,7 +643,7 @@ class FrameDispatcher(Dispatcher):
|
||||
|
||||
def op_click(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.click(selector, timeout=self._timeout(params),
|
||||
self.actions.click(selector, timeout=self._timeout(params),
|
||||
frame_id=frame_id,
|
||||
position=self._position(params),
|
||||
**self._pointer(params))
|
||||
@@ -703,65 +654,65 @@ class FrameDispatcher(Dispatcher):
|
||||
pointer = self._pointer(params)
|
||||
# dblclick sets its own clickCount; the caller's is not a second one.
|
||||
pointer.pop("clicks", None)
|
||||
self.page.actions.dblclick(selector, timeout=self._timeout(params),
|
||||
self.actions.dblclick(selector, timeout=self._timeout(params),
|
||||
frame_id=frame_id,
|
||||
position=self._position(params), **pointer)
|
||||
return None
|
||||
|
||||
def op_hover(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.hover(selector, timeout=self._timeout(params),
|
||||
self.actions.hover(selector, timeout=self._timeout(params),
|
||||
frame_id=frame_id,
|
||||
position=self._position(params))
|
||||
return None
|
||||
|
||||
def op_fill(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.fill(selector, params["value"],
|
||||
self.actions.fill(selector, params["value"],
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_check(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.check(selector, timeout=self._timeout(params),
|
||||
self.actions.check(selector, timeout=self._timeout(params),
|
||||
frame_id=frame_id,
|
||||
position=self._position(params))
|
||||
return None
|
||||
|
||||
def op_uncheck(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.uncheck(selector, timeout=self._timeout(params),
|
||||
self.actions.uncheck(selector, timeout=self._timeout(params),
|
||||
frame_id=frame_id,
|
||||
position=self._position(params))
|
||||
return None
|
||||
|
||||
def op_focus(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.focus(selector,
|
||||
self.actions.focus(selector,
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_blur(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.blur(selector,
|
||||
self.actions.blur(selector,
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_select_text(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.select_text(selector,
|
||||
self.actions.select_text(selector,
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_press(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.press(selector, params["key"],
|
||||
self.actions.press(selector, params["key"],
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_type(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.type_text(selector, params["text"],
|
||||
self.actions.type_text(selector, params["text"],
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
@@ -770,7 +721,7 @@ class FrameDispatcher(Dispatcher):
|
||||
# `matches = true` and narrows only on valueOrLabel / value / label /
|
||||
# index, so a plain string matches everything and picks the FIRST
|
||||
# option. Measured: ["b"] answered ['a'].
|
||||
chosen = self.page.actions.select_option(
|
||||
chosen = self.actions.select_option(
|
||||
params["selector"], params.get("options") or [],
|
||||
timeout=self._timeout(params))
|
||||
return {"values": chosen or []}
|
||||
@@ -779,13 +730,13 @@ class FrameDispatcher(Dispatcher):
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
paths = [f.get("name") if isinstance(f, dict) else f
|
||||
for f in (params.get("localPaths") or params.get("files") or [])]
|
||||
self.page.actions.set_input_files(selector, paths,
|
||||
self.actions.set_input_files(selector, paths,
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_tap(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.tap(selector, timeout=self._timeout(params),
|
||||
self.actions.tap(selector, timeout=self._timeout(params),
|
||||
frame_id=frame_id,
|
||||
position=self._position(params))
|
||||
return None
|
||||
@@ -799,14 +750,14 @@ class FrameDispatcher(Dispatcher):
|
||||
# and the message names a field the caller never wrote. Nothing to do
|
||||
# with frames: it failed on the main frame too, and only an iframe test
|
||||
# happened to exercise it.
|
||||
self.page.actions.dispatch_event(
|
||||
self.actions.dispatch_event(
|
||||
selector, params["type"],
|
||||
_deserialize(params.get("eventInit")) or {},
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
|
||||
def op_drag_and_drop(self, params: Dict) -> Any:
|
||||
self.page.actions.drag_and_drop(params["source"], params["target"],
|
||||
self.actions.drag_and_drop(params["source"], params["target"],
|
||||
timeout=self._timeout(params))
|
||||
return None
|
||||
|
||||
@@ -818,14 +769,14 @@ class FrameDispatcher(Dispatcher):
|
||||
from there it answers `The operation is insecure` every single time -
|
||||
the same defect the fork already fixed inside the driver.
|
||||
"""
|
||||
self.page.injected.evaluate_in_main(
|
||||
self.injected.evaluate_in_main(
|
||||
self.frame_id,
|
||||
"(() => { document.open(); document.write(%s); document.close(); })()"
|
||||
% _js_string(params["html"]), by_value=True)
|
||||
# ⛔ The load states of the OLD document do not count for the new one,
|
||||
# and `document.open()` starts a new one without a navigation event to
|
||||
# reset them. Waiting here would wait on states that are already set.
|
||||
self.page.lifecycle.wait_for_state(
|
||||
self.lifecycle.wait_for_state(
|
||||
self.frame_id, params.get("waitUntil") or "load",
|
||||
timeout=self._timeout(params))
|
||||
return None
|
||||
@@ -835,14 +786,14 @@ class FrameDispatcher(Dispatcher):
|
||||
return None
|
||||
|
||||
def op_wait_for_load_state(self, params: Dict) -> Any:
|
||||
self.page.lifecycle.wait_for_state(
|
||||
self.lifecycle.wait_for_state(
|
||||
self.frame_id, params.get("state") or "load",
|
||||
timeout=self._timeout(params))
|
||||
return None
|
||||
|
||||
def op_wait_for_selector(self, params: Dict) -> Any:
|
||||
state = params.get("state") or "visible"
|
||||
object_id = self.page.actions.wait_for_selector(
|
||||
object_id = self.actions.wait_for_selector(
|
||||
params["selector"], state=state, timeout=self._timeout(params))
|
||||
if object_id is None:
|
||||
return {"element": None}
|
||||
@@ -875,7 +826,7 @@ class FrameDispatcher(Dispatcher):
|
||||
expression = _as_callable(params["expression"]).replace(
|
||||
"ARG", json.dumps(_deserialize(params.get("arg")), default=str))
|
||||
while True:
|
||||
value = self.page.injected.evaluate_in_main(self.frame_id,
|
||||
value = self.injected.evaluate_in_main(self.frame_id,
|
||||
expression)
|
||||
if value:
|
||||
# ⛔ A HANDLE, NEVER None. `_frame.py` wraps this reply in
|
||||
@@ -883,7 +834,7 @@ class FrameDispatcher(Dispatcher):
|
||||
# it is `AttributeError: 'NoneType' object has no attribute
|
||||
# '_object'` raised inside the client on a call that had just
|
||||
# succeeded. It stayed hidden while the poll timed out first.
|
||||
object_id = self.page.injected.evaluate_in_main(
|
||||
object_id = self.injected.evaluate_in_main(
|
||||
self.frame_id, expression, by_value=False)
|
||||
handle = ElementHandleDispatcher(
|
||||
self.server, self, object_id or "", world="main")
|
||||
@@ -902,7 +853,7 @@ class FrameDispatcher(Dispatcher):
|
||||
selector = params.get("selector")
|
||||
try:
|
||||
if expression.startswith("to.have.count"):
|
||||
count = self.page.injected.count(self.frame_id, selector)
|
||||
count = self.injected.count(self.frame_id, selector)
|
||||
expected = int((params.get("expectedNumber") or 0))
|
||||
return {"matches": count == expected,
|
||||
"received": _serialize(count)}
|
||||
@@ -929,11 +880,11 @@ class FrameDispatcher(Dispatcher):
|
||||
if selector:
|
||||
return self._with_element(
|
||||
params,
|
||||
lambda o: self.page.injected.call(
|
||||
lambda o: self.injected.call(
|
||||
self.frame_id,
|
||||
"(injected, el, o) => injected.ariaSnapshot(el, o)",
|
||||
{"objectId": o}, {"mode": params.get("mode") or "raw"}))
|
||||
return {"snapshot": self.page.injected.call(
|
||||
return {"snapshot": self.injected.call(
|
||||
self.frame_id,
|
||||
"(injected, o) => injected.ariaSnapshot(document.documentElement, o)",
|
||||
{"mode": params.get("mode") or "raw"})}
|
||||
@@ -991,7 +942,7 @@ class FrameDispatcher(Dispatcher):
|
||||
|
||||
def op_wait_for_element_state(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
self.page.actions.wait_for_selector(
|
||||
self.actions.wait_for_selector(
|
||||
selector, state=params["state"],
|
||||
timeout=self._timeout(params), frame_id=frame_id)
|
||||
return None
|
||||
@@ -1012,12 +963,12 @@ class FrameDispatcher(Dispatcher):
|
||||
# ── selectors that answer many ──────────────────────────────────────────
|
||||
def op_query_count(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
return {"value": self.page.injected.count(frame_id, selector)}
|
||||
return {"value": self.injected.count(frame_id, selector)}
|
||||
|
||||
def op_query_selector_all(self, params: Dict) -> Any:
|
||||
frame_id, selector = self.enter_frames(params["selector"])
|
||||
target = self.page.frame_for(frame_id)
|
||||
ids = self.page.injected.query_selector_all(frame_id, selector)
|
||||
ids = self.injected.query_selector_all(frame_id, selector)
|
||||
handles = [ElementHandleDispatcher(self.server, target, oid)
|
||||
for oid in ids]
|
||||
return {"elements": [h.channel for h in handles]}
|
||||
@@ -1025,7 +976,7 @@ class FrameDispatcher(Dispatcher):
|
||||
def op_eval_on_selector(self, params: Dict) -> Any:
|
||||
return self._with_element(
|
||||
params,
|
||||
lambda o: _serialize(self.page.injected.call(
|
||||
lambda o: _serialize(self.injected.call(
|
||||
self.frame_id,
|
||||
"(injected, el) => { const r = (%s);"
|
||||
" return typeof r === 'function' ? r(el) : r; }"
|
||||
@@ -1033,7 +984,7 @@ class FrameDispatcher(Dispatcher):
|
||||
{"objectId": o})))
|
||||
|
||||
def op_eval_on_selector_all(self, params: Dict) -> Any:
|
||||
value = self.page.injected.call(
|
||||
value = self.injected.call(
|
||||
self.frame_id,
|
||||
"(injected, sel) => { const els = injected.querySelectorAll("
|
||||
" injected.parseSelector(sel), document);"
|
||||
@@ -1043,7 +994,7 @@ class FrameDispatcher(Dispatcher):
|
||||
return {"value": _serialize(value)}
|
||||
|
||||
def op_evaluate_handle(self, params: Dict) -> Any:
|
||||
object_id = self.page.injected.evaluate_in_main(
|
||||
object_id = self.injected.evaluate_in_main(
|
||||
self.frame_id, _with_argument(params), by_value=False)
|
||||
handle = ElementHandleDispatcher(self.server, self, object_id)
|
||||
return {"handle": handle.channel}
|
||||
@@ -1090,24 +1041,6 @@ class DialogDispatcher(Dispatcher):
|
||||
return self._answer(False)
|
||||
|
||||
|
||||
# ── network ─────────────────────────────────────────────────────────────────
|
||||
def _headers_array(raw) -> List[Dict[str, str]]:
|
||||
"""Headers as the ARRAY of pairs the client expects, never a dict.
|
||||
|
||||
⛔ `RawHeaders` iterates over `[{"name": ..., "value": ...}]` and a dict
|
||||
iterates over its KEYS, so handing one over does not raise: it produces a
|
||||
header list whose every value is missing, and `response.headers` comes back
|
||||
full of empty strings. Juggler already sends the array form; this exists so
|
||||
a caller-built dict cannot slip through.
|
||||
"""
|
||||
if isinstance(raw, dict):
|
||||
return [{"name": k, "value": str(v)} for k, v in raw.items()]
|
||||
out = []
|
||||
for entry in raw or []:
|
||||
if isinstance(entry, dict) and "name" in entry:
|
||||
out.append({"name": entry["name"],
|
||||
"value": str(entry.get("value", ""))})
|
||||
return out
|
||||
|
||||
|
||||
class RequestDispatcher(Dispatcher):
|
||||
@@ -1260,6 +1193,15 @@ class RouteDispatcher(Dispatcher):
|
||||
self.answered = False
|
||||
super().__init__(server, request.page, {"request": request.channel})
|
||||
|
||||
# ⛔ FIVE LEVELS ON ONE LINE was what this replaced:
|
||||
# `self.request.page.context.browser.conn.send(...)`. A route answering a
|
||||
# request needs the connection; it does not need to know that a request has
|
||||
# a page, a page a context, a context a browser and a browser a `conn`.
|
||||
@property
|
||||
def conn(self) -> "Connection":
|
||||
return self.request.page.conn
|
||||
|
||||
|
||||
def _send(self, command: str, params: Dict) -> Any:
|
||||
if self.answered:
|
||||
raise ProtocolException(
|
||||
@@ -1268,7 +1210,7 @@ class RouteDispatcher(Dispatcher):
|
||||
self.answered = True
|
||||
params = dict(params)
|
||||
params["requestId"] = self.request.request_id
|
||||
result = self.request.page.context.browser.conn.send(
|
||||
result = self.conn.send(
|
||||
command, params, timeout=30)
|
||||
self.dispose()
|
||||
return result
|
||||
@@ -1313,20 +1255,6 @@ class RouteDispatcher(Dispatcher):
|
||||
{"url": params["url"]})
|
||||
|
||||
|
||||
def _resource_type(params: Dict) -> str:
|
||||
"""⛔ Juggler says `cause`, Playwright says `resourceType`, and the two
|
||||
vocabularies only partly overlap. An unmapped cause becomes `other`, which
|
||||
is what upstream does too - guessing a nicer name would make
|
||||
`request.resource_type` disagree with itself between the two transports."""
|
||||
cause = (params.get("cause") or params.get("internalCause") or "").lower()
|
||||
return {
|
||||
"document": "document", "subdocument": "document",
|
||||
"stylesheet": "stylesheet", "script": "script",
|
||||
"image": "image", "imageset": "image",
|
||||
"font": "font", "media": "media",
|
||||
"xmlhttprequest": "xhr", "fetch": "fetch",
|
||||
"websocket": "websocket", "beacon": "other",
|
||||
}.get(cause, "other")
|
||||
|
||||
|
||||
# ── page ────────────────────────────────────────────────────────────────────
|
||||
@@ -1424,6 +1352,28 @@ class PageDispatcher(Dispatcher):
|
||||
# would name a guid the client has not been told about yet.
|
||||
self._install_events()
|
||||
|
||||
@property
|
||||
def browser(self) -> "BrowserDispatcher":
|
||||
return self.context.browser
|
||||
|
||||
# ⛔ Six call sites used to reach `self.actions.keyboard`. The actions
|
||||
# engine owns the keyboard; a page pressing a key does not need to know
|
||||
# that, and now does not say it.
|
||||
@property
|
||||
def keyboard(self):
|
||||
return self.actions.keyboard
|
||||
|
||||
|
||||
# ⛔ THREE LEVELS, WRITTEN OUT EIGHT TIMES: `self.context.browser.conn`.
|
||||
# A page talks to the browser connection constantly, and every one of those
|
||||
# eight lines also asserted that a context has a browser and a browser has
|
||||
# a `conn`. One property, and the shape of the tree stops being everybody's
|
||||
# business.
|
||||
@property
|
||||
def conn(self) -> "Connection":
|
||||
return self.context.browser.conn
|
||||
|
||||
|
||||
|
||||
def _install_events(self) -> None:
|
||||
"""Turn Juggler events into protocol events.
|
||||
@@ -1443,7 +1393,7 @@ class PageDispatcher(Dispatcher):
|
||||
# ⛔ Registered on the connection's list, never chained. The isolation
|
||||
# that used to live in this closure is now `dispatch_event`'s job and
|
||||
# covers every subscriber instead of just this one.
|
||||
self.context.browser.conn.add_listener(self._route_juggler_event)
|
||||
self.conn.add_listener(self._route_juggler_event)
|
||||
|
||||
def _route_juggler_event(self, method: str, params: Dict,
|
||||
session) -> None:
|
||||
@@ -1460,7 +1410,7 @@ class PageDispatcher(Dispatcher):
|
||||
stopped delivering events altogether. Adding a listener without a
|
||||
matching removal is the same defect written in a new shape.
|
||||
"""
|
||||
conn = self.context.browser.conn
|
||||
conn = self.conn
|
||||
conn.remove_listener(self._route_juggler_event)
|
||||
self.lifecycle.detach()
|
||||
self.injected.detach()
|
||||
@@ -1663,7 +1613,7 @@ class PageDispatcher(Dispatcher):
|
||||
self.emit("fileChooser", {"element": handle.channel,
|
||||
"isMultiple": multiple})
|
||||
except Exception as failure:
|
||||
conn = self.context.browser.conn
|
||||
conn = self.conn
|
||||
if len(conn.handler_errors) < 32:
|
||||
conn.handler_errors.append("fileChooser: %s" % failure)
|
||||
|
||||
@@ -1681,7 +1631,7 @@ class PageDispatcher(Dispatcher):
|
||||
existing = self._frames.get(frame_id)
|
||||
if existing is not None:
|
||||
return existing
|
||||
frame = self.lifecycle.frames.get(frame_id)
|
||||
frame = self.lifecycle.frame(frame_id)
|
||||
made = FrameDispatcher(
|
||||
self.server, self, frame_id,
|
||||
url=getattr(frame, "url", "") or "",
|
||||
@@ -1696,7 +1646,7 @@ class PageDispatcher(Dispatcher):
|
||||
command lands on whichever page the browser feels like, and with two
|
||||
pages open the events of one are indistinguishable from the other.
|
||||
"""
|
||||
return self.context.browser.conn.send(command, params,
|
||||
return self.conn.send(command, params,
|
||||
session=self.session, timeout=30)
|
||||
|
||||
# ── history ─────────────────────────────────────────────────────────────
|
||||
@@ -1713,7 +1663,7 @@ class PageDispatcher(Dispatcher):
|
||||
# navigationId, so the only thing to anchor the wait on is that this
|
||||
# one has changed - and reading it after the command would sometimes
|
||||
# read the new one.
|
||||
frame = self.lifecycle.frames.get(frame_id)
|
||||
frame = self.lifecycle.frame(frame_id)
|
||||
previous = frame.navigation if frame is not None else None
|
||||
result = self.send(command, {"frameId": frame_id}
|
||||
if command != "Page.reload" else {}) or {}
|
||||
@@ -1763,23 +1713,23 @@ class PageDispatcher(Dispatcher):
|
||||
return None
|
||||
|
||||
def op_key_down(self, params: Dict) -> Any:
|
||||
self.actions.keyboard.down(params["key"])
|
||||
self.keyboard.down(params["key"])
|
||||
return None
|
||||
|
||||
def op_key_up(self, params: Dict) -> Any:
|
||||
self.actions.keyboard.up(params["key"])
|
||||
self.keyboard.up(params["key"])
|
||||
return None
|
||||
|
||||
def op_key_press(self, params: Dict) -> Any:
|
||||
self.actions.keyboard.press(params["key"])
|
||||
self.keyboard.press(params["key"])
|
||||
return None
|
||||
|
||||
def op_key_type(self, params: Dict) -> Any:
|
||||
self.actions.keyboard.type(params["text"])
|
||||
self.keyboard.type(params["text"])
|
||||
return None
|
||||
|
||||
def op_key_insert(self, params: Dict) -> Any:
|
||||
self.actions.keyboard.insert_text(params["text"])
|
||||
self.keyboard.insert_text(params["text"])
|
||||
return None
|
||||
|
||||
# ── viewport, media, capture ────────────────────────────────────────────
|
||||
@@ -1842,7 +1792,7 @@ class PageDispatcher(Dispatcher):
|
||||
once used as a "bare command" to measure transport latency and reported
|
||||
26,8 ms of browser work as if it were ours. It is the right command
|
||||
here, and the wrong one to benchmark with."""
|
||||
self.context.browser.conn.send("Heap.collectGarbage", {}, timeout=30)
|
||||
self.conn.send("Heap.collectGarbage", {}, timeout=30)
|
||||
return None
|
||||
|
||||
def _add_tag(self, params: Dict, tag: str) -> Any:
|
||||
@@ -2007,7 +1957,7 @@ class PageDispatcher(Dispatcher):
|
||||
nothing in the log saying why.
|
||||
"""
|
||||
if params.get("event") == "fileChooser":
|
||||
self.context.browser.conn.send(
|
||||
self.conn.send(
|
||||
"Page.setInterceptFileChooserDialog",
|
||||
{"enabled": bool(params.get("enabled"))},
|
||||
session=self.session, timeout=10)
|
||||
@@ -2028,7 +1978,7 @@ class PageDispatcher(Dispatcher):
|
||||
Touch is turned on at context creation with `hasTouch`."""
|
||||
self.send("Page.dispatchTapEvent",
|
||||
{"x": params["x"], "y": params["y"],
|
||||
"modifiers": self.actions.keyboard.modifier_mask()})
|
||||
"modifiers": self.keyboard.modifier_mask()})
|
||||
return None
|
||||
|
||||
def op_requests(self, params: Dict) -> Any:
|
||||
@@ -2087,7 +2037,7 @@ class PageDispatcher(Dispatcher):
|
||||
because the tests open one page per context.
|
||||
"""
|
||||
try:
|
||||
self.context.browser.conn.send(
|
||||
self.conn.send(
|
||||
"Page.close", {"runBeforeUnload": False},
|
||||
session=self.session, timeout=10)
|
||||
except Exception:
|
||||
@@ -2096,7 +2046,7 @@ class PageDispatcher(Dispatcher):
|
||||
# browser accumulates one entry per page it ever opened. Small, but it
|
||||
# is the kind of small that a scraper turns into a day-long leak.
|
||||
try:
|
||||
self.context.browser.forget(self.session)
|
||||
self.browser.forget(self.session)
|
||||
except Exception:
|
||||
pass
|
||||
self.announce_closed()
|
||||
@@ -2143,8 +2093,6 @@ class PageDispatcher(Dispatcher):
|
||||
self.dispose()
|
||||
|
||||
|
||||
def _button(name: Optional[str]) -> int:
|
||||
return {"left": 0, "middle": 1, "right": 2}.get(name or "left", 0)
|
||||
|
||||
|
||||
# ── context, browser, browser type ──────────────────────────────────────────
|
||||
@@ -2202,6 +2150,11 @@ class BrowserContextDispatcher(Dispatcher):
|
||||
#: command replaces the list, so the accumulation lives here.
|
||||
self._init_scripts: List[str] = []
|
||||
|
||||
@property
|
||||
def conn(self) -> "Connection":
|
||||
return self.browser.conn
|
||||
|
||||
|
||||
def op_context_init_script(self, params: Dict) -> Any:
|
||||
"""The same, for every page of this context - present and future.
|
||||
|
||||
@@ -2291,7 +2244,7 @@ class BrowserContextDispatcher(Dispatcher):
|
||||
return None
|
||||
|
||||
def op_new_page(self, params: Dict) -> Any:
|
||||
conn = self.browser.conn
|
||||
conn = self.conn
|
||||
result = conn.send("Browser.newPage",
|
||||
{"browserContextId": self.context_id}, timeout=30)
|
||||
target_id = result["targetId"]
|
||||
@@ -2305,7 +2258,7 @@ class BrowserContextDispatcher(Dispatcher):
|
||||
def _browser_send(self, command: str, params: Dict) -> Any:
|
||||
params = dict(params)
|
||||
params["browserContextId"] = self.context_id
|
||||
return self.browser.conn.send(command, params, timeout=30)
|
||||
return self.conn.send(command, params, timeout=30)
|
||||
|
||||
def op_add_cookies(self, params: Dict) -> Any:
|
||||
"""⛔ `expires` IS SECONDS AND -1 MEANS SESSION, not zero and not
|
||||
@@ -2379,7 +2332,7 @@ class BrowserContextDispatcher(Dispatcher):
|
||||
|
||||
def op_close(self, params: Dict) -> Any:
|
||||
try:
|
||||
self.browser.conn.send("Browser.removeBrowserContext",
|
||||
self.conn.send("Browser.removeBrowserContext",
|
||||
{"browserContextId": self.context_id},
|
||||
timeout=10)
|
||||
except Exception:
|
||||
@@ -2786,96 +2739,10 @@ class BrowserTypeDispatcher(Dispatcher):
|
||||
return {"browser": browser.channel}
|
||||
|
||||
|
||||
def _remove_profile(directory: str) -> None:
|
||||
"""Take away a profile WE created. Never one the caller named.
|
||||
|
||||
⛔ IT MUST NOT RAISE. This runs while the session is already going away,
|
||||
and on Windows a file can still be held for a moment after the process that
|
||||
owned it exits. A profile left behind is a few dozen megabytes; an
|
||||
exception here would be a shutdown that fails for a reason nobody cares
|
||||
about, on a path the caller has already stopped watching.
|
||||
"""
|
||||
import shutil
|
||||
shutil.rmtree(directory, ignore_errors=True)
|
||||
|
||||
|
||||
def _write_user_js(profile_dir: str, prefs: Dict) -> int:
|
||||
"""The prefs, into the profile, BEFORE the browser starts.
|
||||
|
||||
⛔ WITHOUT THIS THE PYTHON PATH LAUNCHES A BROWSER THAT IS NOT THE PRODUCT,
|
||||
and it does so silently. Two hundred prefs arrive in `firefoxUserPrefs` on
|
||||
every `launch`, and the first draft of this server threw them away and
|
||||
started Firefox on an empty temporary profile. Everything worked - pages
|
||||
loaded, clicks landed, the tests were green - and every stealth declaration
|
||||
the package exists to make was simply absent.
|
||||
|
||||
It was caught by a closed shadow root, of all things: the engine patch that
|
||||
lets a locator reach inside one is gated on `StealthEngineActive()`, which
|
||||
is a pref. The same probe found the root through `_juggler` directly and
|
||||
lost it through the public API, and the only difference between those two
|
||||
arms was who wrote the profile. A gate for a completely different feature
|
||||
is what made the absence visible; nothing was checking for it directly.
|
||||
|
||||
⛔ AND THEY ARE WRITTEN, NOT SENT. Our fork already removed prefs from the
|
||||
protocol - `Browser.enable` does not accept them any more - because a
|
||||
browser configured on the second launch is a browser that was wrong on the
|
||||
first. This mirrors what the driver's `defaultArgs` does, in Python.
|
||||
|
||||
⛔ Gecko HAS NO FLOAT PREF TYPE: a fraction must be written as a STRING, or
|
||||
the parser fails on that line and IGNORES EVERY LINE AFTER IT. That is not
|
||||
a hypothetical - `ui.textScaleFactor` written as a number once killed the
|
||||
browser on the second context, and the failure looked nothing like a prefs
|
||||
problem.
|
||||
"""
|
||||
import os
|
||||
lines = []
|
||||
# ⛔ INSERTION ORDER, NOT SORTED. The driver uses `Object.keys()`, and the
|
||||
# two writers have to agree BYTE FOR BYTE - sorting produces a file that is
|
||||
# equally correct and not identical. Caught by
|
||||
# `tests/gates/prefs_byte_parity.py` on its very first real run, which is
|
||||
# the whole argument for keeping a judge around.
|
||||
for name in prefs:
|
||||
value = prefs[name]
|
||||
if isinstance(value, bool):
|
||||
rendered = "true" if value else "false"
|
||||
elif isinstance(value, int):
|
||||
rendered = str(value)
|
||||
elif isinstance(value, float):
|
||||
# ⛔ A string, deliberately. See the docstring.
|
||||
rendered = json.dumps(str(value))
|
||||
else:
|
||||
rendered = json.dumps(str(value))
|
||||
lines.append('user_pref(%s, %s);' % (json.dumps(name), rendered))
|
||||
os.makedirs(profile_dir, exist_ok=True)
|
||||
# ⛔ NO HEADER COMMENT, and no sorting either. The driver writes neither,
|
||||
# and this file has to match the driver's BYTE FOR BYTE - that is the
|
||||
# criterion item 1 was written with. A header is one line of difference in
|
||||
# a comparison whose whole value is that it finds differences.
|
||||
body = "\n".join(lines) + "\n"
|
||||
# ⛔ `write_bytes`: on Windows a text-mode write translates every newline,
|
||||
# and a prefs file is read by the browser, not by git.
|
||||
with open(os.path.join(profile_dir, "user.js"), "wb") as handle:
|
||||
handle.write(body.encode("utf-8"))
|
||||
return len(lines)
|
||||
|
||||
|
||||
def _read_version(executable: str) -> str:
|
||||
"""The base version, from `application.ini` next to the binary.
|
||||
|
||||
⛔ Read, never assumed: this project has three separate incidents where a
|
||||
folder name or a guess about the version sent a whole evening of
|
||||
measurements against the wrong build.
|
||||
"""
|
||||
import pathlib
|
||||
ini = pathlib.Path(executable).parent / "application.ini"
|
||||
try:
|
||||
for line in ini.read_text(encoding="utf-8",
|
||||
errors="replace").splitlines():
|
||||
if line.startswith("Version="):
|
||||
return line.split("=", 1)[1].strip()
|
||||
except OSError:
|
||||
pass
|
||||
return "0.0"
|
||||
|
||||
|
||||
# ── the root ────────────────────────────────────────────────────────────────
|
||||
@@ -2935,64 +2802,11 @@ class JugglerServer(Server):
|
||||
return {"playwright": playwright.channel}
|
||||
|
||||
|
||||
def _console_text(args: list) -> str:
|
||||
"""⛔ The console arguments arrive as remote objects, not as text. Reading
|
||||
`value` works for a primitive and gives nothing for an object, so the
|
||||
preview is used when there is one - which is what the driver shows too."""
|
||||
pieces = []
|
||||
for a in args:
|
||||
if not isinstance(a, dict):
|
||||
pieces.append(str(a))
|
||||
elif "value" in a:
|
||||
pieces.append(str(a["value"]))
|
||||
elif a.get("preview"):
|
||||
pieces.append(str(a["preview"]))
|
||||
elif a.get("unserializableValue"):
|
||||
pieces.append(str(a["unserializableValue"]))
|
||||
else:
|
||||
pieces.append(str(a.get("type") or "object"))
|
||||
return " ".join(pieces)
|
||||
|
||||
|
||||
def _location(raw) -> Dict:
|
||||
"""⛔ ALWAYS a location, never None: `_browser_context.py` casts it and
|
||||
falls back only on a missing KEY, so a null here becomes an AttributeError
|
||||
somewhere else entirely."""
|
||||
raw = raw or {}
|
||||
return {"url": raw.get("url") or "",
|
||||
"lineNumber": raw.get("lineNumber") or raw.get("line") or 0,
|
||||
"columnNumber": raw.get("columnNumber") or raw.get("column") or 0}
|
||||
|
||||
|
||||
def _only_set(params: Dict) -> Dict:
|
||||
"""The parameters that were actually given, with the absent ones REMOVED.
|
||||
|
||||
⛔ IN A CLOSED-WORLD SCHEMA, `null` AND ABSENT ARE DIFFERENT ANSWERS.
|
||||
Juggler validates every field it is handed: an Optional that arrives as
|
||||
`null` is not "not provided", it is a value of the wrong type, and the
|
||||
command is REJECTED at runtime with `Object "<root>.clip" is undefined,
|
||||
but has some scheme`. Measured on 2026-08-28 on `Page.screenshot`, whose
|
||||
clip and quality are both optional and were both being sent as null.
|
||||
|
||||
⛔ AND THIS IS NOT DONE INSIDE `Connection.send`, tempting as that is:
|
||||
some commands mean something BY sending null. `Browser.setGeolocationOverride`
|
||||
with `geolocation: null` CLEARS the override, and stripping it there would
|
||||
turn "stop pretending to be somewhere" into "do nothing".
|
||||
"""
|
||||
return {k: v for k, v in params.items() if v is not None}
|
||||
|
||||
|
||||
def _host_of(url: str) -> str:
|
||||
"""The host of a url, without importing a parser for three characters."""
|
||||
without_scheme = url.split("://", 1)[-1]
|
||||
return without_scheme.split("/", 1)[0].split(":", 1)[0].lower()
|
||||
|
||||
|
||||
def _domain_matches(cookie_domain: str, host: str) -> bool:
|
||||
"""⛔ A LEADING DOT MEANS "AND EVERY SUBDOMAIN", and dropping it turns a
|
||||
site-wide cookie into one that matches nothing. Comparing the two strings
|
||||
directly is the version that looks right and returns an empty list."""
|
||||
domain = (cookie_domain or "").lstrip(".").lower()
|
||||
if not domain or not host:
|
||||
return False
|
||||
return host == domain or host.endswith("." + domain)
|
||||
@@ -44,6 +44,7 @@ names the guid it creates, and that is the dispatcher's job, not the pool's.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import queue
|
||||
import threading
|
||||
import traceback
|
||||
@@ -167,3 +168,45 @@ class InProcessTransport(Transport):
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
# ── choosing one ────────────────────────────────────────────────────────────
|
||||
#
|
||||
# ⛔ THIS WAS A MODULE OF ITS OWN UNTIL 2026-08-29, and what it chose between
|
||||
# no longer exists. `factory.py` held 88 lines to pick between the Node driver
|
||||
# and this transport; the driver went on 2026-08-28, so a module whose whole
|
||||
# job was to call another module was left choosing between one thing and an
|
||||
# error message.
|
||||
#
|
||||
# ⛔ AND ITS TYPO GUARD WENT WITH IT, on purpose. It refused an unknown value
|
||||
# on the argument that "a typo would run the driver while you believed you
|
||||
# were testing the Python path". That was true and is not: there is no driver
|
||||
# to run by accident, so the check protected nothing and cost a concept.
|
||||
#
|
||||
# What was KEPT is the message below. Version 0.7.4 shipped with the driver as
|
||||
# the default, so somebody can have `INVPW_TRANSPORT=driver` still set in a
|
||||
# shell, and "unknown transport" would tell them nothing about what happened.
|
||||
|
||||
CHOICE_ENV = "INVPW_TRANSPORT"
|
||||
DRIVER = "driver"
|
||||
JUGGLER = "juggler"
|
||||
|
||||
|
||||
def chosen() -> str:
|
||||
"""Which transport this process asked for. Anything but `driver` is us."""
|
||||
return (os.environ.get(CHOICE_ENV) or JUGGLER).strip().lower()
|
||||
|
||||
|
||||
def make_transport(loop: asyncio.AbstractEventLoop) -> "InProcessTransport":
|
||||
"""The transport a `Connection` should speak through."""
|
||||
if chosen() == DRIVER:
|
||||
raise RuntimeError(
|
||||
"the Node driver was removed on 2026-08-28: this package no "
|
||||
"longer ships `_driver/` and no longer downloads node. What "
|
||||
"replaced it is the in-process Python server, which is now the "
|
||||
"only transport - unset %s and it runs. To get the old arm back "
|
||||
"for a COMPARISON (the only thing it was still for): check out "
|
||||
"the last commit that carried it into a git worktree and point "
|
||||
"INVPW_DRIVER_TREE at it. Both `judge_both_transports.py` and "
|
||||
"`diff_protocol.py` read that variable." % CHOICE_ENV)
|
||||
from .server import JugglerServer
|
||||
return InProcessTransport(loop, JugglerServer())
|
||||
@@ -17,7 +17,7 @@ from typing import Any
|
||||
|
||||
from invisible_playwright._pw._impl._connection import Connection
|
||||
from invisible_playwright._pw._impl._object_factory import create_remote_object
|
||||
from invisible_playwright._juggler.factory import make_transport
|
||||
from invisible_playwright._juggler.transport import make_transport
|
||||
from invisible_playwright._pw.async_api._generated import Playwright as AsyncPlaywright
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class PlaywrightContextManager:
|
||||
# `_juggler` is being built, because it is the JUDGE of that
|
||||
# server: both answer the same protocol, so the only honest
|
||||
# check is the same session through both. See
|
||||
# `_juggler/factory.py` for the switch and why the default is
|
||||
# `_juggler/transport.py` for the switch and why the default is
|
||||
# still the driver.
|
||||
make_transport(loop),
|
||||
loop,
|
||||
|
||||
@@ -22,7 +22,7 @@ from invisible_playwright._pw._impl._errors import Error
|
||||
from invisible_playwright._pw._impl._greenlets import MainGreenlet
|
||||
from invisible_playwright._pw._impl._object_factory import create_remote_object
|
||||
from invisible_playwright._pw._impl._playwright import Playwright
|
||||
from invisible_playwright._juggler.factory import make_transport
|
||||
from invisible_playwright._juggler.transport import make_transport
|
||||
from invisible_playwright._pw.sync_api._generated import Playwright as SyncPlaywright
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -65,7 +65,7 @@ Please use the Async API instead."""
|
||||
# `_juggler` is being built, because it is the JUDGE of that
|
||||
# server: both answer the same protocol, so the only honest
|
||||
# check is the same session through both. See
|
||||
# `_juggler/factory.py` for the switch and why the default is
|
||||
# `_juggler/transport.py` for the switch and why the default is
|
||||
# still the driver.
|
||||
make_transport(self._loop),
|
||||
self._loop,
|
||||
|
||||
@@ -22,9 +22,13 @@ from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ._cursor import (ENGINE_PYTHON,
|
||||
enable_for as _enable_cursor_engine,
|
||||
max_seconds_for as _cursor_max_seconds)
|
||||
from ._engine import resolve_executable
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from invisible_core import compose_session_prefs
|
||||
from invisible_core import compose_session_prefs, make_virtual_display
|
||||
from invisible_core.launch import (FontManifestMismatch,
|
||||
cached_font_manifest_path,
|
||||
verify_font_manifest)
|
||||
@@ -349,3 +353,158 @@ def egress_ancora_valido(proxy: Optional[Dict[str, str]],
|
||||
except Exception:
|
||||
return USCITA_NON_MISURABILE, None
|
||||
return (USCITA_REGGE if attuale == atteso else USCITA_DERIVATA), attuale
|
||||
|
||||
|
||||
class CommonLaunch:
|
||||
"""The six methods both entry points had, written once.
|
||||
|
||||
⛔ THE DUPLICATION THIS CLOSES IS THE ONE THIS FILE WAS CREATED FOR, and it
|
||||
survived the file's own creation. `_session` was written on 2026-07-27 to
|
||||
hold what the sync and async classes share, and it did extract the
|
||||
functions - `build_env`, `build_prefs`, `true_headless_requested`. What it
|
||||
left behind were the METHODS that call them: six of them, in both classes,
|
||||
with bodies that are identical byte for byte once the docstrings are
|
||||
removed. 222 lines saying the same thing twice.
|
||||
|
||||
The measurement that says it is the same thing: the two classes use the
|
||||
SAME FOURTEEN attributes of `self` across those six methods, and the ASTs
|
||||
of the bodies compare equal. What made them look different - similarity
|
||||
ratios between 32% and 69% - was entirely comments worded differently.
|
||||
|
||||
⛔ AND THE COST OF THE SPLIT IS NOT HYPOTHETICAL. The three defects listed
|
||||
at the top of this file all have the same shape, and one of them is in the
|
||||
code that moved here: `INVPW_TRUE_HEADLESS` was honoured by the async class
|
||||
alone, so a documented environment variable worked or not depending on
|
||||
which entry point the caller had picked.
|
||||
|
||||
⛔ WHAT THIS CLASS EXPECTS, said out loud because a mixin's contract is
|
||||
otherwise invisible: both subclasses set `seed`, `_binary_path`,
|
||||
`_cursor_engine`, `_extra_prefs`, `_headless`, `_humanize`,
|
||||
`_lifetime_guard`, `_locale`, `_profile`, `_session_token`, `_show_cursor`,
|
||||
`_srflx_dichiarato`, `_timezone` and `_virtual_display` in their own
|
||||
`__init__`. They already did, identically, which is why this works at all.
|
||||
"""
|
||||
|
||||
def _resolve_headless(self) -> bool:
|
||||
"""Translate the user's ``headless`` flag.
|
||||
|
||||
When ``True``, Firefox stays in headed mode (real rendering pipeline →
|
||||
coherent fingerprint) and the window is hidden: on Linux via a fresh
|
||||
Xvfb spawned here; on Windows/macOS via the binary's own window cloak
|
||||
(the ``zoom.stealth.cloak_windows`` pref added in ``_build_prefs``), so
|
||||
``make_virtual_display()`` returns ``None`` and nothing is spawned.
|
||||
"""
|
||||
if not self._headless:
|
||||
return False
|
||||
# Opt-in TRUE headless, shared with the async class. It existed on the
|
||||
# async API ONLY until 2026-07-27: a documented env var that worked
|
||||
# depending on which entry point the caller happened to pick, which is
|
||||
# the same drift that shipped the process-leak fix to half the users.
|
||||
if true_headless_requested():
|
||||
return True
|
||||
vd = make_virtual_display()
|
||||
if vd is not None:
|
||||
vd.start()
|
||||
self._virtual_display = vd
|
||||
return False
|
||||
|
||||
def _default_context_kwargs(self) -> Dict[str, Any]:
|
||||
p = self._profile
|
||||
kwargs: Dict[str, Any] = {
|
||||
"viewport": {"width": p.screen.width - p.screen.chrome_w,
|
||||
"height": (p.screen.height
|
||||
- p.screen.taskbar_px
|
||||
- p.screen.chrome_h)},
|
||||
"screen": {"width": p.screen.width, "height": p.screen.height},
|
||||
# ⛔ device_scale_factor and color_scheme are NO LONGER passed.
|
||||
# They were a second source for two facts invisible_core already
|
||||
# declares (layout.css.devPixelsPerPx and, since 2026-08-24,
|
||||
# layout.css.prefers-color-scheme.content-override), and this one
|
||||
# won: measured, setting the pref to a different value the
|
||||
# browser did not move. Now there is only one path.
|
||||
}
|
||||
# Pass timezone via Playwright's per-realm override (docShell.overrideTimezone
|
||||
# → JS::SetRealmTimezoneOverride). The juggler.timezone.override pref path
|
||||
# uses JS::SetTimeZoneOverride globally, which is broken on Windows ICU for
|
||||
# no-DST IANA names (America/Phoenix, Pacific/Honolulu, ...) - those silently
|
||||
# fall back to the host system TZ. The per-realm path works for every zone.
|
||||
if self._timezone:
|
||||
kwargs["timezone_id"] = self._timezone
|
||||
if self._locale:
|
||||
kwargs["locale"] = self._locale
|
||||
return kwargs
|
||||
|
||||
def _build_env(self, prefs: Dict[str, Any]) -> Dict[str, str]:
|
||||
"""Env for the Firefox subprocess, then stamped with this session's token.
|
||||
|
||||
The body is `build_env`, shared with the async class - it was
|
||||
written twice, identically, and the WebRTC pair is a contract with the
|
||||
binary, so two landing sites meant two chances to miss a change.
|
||||
|
||||
The token stamp stays here because it is the only genuinely per-session
|
||||
part: children inherit the environment, so every process in the tree
|
||||
carries it and teardown can find its own tree and only its own.
|
||||
"""
|
||||
return self._session_token.stamp(
|
||||
build_env(timezone=self._timezone,
|
||||
srflx_dichiarato=self._srflx_dichiarato,
|
||||
profile=self._profile,
|
||||
executable=resolve_executable(self._binary_path)))
|
||||
|
||||
def _build_prefs(self) -> Dict[str, Any]:
|
||||
"""Fingerprint prefs plus humanize toggle (always set explicitly).
|
||||
|
||||
The body lives in `build_prefs`, which the async class calls
|
||||
too. It used to be twenty lines here and the SAME twenty inlined into
|
||||
`async_api.__aenter__` - identical calls in identical order, differing
|
||||
only in their comments, which is how the two entry points drift.
|
||||
"""
|
||||
return build_prefs(
|
||||
profile=self._profile,
|
||||
locale=self._locale,
|
||||
timezone=self._timezone,
|
||||
extra_prefs=self._extra_prefs,
|
||||
headless=self._headless,
|
||||
virtual_display=self._virtual_display is not None,
|
||||
cursor_engine=self._cursor_engine,
|
||||
humanize=self._humanize,
|
||||
show_cursor=self._show_cursor,
|
||||
)
|
||||
|
||||
def _arm_cursor_engine(self, owner: Any) -> None:
|
||||
"""Register this session so its pages move through the Python generator.
|
||||
|
||||
Registered on the browser (or on the persistent context, which is all
|
||||
there is in that mode) rather than on each page: pages appear by
|
||||
several routes we do not control - ``browser.new_page()`` builds its
|
||||
context inside the driver, and a site can open a popup on its own - and
|
||||
every one of them can find its way back to this owner. The seed is the
|
||||
session seed, so a replayed seed replays the cursor exactly as it
|
||||
replays the fingerprint.
|
||||
"""
|
||||
if self._cursor_engine != ENGINE_PYTHON:
|
||||
return
|
||||
_enable_cursor_engine(
|
||||
owner, seed=self.seed, max_seconds=_cursor_max_seconds(self._humanize)
|
||||
)
|
||||
|
||||
def _bind_process_tree(self) -> None:
|
||||
"""Tie the browser tree to this process's lifetime, at the OS level.
|
||||
|
||||
MEASURED before being written, because the first attempt at this fixed
|
||||
a path that was not broken: an exception out of the `with` block does
|
||||
NOT leak - __exit__ runs and Playwright cleans up, zero survivors over
|
||||
an interleaved A/B. The leak is the killed-runner path, where __exit__
|
||||
never executes at all: launch, kill the runner, and eight processes
|
||||
were still alive; twelve on the second attempt. Nothing written inside
|
||||
_teardown can reach that, so the guarantee comes from a Windows job
|
||||
object that the kernel empties when this process's handle closes,
|
||||
however this process ends.
|
||||
|
||||
Best-effort by construction: a failure here leaves the pre-existing
|
||||
behaviour rather than breaking a launch that is otherwise fine.
|
||||
"""
|
||||
try:
|
||||
self._lifetime_guard.bind(self._session_token)
|
||||
except Exception:
|
||||
pass
|
||||
@@ -10,23 +10,16 @@ from typing import Any, Dict, Optional, Union
|
||||
from invisible_playwright._pw.async_api import Browser, BrowserContext, Playwright, async_playwright
|
||||
|
||||
from . import _session
|
||||
from ._cursor import (
|
||||
ENGINE_PYTHON,
|
||||
enable_for as _enable_cursor_engine,
|
||||
max_seconds_for as _cursor_max_seconds,
|
||||
resolve_cursor_engine,
|
||||
)
|
||||
from ._cursor import resolve_cursor_engine
|
||||
from invisible_core._fpforge import Profile, generate_profile
|
||||
from invisible_core import forced_gpu_class
|
||||
from invisible_core import prepare_session_geo
|
||||
from invisible_core import make_virtual_display
|
||||
from ._engine import assert_wire_version, resolve_executable
|
||||
from invisible_core import configure_proxy as _configure_proxy_shared
|
||||
from ._reaper import SessionToken, guard_for
|
||||
from .launcher import _CHROME_H, _CHROME_W, _TASKBAR_H
|
||||
|
||||
|
||||
class InvisiblePlaywright:
|
||||
class InvisiblePlaywright(_session.CommonLaunch):
|
||||
"""Async context manager - see invisible_playwright.InvisiblePlaywright for the sync variant."""
|
||||
|
||||
def __init__(
|
||||
@@ -184,35 +177,7 @@ class InvisiblePlaywright:
|
||||
self._arm_cursor_engine(self._browser)
|
||||
return self._browser
|
||||
|
||||
def _bind_process_tree(self) -> None:
|
||||
"""Tie the browser tree to this process's lifetime, at the OS level.
|
||||
|
||||
The same call the sync launcher makes. Its absence here is why the
|
||||
Windows leak survived 0.4.0 on this API: an exception out of the async
|
||||
block runs __aexit__ and Playwright cleans up, but a KILLED runner never
|
||||
reaches either, and only the kernel can act then.
|
||||
|
||||
Best-effort: a failure leaves the pre-existing behaviour rather than
|
||||
breaking a launch that is otherwise fine.
|
||||
"""
|
||||
try:
|
||||
self._lifetime_guard.bind(self._session_token)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def _arm_cursor_engine(self, owner: Any) -> None:
|
||||
"""Register this session so its pages move through the Python generator.
|
||||
|
||||
Same wiring as the sync launcher, and the same single hook point: the
|
||||
wrappers live on the shared implementation objects, so arming a session
|
||||
here covers ``await page.click(...)``, ``await locator.hover(...)`` and
|
||||
``await page.mouse.move(...)`` without a second implementation.
|
||||
"""
|
||||
if self._cursor_engine != ENGINE_PYTHON:
|
||||
return
|
||||
_enable_cursor_engine(
|
||||
owner, seed=self.seed, max_seconds=_cursor_max_seconds(self._humanize)
|
||||
)
|
||||
|
||||
#: Twin of `launcher._INTERVALLO_CONTROLLO_USCITA_S`. The two classes
|
||||
#: must stay equal: that is the defect `_session.py` exists to stop
|
||||
@@ -326,31 +291,6 @@ class InvisiblePlaywright:
|
||||
|
||||
browser.new_page = patched_page # type: ignore[assignment]
|
||||
|
||||
def _default_context_kwargs(self) -> Dict[str, Any]:
|
||||
p = self._profile
|
||||
kwargs: Dict[str, Any] = {
|
||||
"viewport": {"width": p.screen.width - p.screen.chrome_w,
|
||||
"height": (p.screen.height
|
||||
- p.screen.taskbar_px
|
||||
- p.screen.chrome_h)},
|
||||
"screen": {"width": p.screen.width, "height": p.screen.height},
|
||||
# ⛔ device_scale_factor and color_scheme are NO LONGER passed.
|
||||
# They were a second source for two facts invisible_core already
|
||||
# declares (layout.css.devPixelsPerPx and
|
||||
# layout.css.prefers-color-scheme.content-override), and this one
|
||||
# won: measured, setting the pref to a different value did not
|
||||
# move the browser. Kept identical to the sync branch, which
|
||||
# test_async_default_context_kwargs_match_sync demands - and it is
|
||||
# the test that caught this line having fallen behind.
|
||||
}
|
||||
# Pass timezone via Playwright per-realm override (works for every
|
||||
# IANA name, including no-DST zones that Windows ICU silently drops
|
||||
# on the global pref path).
|
||||
if self._timezone:
|
||||
kwargs["timezone_id"] = self._timezone
|
||||
if self._locale:
|
||||
kwargs["locale"] = self._locale
|
||||
return kwargs
|
||||
|
||||
async def __aexit__(self, *exc: Any) -> None:
|
||||
await self._teardown()
|
||||
@@ -391,59 +331,8 @@ class InvisiblePlaywright:
|
||||
pass
|
||||
self._session_token = SessionToken()
|
||||
|
||||
def _build_env(self, prefs: Dict[str, Any]) -> Dict[str, str]:
|
||||
"""Same body as the sync class - it always was, character for character.
|
||||
|
||||
The token stamp stays here: it is the one per-session part, and losing
|
||||
it is what made the reaper unable to find this API's browser tree.
|
||||
"""
|
||||
return self._session_token.stamp(
|
||||
_session.build_env(timezone=self._timezone,
|
||||
srflx_dichiarato=self._srflx_dichiarato,
|
||||
profile=self._profile,
|
||||
executable=resolve_executable(self._binary_path)))
|
||||
|
||||
def _build_prefs(self) -> Dict[str, Any]:
|
||||
"""Same body as the sync class, because it is the same body.
|
||||
|
||||
These were twenty identical lines here and twenty in
|
||||
`launcher._build_prefs` - same calls, same order, differing only in
|
||||
their comments. Both delegate to `_session.build_prefs` now.
|
||||
"""
|
||||
return _session.build_prefs(
|
||||
profile=self._profile,
|
||||
locale=self._locale,
|
||||
timezone=self._timezone,
|
||||
extra_prefs=self._extra_prefs,
|
||||
headless=self._headless,
|
||||
virtual_display=self._virtual_display is not None,
|
||||
cursor_engine=self._cursor_engine,
|
||||
humanize=self._humanize,
|
||||
show_cursor=self._show_cursor,
|
||||
)
|
||||
|
||||
def _resolve_headless(self) -> bool:
|
||||
if not self._headless:
|
||||
return False
|
||||
# Opt-in TRUE headless. The default headful+cloak path intermittently
|
||||
# hangs launch_persistent_context ~40% on Windows (window/compositor
|
||||
# race with a persistent profile). True headless applies the IDENTICAL
|
||||
# fingerprint prefs (screen/viewport/canvas/webgl spoofed the same) and
|
||||
# is reliable (~2.3s). Read through `_session` so the sync class gets
|
||||
# it too: until 2026-07-27 this env var was honoured HERE ONLY, so a
|
||||
# documented knob worked or not depending on which entry point the
|
||||
# caller had picked.
|
||||
if _session.true_headless_requested():
|
||||
return True
|
||||
vd = make_virtual_display()
|
||||
# Linux: Xvfb to start. Windows/macOS: make_virtual_display() returns
|
||||
# None (the binary self-cloaks via cloak_prefs injected in __aenter__),
|
||||
# so there is nothing to start - guarding the None was the missing piece
|
||||
# that made async headless=True crash with AttributeError on Windows.
|
||||
if vd is not None:
|
||||
vd.start()
|
||||
self._virtual_display = vd
|
||||
return False
|
||||
|
||||
|
||||
__all__ = ["InvisiblePlaywright"]
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Sync Playwright launcher for invisible_playwright."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import secrets
|
||||
import time
|
||||
from pathlib import Path
|
||||
@@ -10,16 +9,10 @@ from typing import Any, Dict, Optional, Union
|
||||
from invisible_playwright._pw.sync_api import Browser, BrowserContext, Playwright, sync_playwright
|
||||
|
||||
from . import _session
|
||||
from ._cursor import (
|
||||
ENGINE_PYTHON,
|
||||
enable_for as _enable_cursor_engine,
|
||||
max_seconds_for as _cursor_max_seconds,
|
||||
resolve_cursor_engine,
|
||||
)
|
||||
from ._cursor import resolve_cursor_engine
|
||||
from invisible_core._fpforge import Profile, generate_profile
|
||||
from invisible_core import forced_gpu_class
|
||||
from invisible_core import prepare_session_geo
|
||||
from invisible_core import make_virtual_display
|
||||
from ._engine import assert_wire_version, resolve_executable
|
||||
from invisible_core import configure_proxy as _configure_proxy_shared
|
||||
from ._reaper import SessionToken, guard_for
|
||||
@@ -52,8 +45,6 @@ from ._reaper import SessionToken, guard_for
|
||||
# with itself forever and no cross-check can see it. The declaration lives in
|
||||
# the core as Profile.screen.chrome_w / chrome_h, pinnable like every other
|
||||
# surface. These names survive only because async_api imports them.
|
||||
from invisible_core.constants import CHROME_H as _CHROME_H # noqa: E402
|
||||
from invisible_core.constants import CHROME_W as _CHROME_W # noqa: E402
|
||||
|
||||
# The taskbar is NOT a wrapper constant. It was one, at 40, while the core
|
||||
# declared 48 and the engine's compiled floor was 48 - so the viewport was
|
||||
@@ -62,7 +53,6 @@ from invisible_core.constants import CHROME_W as _CHROME_W # noqa: E402
|
||||
# field of the profile now (ScreenProfile.taskbar_px), pinnable like any other,
|
||||
# and the use sites below read it from there. This name survives only because
|
||||
# async_api imports it, and it resolves to the same declaration.
|
||||
from invisible_core.constants import TASKBAR_PX as _TASKBAR_H # noqa: E402
|
||||
|
||||
# The IANA -> POSIX TZ table moved to `_session` on 2026-07-27, so the async
|
||||
# class no longer has to import it FROM the sync module. Re-exported under the
|
||||
@@ -71,7 +61,7 @@ _IANA_TO_POSIX_TZ = _session._IANA_TO_POSIX_TZ
|
||||
_tz_env = _session.tz_env
|
||||
|
||||
|
||||
class InvisiblePlaywright:
|
||||
class InvisiblePlaywright(_session.CommonLaunch):
|
||||
"""Context manager launching a patched Firefox with a deterministic profile.
|
||||
|
||||
Usage:
|
||||
@@ -388,43 +378,7 @@ class InvisiblePlaywright:
|
||||
self._arm_cursor_engine(self._browser)
|
||||
return self._browser
|
||||
|
||||
def _bind_process_tree(self) -> None:
|
||||
"""Tie the browser tree to this process's lifetime, at the OS level.
|
||||
|
||||
MEASURED before being written, because the first attempt at this fixed
|
||||
a path that was not broken: an exception out of the `with` block does
|
||||
NOT leak - __exit__ runs and Playwright cleans up, zero survivors over
|
||||
an interleaved A/B. The leak is the killed-runner path, where __exit__
|
||||
never executes at all: launch, kill the runner, and eight processes
|
||||
were still alive; twelve on the second attempt. Nothing written inside
|
||||
_teardown can reach that, so the guarantee comes from a Windows job
|
||||
object that the kernel empties when this process's handle closes,
|
||||
however this process ends.
|
||||
|
||||
Best-effort by construction: a failure here leaves the pre-existing
|
||||
behaviour rather than breaking a launch that is otherwise fine.
|
||||
"""
|
||||
try:
|
||||
self._lifetime_guard.bind(self._session_token)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def _arm_cursor_engine(self, owner: Any) -> None:
|
||||
"""Register this session so its pages move through the Python generator.
|
||||
|
||||
Registered on the browser (or on the persistent context, which is all
|
||||
there is in that mode) rather than on each page: pages appear by
|
||||
several routes we do not control - ``browser.new_page()`` builds its
|
||||
context inside the driver, and a site can open a popup on its own - and
|
||||
every one of them can find its way back to this owner. The seed is the
|
||||
session seed, so a replayed seed replays the cursor exactly as it
|
||||
replays the fingerprint.
|
||||
"""
|
||||
if self._cursor_engine != ENGINE_PYTHON:
|
||||
return
|
||||
_enable_cursor_engine(
|
||||
owner, seed=self.seed, max_seconds=_cursor_max_seconds(self._humanize)
|
||||
)
|
||||
|
||||
def _persistent_context_kwargs(self) -> Dict[str, Any]:
|
||||
"""Context-level kwargs accepted by launch_persistent_context.
|
||||
@@ -585,31 +539,6 @@ class InvisiblePlaywright:
|
||||
|
||||
browser.new_page = patched_page # type: ignore[assignment]
|
||||
|
||||
def _default_context_kwargs(self) -> Dict[str, Any]:
|
||||
p = self._profile
|
||||
kwargs: Dict[str, Any] = {
|
||||
"viewport": {"width": p.screen.width - p.screen.chrome_w,
|
||||
"height": (p.screen.height
|
||||
- p.screen.taskbar_px
|
||||
- p.screen.chrome_h)},
|
||||
"screen": {"width": p.screen.width, "height": p.screen.height},
|
||||
# ⛔ device_scale_factor and color_scheme are NO LONGER passed.
|
||||
# They were a second source for two facts invisible_core already
|
||||
# declares (layout.css.devPixelsPerPx and, since 2026-08-24,
|
||||
# layout.css.prefers-color-scheme.content-override), and this one
|
||||
# won: measured, setting the pref to a different value the
|
||||
# browser did not move. Now there is only one path.
|
||||
}
|
||||
# Pass timezone via Playwright's per-realm override (docShell.overrideTimezone
|
||||
# → JS::SetRealmTimezoneOverride). The juggler.timezone.override pref path
|
||||
# uses JS::SetTimeZoneOverride globally, which is broken on Windows ICU for
|
||||
# no-DST IANA names (America/Phoenix, Pacific/Honolulu, ...) - those silently
|
||||
# fall back to the host system TZ. The per-realm path works for every zone.
|
||||
if self._timezone:
|
||||
kwargs["timezone_id"] = self._timezone
|
||||
if self._locale:
|
||||
kwargs["locale"] = self._locale
|
||||
return kwargs
|
||||
|
||||
def __exit__(self, *exc: Any) -> None:
|
||||
self._teardown()
|
||||
@@ -653,63 +582,6 @@ class InvisiblePlaywright:
|
||||
|
||||
# ── helpers ─────────────────────────────────────────────────────────
|
||||
|
||||
def _build_prefs(self) -> Dict[str, Any]:
|
||||
"""Fingerprint prefs plus humanize toggle (always set explicitly).
|
||||
|
||||
The body lives in `_session.build_prefs`, which the async class calls
|
||||
too. It used to be twenty lines here and the SAME twenty inlined into
|
||||
`async_api.__aenter__` - identical calls in identical order, differing
|
||||
only in their comments, which is how the two entry points drift.
|
||||
"""
|
||||
return _session.build_prefs(
|
||||
profile=self._profile,
|
||||
locale=self._locale,
|
||||
timezone=self._timezone,
|
||||
extra_prefs=self._extra_prefs,
|
||||
headless=self._headless,
|
||||
virtual_display=self._virtual_display is not None,
|
||||
cursor_engine=self._cursor_engine,
|
||||
humanize=self._humanize,
|
||||
show_cursor=self._show_cursor,
|
||||
)
|
||||
|
||||
def _build_env(self, prefs: Dict[str, Any]) -> Dict[str, str]:
|
||||
"""Env for the Firefox subprocess, then stamped with this session's token.
|
||||
|
||||
The body is `_session.build_env`, shared with the async class - it was
|
||||
written twice, identically, and the WebRTC pair is a contract with the
|
||||
binary, so two landing sites meant two chances to miss a change.
|
||||
|
||||
The token stamp stays here because it is the only genuinely per-session
|
||||
part: children inherit the environment, so every process in the tree
|
||||
carries it and teardown can find its own tree and only its own.
|
||||
"""
|
||||
return self._session_token.stamp(
|
||||
_session.build_env(timezone=self._timezone,
|
||||
srflx_dichiarato=self._srflx_dichiarato,
|
||||
profile=self._profile,
|
||||
executable=resolve_executable(self._binary_path)))
|
||||
|
||||
def _resolve_headless(self) -> bool:
|
||||
"""Translate the user's ``headless`` flag.
|
||||
|
||||
When ``True``, Firefox stays in headed mode (real rendering pipeline →
|
||||
coherent fingerprint) and the window is hidden: on Linux via a fresh
|
||||
Xvfb spawned here; on Windows/macOS via the binary's own window cloak
|
||||
(the ``zoom.stealth.cloak_windows`` pref added in ``_build_prefs``), so
|
||||
``make_virtual_display()`` returns ``None`` and nothing is spawned.
|
||||
"""
|
||||
if not self._headless:
|
||||
return False
|
||||
# Opt-in TRUE headless, shared with the async class. It existed on the
|
||||
# async API ONLY until 2026-07-27: a documented env var that worked
|
||||
# depending on which entry point the caller happened to pick, which is
|
||||
# the same drift that shipped the process-leak fix to half the users.
|
||||
if _session.true_headless_requested():
|
||||
return True
|
||||
vd = make_virtual_display()
|
||||
if vd is not None:
|
||||
vd.start()
|
||||
self._virtual_display = vd
|
||||
return False
|
||||
|
||||
@@ -0,0 +1,700 @@
|
||||
{
|
||||
"tests.sync.test_add_init_script::test_add_init_script_evaluate_before_anything_else_on_the_page[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_returns_disposable[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_support_multiple_scripts[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_throw_without_path_and_content[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_work_with_a_path[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_work_with_browser_context_scripts[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_work_with_browser_context_scripts_for_already_created_pages[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_work_with_browser_context_scripts_with_a_path[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_add_init_script_work_with_content[firefox]": "passed",
|
||||
"tests.sync.test_add_init_script::test_should_work_with_trailing_comments[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_boolean_checked_with_intermediate_true[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_boolean_checked_with_intermediate_true_and_checked[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_boolean_fail_with_indeterminate_true[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_checked[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_disabled_enabled[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_editable[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_editable_throws[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_editable_with_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_editable_with_false_and_throw_good_exception[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_editable_with_not_and_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_editable_with_true[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_empty[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_enabled_eventually[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_enabled_eventually_with_not[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_enabled_with_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_enabled_with_false_throws_good_exception[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_enabled_with_not_and_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_enabled_with_true[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_focused[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_hidden_visible[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_visible_eventually[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_visible_eventually_with_not[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_visible_with_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_visible_with_false_throws_good_exception[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_visible_with_not_and_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_be_visible_with_true[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_contain_class[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_contain_text[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_attribute[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_attribute_ignore_case[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_class[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_count[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_css[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_id[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_js_property[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_text[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_locator_to_have_value[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_page_to_have_title[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_page_to_have_url[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_page_to_have_url_with_base_url[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_response_is_ok_fail[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_response_is_ok_pass[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_response_is_ok_pass_with_not[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_assertions_should_serialize_regexp_correctly[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_ignore_case[firefox-to_contain_text]": "failed",
|
||||
"tests.sync.test_assertions::test_ignore_case[firefox-to_have_text]": "failed",
|
||||
"tests.sync.test_assertions::test_ignore_case_regex[firefox-to_contain_text]": "failed",
|
||||
"tests.sync.test_assertions::test_ignore_case_regex[firefox-to_have_text]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_able_to_set_custom_global_timeout[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_able_to_set_custom_timeout[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_default[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_eventually[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_eventually_with_not[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_fail[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_fail_with_not[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_attached_false[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_attached_false_and_throw_good_error[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_attached_true[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_hidden_element[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_impossible_timeout[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_impossible_timeout_not[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_not[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_be_attached_with_not_and_attached_false[firefox]": "passed",
|
||||
"tests.sync.test_assertions::test_should_print_expected_value_with_custom_message[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_print_response_with_text_content_type_if_to_be_ok_fails[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_should_print_users_message_for_page_based_assertion[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_soft_inside_scope_collects_failures[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_soft_outside_scope_raises_runtime_error[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_accessible_description[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_accessible_error_message[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_accessible_error_message_should_handle_multiple_aria_error_message_references[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_accessible_name[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_fail_boolean[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_fail_boolean_2[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_fail_number[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_fail_string[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_pass_boolean[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_pass_boolean_2[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_pass_null[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_pass_number[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_js_property_pass_string[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_role[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_exact_match_with_text[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_fails_when_items_not_selected[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_fails_when_multiple_not_specified[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_fails_when_not_a_select_element[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_follows_labels[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_works_with_regex[firefox]": "failed",
|
||||
"tests.sync.test_assertions::test_to_have_values_works_with_text[firefox]": "failed",
|
||||
"tests.sync.test_browser::test_bind_should_return_endpoint_and_allow_unbind[firefox]": "failed",
|
||||
"tests.sync.test_browser::test_should_fire_context_event_on_new_context[firefox]": "passed",
|
||||
"tests.sync.test_browser::test_should_return_browser_type[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_client_certificates::test_should_throw_with_untrusted_client_certs[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_client_certificates::test_should_work_with_global_api_request_context[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_client_certificates::test_should_work_with_new_context[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_client_certificates::test_should_work_with_new_context_passing_as_content[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_client_certificates::test_should_work_with_new_persistent_context[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_console_event_should_work[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_events::test_console_event_should_work_in_immediately_closed_popup[firefox]": "skipped",
|
||||
"tests.sync.test_browsercontext_events::test_console_event_should_work_in_popup[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_console_event_should_work_in_popup_2[firefox]": "skipped",
|
||||
"tests.sync.test_browsercontext_events::test_console_event_should_work_with_context_manager[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_events::test_dialog_event_should_work1[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_events::test_dialog_event_should_work_in_immdiately_closed_popup[firefox]": "skipped",
|
||||
"tests.sync.test_browsercontext_events::test_dialog_event_should_work_in_popup1[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_dialog_event_should_work_in_popup_2[firefox]": "skipped",
|
||||
"tests.sync.test_browsercontext_events::test_dialog_event_should_work_with_inline_script_tag[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_download_event_should_work[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_frameattached_event_should_work[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_framedetached_event_should_work[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_framenavigated_event_should_work[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_events::test_pageclose_event_should_work[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_events::test_pageload_event_should_work[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_events::test_weberror_event_should_include_location[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_events::test_weberror_event_should_work[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_amend_binary_post_data[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_amend_http_headers[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_amend_method[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_amend_post_data[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_chain_fallback_into_page[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_chain_once[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_delete_header_with_undefined_value[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_fall_back[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_fall_back_after_exception[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_fall_back_async_delayed[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_not_chain_abort[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_not_chain_fulfill[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_override_request_url[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_fallback::test_should_work[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_intercept::test_should_fulfill_intercepted_response[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_intercept::test_should_fulfill_response_with_empty_body[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_intercept::test_should_fulfill_with_any_response[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_intercept::test_should_override_with_defaults_when_intercepted_response_not_provided[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_intercept::test_should_show_exception_after_fulfill[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_request_intercept::test_should_support_fulfill_after_intercept[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_service_worker_policy::test_block_blocks_service_worker_registration[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_service_worker_policy::test_should_allow_service_workers_by_default[firefox]": "passed",
|
||||
"tests.sync.test_browsercontext_storage_state::test_should_capture_local_storage[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_storage_state::test_should_round_trip_through_the_file[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_storage_state::test_should_serialise_indexed_db[firefox]": "failed",
|
||||
"tests.sync.test_browsercontext_storage_state::test_should_set_local_storage[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_disconnected_event_should_be_emitted_when_browser_is_closed_or_server_is_closed[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_set_browser_connected_state[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_should_be_able_to_connect_two_browsers_at_the_same_time[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_should_be_able_to_reconnect_to_a_browser[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_should_forward_close_events_on_remote_kill[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_should_forward_close_events_to_pages[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_should_fulfill_with_global_fetch_result[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_should_throw_when_used_after_is_connected_returns_false[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_connect_slow_mo[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_browser_type_disconnected_event_should_have_browser_as_argument[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_connect_to_closed_server_without_hangs[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect::test_set_input_files_should_preserve_last_modified_timestamp[firefox]": "failed",
|
||||
"tests.sync.test_browsertype_connect_cdp::test_connect_to_an_existing_cdp_session[firefox]": "skipped",
|
||||
"tests.sync.test_cdp_session::test_should_be_able_to_detach_session[firefox]": "skipped",
|
||||
"tests.sync.test_cdp_session::test_should_detach_when_page_closes[firefox]": "skipped",
|
||||
"tests.sync.test_cdp_session::test_should_not_break_page_close[firefox]": "skipped",
|
||||
"tests.sync.test_cdp_session::test_should_receive_events[firefox]": "skipped",
|
||||
"tests.sync.test_cdp_session::test_should_work[firefox]": "skipped",
|
||||
"tests.sync.test_check::test_check_radio[firefox]": "passed",
|
||||
"tests.sync.test_check::test_check_the_box[firefox]": "passed",
|
||||
"tests.sync.test_check::test_check_the_box_by_aria_role[firefox]": "passed",
|
||||
"tests.sync.test_check::test_check_the_box_by_label[firefox]": "passed",
|
||||
"tests.sync.test_check::test_check_the_box_inside_label_without_id[firefox]": "passed",
|
||||
"tests.sync.test_check::test_check_the_box_outside_label[firefox]": "passed",
|
||||
"tests.sync.test_check::test_not_check_the_checked_box[firefox]": "passed",
|
||||
"tests.sync.test_check::test_not_uncheck_the_unchecked_box[firefox]": "passed",
|
||||
"tests.sync.test_check::test_uncheck_the_box[firefox]": "passed",
|
||||
"tests.sync.test_console::test_console_should_emit_same_log_twice[firefox]": "passed",
|
||||
"tests.sync.test_console::test_console_should_have_location_for_console_api_calls[firefox]": "passed",
|
||||
"tests.sync.test_console::test_console_should_not_fail_for_window_object[firefox]": "failed",
|
||||
"tests.sync.test_console::test_console_should_not_throw_when_there_are_console_messages_in_detached_iframes[firefox]": "failed",
|
||||
"tests.sync.test_console::test_console_should_trigger_correct_Log[firefox]": "passed",
|
||||
"tests.sync.test_console::test_console_should_use_text_for__str__[firefox]": "passed",
|
||||
"tests.sync.test_console::test_console_should_work[firefox]": "failed",
|
||||
"tests.sync.test_console::test_console_should_work_for_different_console_api_calls[firefox]": "failed",
|
||||
"tests.sync.test_context_manager::test_context_managers[firefox]": "passed",
|
||||
"tests.sync.test_context_manager::test_context_managers_not_hang[firefox]": "passed",
|
||||
"tests.sync.test_debugger::test_should_expose_debugger_property[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_a_nice_preview[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_bounding_box[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_bounding_box_force_a_layout[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_bounding_box_handle_nested_frames[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_bounding_box_return_null_for_invisible_elements[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_bounding_box_when_inline_box_child_is_outside_of_viewport[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_bounding_box_with_SVG_nodes[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_bounding_box_with_page_scale[firefox]": "skipped",
|
||||
"tests.sync.test_element_handle::test_check_the_box[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_for_TextNodes[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_for_shadow_dom_v1[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_throw_for__br__elements_with_force[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_throw_for_detached_nodes[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_throw_for_hidden_nodes_with_force[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_throw_for_recursively_hidden_nodes_with_force[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_click_with_node_removed[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_content_frame[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_content_frame_for_document_element[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_content_frame_for_non_iframes[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_double_click_the_button[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_fill_input[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_fill_input_when_Node_is_removed[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_focus_a_button[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_get_attribute[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_hover[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_hover_when_node_is_removed[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_inner_html[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_inner_text[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_inner_text_should_throw[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_input_value[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_is_checked_should_work[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_is_editable_should_work[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_is_enabled_and_is_disabled_should_work[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_is_visible_and_is_hidden_should_work[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_owner_frame[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_owner_frame_for_cross_frame_evaluations[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_owner_frame_for_cross_process_iframes[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_owner_frame_for_detached_elements[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_owner_frame_for_document[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_owner_frame_for_iframe_elements[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_scroll[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_scroll_should_throw_for_detached_element[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_select_input[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_select_single_option[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_select_text_select_plain_div[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_select_text_timeout_waiting_for_invisible_element[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_select_textarea[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_set_checked[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_should_allow_disposing_twice[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_should_timeout_waiting_for_visible[firefox]": "failed",
|
||||
"tests.sync.test_element_handle::test_text_content[firefox]": "passed",
|
||||
"tests.sync.test_element_handle::test_uncheck_the_box[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_throw_waiting_for_enabled_when_detached[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_throw_waiting_for_visible_when_detached[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_timeout_waiting_for_visible[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_already_hidden[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_already_visible[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_disabled_button[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_editable_input[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_enabled_button[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_hidden[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_hidden_when_detached[firefox]": "failed",
|
||||
"tests.sync.test_element_handle_wait_for_element_state::test_should_wait_for_visible[firefox]": "failed",
|
||||
"tests.sync.test_expect_misc::test_to_be_in_viewport_should_have_good_stack[firefox]": "failed",
|
||||
"tests.sync.test_expect_misc::test_to_be_in_viewport_should_report_intersection_even_if_fully_covered_by_other_element[firefox]": "passed",
|
||||
"tests.sync.test_expect_misc::test_to_be_in_viewport_should_respect_ratio_option[firefox]": "passed",
|
||||
"tests.sync.test_expect_misc::test_to_be_in_viewport_should_work[firefox]": "failed",
|
||||
"tests.sync.test_extension::test_should_give_access_to_the_service_worker[firefox]": "skipped",
|
||||
"tests.sync.test_extension::test_should_give_access_to_the_service_worker_when_recording_video[firefox]": "skipped",
|
||||
"tests.sync.test_fetch_browser_context::test_fetch_should_work[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_get_should_work[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_add_default_headers[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_add_session_cookies_to_request[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_not_add_context_cookie_if_cookie_header_passed_as_parameter[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_reject_file_value_in_form[firefox]": "passed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_application_x_www_form_urlencoded[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-fetch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-get]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-head]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_fail_on_status_code[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_form_data_with_repeated_keys[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-fetch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-get]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-head]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_ignore_https_errors_option[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_multipart_form_data[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_multipart_form_data_with_multiple_files_in_one_field[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_multipart_form_data_with_path_value[firefox]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-fetch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-get]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-head]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_object[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-fetch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-get]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-head]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_params_passed_as_strings[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_post_data[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_post_data[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_post_data[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_post_data[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-fetch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-get]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-head]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_support_query_params[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_browser_context::test_should_throw_on_network_error[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_dispose_global_request[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_follow_max_redirects[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_not_follow_redirects_when_max_redirects_is_set_to_0[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_not_throw_when_fail_on_status_code_is_false[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_propagate_extra_http_headers_with_redirects[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_resolve_url_relative_to_global_base_url_option[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_return_empty_body[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_return_error_with_correct_credentials_and_mismatching_hostname[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_return_error_with_correct_credentials_and_mismatching_port[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_return_error_with_correct_credentials_and_mismatching_scheme[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_return_error_with_wrong_credentials[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_serialize_null_values_in_json[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_support_global_http_credentials_option[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_support_global_ignore_https_errors_option[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_support_global_timeout_option[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_support_global_user_agent_option[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_support_timeout_option_in_get_method[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_throw_an_error_when_max_redirects_is_exceeded[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_throw_an_error_when_max_redirects_is_less_than_0[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_throw_when_fail_on_status_code_is_true[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_use_playwright_as_a_user_agent[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-delete]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-fetch]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-get]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-head]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-patch]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-post]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work[firefox-put]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work_with_correct_credentials_and_matching_origin[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_should_work_with_correct_credentials_and_matching_origin_case_insensitive[firefox]": "failed",
|
||||
"tests.sync.test_fetch_global::test_storage_state_should_round_trip_through_file[firefox]": "failed",
|
||||
"tests.sync.test_fill::test_fill_input[firefox]": "passed",
|
||||
"tests.sync.test_fill::test_fill_textarea[firefox]": "passed",
|
||||
"tests.sync.test_har::test_by_default_should_abort_requests_not_found_in_har[firefox]": "failed",
|
||||
"tests.sync.test_har::test_fallback_continue_should_continue_requests_on_bad_har[firefox]": "failed",
|
||||
"tests.sync.test_har::test_fallback_continue_should_continue_when_not_found_in_har[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_attach_content[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_context_route_from_har_matching_the_method_and_following_redirects[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_default_to_full_mode[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_disambiguate_by_header[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_filter_by_glob[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_filter_by_regexp[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_fulfill_from_har_with_content_in_a_file[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_go_back_to_redirected_navigation[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_go_forward_to_redirected_navigation[firefox]": "skipped",
|
||||
"tests.sync.test_har::test_should_include_content[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_omit_content[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_omit_content_legacy[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_only_handle_requests_matching_url_filter[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_only_handle_requests_matching_url_filter_no_fallback[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_only_handle_requests_matching_url_filter_no_fallback_page[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_page_route_from_har_matching_the_method_and_following_redirects[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_produce_extracted_zip[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_reload_redirected_navigation[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_round_trip_har_with_post_data[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_round_trip_har_zip[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_support_minimal_mode[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_support_regex_filter[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_update_extracted_har_zip_for_page[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_update_har_zip_for_context[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_update_har_zip_for_page[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_update_har_zip_for_page_with_different_options[firefox]": "failed",
|
||||
"tests.sync.test_har::test_should_work[firefox]": "failed",
|
||||
"tests.sync.test_input::test_expect_file_chooser[firefox]": "failed",
|
||||
"tests.sync.test_input::test_set_input_files_should_preserve_last_modified_timestamp[firefox]": "failed",
|
||||
"tests.sync.test_launcher::test_browser_close_should_be_callable_twice[firefox]": "passed",
|
||||
"tests.sync.test_launcher::test_browser_close_should_fire_close_event_for_all_contexts[firefox]": "failed",
|
||||
"tests.sync.test_launcher::test_browser_type_executable_path_should_work[firefox]": "failed",
|
||||
"tests.sync.test_launcher::test_browser_type_launch_should_accept_ignore_default_args_false[firefox]": "passed",
|
||||
"tests.sync.test_launcher::test_browser_type_launch_should_reject_if_executable_path_is_invalid[firefox]": "failed",
|
||||
"tests.sync.test_launcher::test_browser_type_launch_should_reject_if_launched_browser_fails_immediately[firefox]": "passed",
|
||||
"tests.sync.test_launcher::test_browser_type_launch_should_throw_if_page_argument_is_passed[firefox]": "skipped",
|
||||
"tests.sync.test_launcher::test_browser_type_name_should_work[firefox]": "passed",
|
||||
"tests.sync.test_listeners::test_listeners[firefox]": "passed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_alt_text[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_escaping[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_label[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_label_with_nested_elements[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_placeholder[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_role[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_test_id[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_test_id_escape_id[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_text[firefox]": "failed",
|
||||
"tests.sync.test_locator_get_by::test_get_by_title[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_drag_to[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_drop_should_drop_a_file_payload[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_drop_should_drop_clipboard_like_data[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_frame_locator_owner_should_work[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_get_by_role_with_description[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_get_by_role_with_description_whitespace_normalization[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locator_all_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locator_click_timeout_error_should_contain_call_log[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_content_frame_should_work[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_count_should_work_with_deleted_map_in_main_world[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_frame_locator_should_not_throw_on_first_last_nth[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_frame_locator_should_throw_on_ambiguity[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_highlight_should_work[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_locator_and_framelocator_locator_should_accept_locator[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_query_should_filter_by_regex[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_query_should_filter_by_regex_and_regexp_flags[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_query_should_filter_by_regex_with_quotes[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_query_should_filter_by_text[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_query_should_filter_by_text_2[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_query_should_filter_by_text_with_quotes[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_should_enforce_same_frame_for_has_locator[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_should_ignore_deprecated_is_hidden_and_visible_timeout[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locator_should_return_page[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locator_should_support_has_locator[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locator_should_support_locator_or[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_all_inner_texts[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_all_text_contents_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_check_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_clear_should_work[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_click_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_click_should_work_for_text_nodes[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_click_should_work_with_node_removed[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_dispatch_event_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_evaluate_all_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_evaluate_all_should_work_with_missing_selector[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_evaluate_handle_should_work[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_fill_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_focus_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_frame_should_work_for_nested_iframe[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_frame_should_work_with_iframe[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_frame_should_work_with_locator_frame_locator[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_get_attribute_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_has_does_not_encode_unicode[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_hover_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_inner_html_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_inner_text_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_input_value_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_is_checked_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_is_editable_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_is_enabled_and_is_disabled_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_is_hidden_and_is_visible_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_return_empty_array_for_non_existing_elements[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_select_option_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_set_checked[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_focus_and_blur_a_button[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_have_repr[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_press[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_query_existing_element[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_query_existing_elements[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_respect_first_and_last[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_respect_nth[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_return_bounding_box[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_screenshot[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_scroll_into_view[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_select_textarea[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_support_locator_and[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_throw_due_to_strictness[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_throw_due_to_strictness_2[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_should_throw_on_capture_without_nth[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_type[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_should_upload_a_file[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_locators_text_content_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_uncheck_should_work[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_locators_upload_nonexistant_file[firefox]": "passed",
|
||||
"tests.sync.test_locators::test_should_combine_visible_with_other_selectors[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_should_filter_by_case_insensitive_regex_in_a_child[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_should_filter_by_case_insensitive_regex_in_multiple_children[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_should_filter_by_regex_with_special_symbols[firefox]": "error",
|
||||
"tests.sync.test_locators::test_should_support_filter_visible[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_should_support_locator_filter[firefox]": "failed",
|
||||
"tests.sync.test_locators::test_should_support_locator_that[firefox]": "failed",
|
||||
"tests.sync.test_network::test_response_security_details[firefox]": "failed",
|
||||
"tests.sync.test_network::test_response_security_details_none_without_https[firefox]": "failed",
|
||||
"tests.sync.test_network::test_response_server_addr[firefox]": "failed",
|
||||
"tests.sync.test_network::test_should_fulfill_with_global_fetch_result[firefox]": "failed",
|
||||
"tests.sync.test_network::test_should_report_if_response_was_from_service_worker[firefox]": "failed",
|
||||
"tests.sync.test_network::test_should_report_service_worker_request[firefox]": "skipped",
|
||||
"tests.sync.test_page::test_drag_and_drop_helper_method[firefox]": "failed",
|
||||
"tests.sync.test_page::test_emitted_for_domcontentloaded_and_load[firefox]": "passed",
|
||||
"tests.sync.test_page::test_input_value[firefox]": "failed",
|
||||
"tests.sync.test_page::test_page_pause_should_reset_custom_timeouts[firefox]": "failed",
|
||||
"tests.sync.test_page::test_page_pause_should_reset_default_timeouts[firefox]": "failed",
|
||||
"tests.sync.test_page::test_page_should_ignore_deprecated_is_hidden_and_visible_timeout[firefox]": "passed",
|
||||
"tests.sync.test_page::test_should_check_box_using_set_checked[firefox]": "passed",
|
||||
"tests.sync.test_page::test_should_set_bodysize_and_headersize[firefox]": "failed",
|
||||
"tests.sync.test_page::test_should_set_bodysize_to_0[firefox]": "failed",
|
||||
"tests.sync.test_page::test_sync_stacks_should_work[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_not_work_with_force_true[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_removeLocatorHandler[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_throw_when_handler_times_out[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_throw_when_page_closes[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_wait_for_hidden_by_default[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_wait_for_hidden_by_default_2[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work_when_owner_frame_detaches[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work_with_a_custom_check[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work_with_locator_hover[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work_with_noWaitAfter[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work_with_times_option[firefox]": "failed",
|
||||
"tests.sync.test_page_add_locator_handler::test_should_work_with_to_be_visible[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_match_values_both_against_regex_and_string[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_page_aria_snapshot_should_work[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_complex[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_list[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_list_with_accessible_name[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_list_with_list[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_with_depth[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_with_restored_contain_mode_inside_deep_equal[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_with_unexpected_children_deep_equal[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_should_snapshot_with_unexpected_children_equal[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_to_match_aria_snapshot_should_match_page[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_to_match_aria_snapshot_should_match_page_complex[firefox]": "failed",
|
||||
"tests.sync.test_page_aria_snapshot::test_to_match_aria_snapshot_should_match_page_with_not[firefox]": "failed",
|
||||
"tests.sync.test_page_clock.TestFastForward::test_ignores_timers_which_wouldnt_be_run[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestFastForward::test_pushes_back_execution_time_for_skipped_timers[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestFastForward::test_supports_string_time_arguments[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestPopup::test_should_not_run_time_before_popup_on_pause[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestPopup::test_should_run_time_before_popup[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestPopup::test_should_tick_after_popup[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestPopup::test_should_tick_before_popup[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_creates_updated_Date_while_ticking[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_does_not_trigger_without_sufficient_delay[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_passes_1_minute[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_passes_2_hours_34_minutes_and_10_seconds[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_passes_8_seconds[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_returns_the_current_now_value[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_throws_for_invalid_format[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_triggers_after_sufficient_delay[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_triggers_event_when_some_throw[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_triggers_immediately_without_specified_delay[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_triggers_multiple_simultaneous_timers[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_triggers_simultaneous_timers[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestRunFor::test_run_for_waits_after_setTimeout_was_called[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestSetFixedTime::test_allows_installing_fake_timers_after_setting_time[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestSetFixedTime::test_allows_passing_as_int[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestSetFixedTime::test_allows_setting_time_multiple_times[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestSetFixedTime::test_does_not_fake_methods[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestSetFixedTime::test_fixed_time_is_not_affected_by_clock_manipulation[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_fakes_Date_constructor[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_global_fake_setTimeout_should_return_id[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_replaces_global_clearInterval[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_replaces_global_clearTimeout[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_replaces_global_performance_now[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_replaces_global_setInterval[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_replaces_global_setTimeout[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimers::test_sets_initial_timestamp[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestStubTimersPerformance::test_replaces_global_performance_time_origin[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileOnPause::test_fast_forward_should_not_run_nested_immediate[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileOnPause::test_run_for_should_not_run_nested_immediate[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileOnPause::test_run_for_should_not_run_nested_immediate_from_microtask[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_fast_forward[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_fast_forward_to[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_pause[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_pause_and_fast_forward[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_progress_time[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_run_for[firefox]": "error",
|
||||
"tests.sync.test_page_clock.TestWhileRunning::test_should_set_system_time_on_pause[firefox]": "error",
|
||||
"tests.sync.test_page_event_console::test_clear_console_messages_should_drop_buffered_messages[firefox]": "passed",
|
||||
"tests.sync.test_page_event_console::test_console_messages_should_work[firefox]": "passed",
|
||||
"tests.sync.test_page_event_console::test_should_have_a_timestamp[firefox]": "failed",
|
||||
"tests.sync.test_page_event_pageerror::test_page_errors_should_work[firefox]": "failed",
|
||||
"tests.sync.test_page_event_request::test_should_return_last_requests[firefox]": "failed",
|
||||
"tests.sync.test_page_network_response::test_should_reject_response_finished_if_context_closes[firefox]": "passed",
|
||||
"tests.sync.test_page_network_response::test_should_reject_response_finished_if_page_closes[firefox]": "passed",
|
||||
"tests.sync.test_page_network_response::test_should_return_http_version[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_amend_binary_post_data[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_amend_http_headers[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_amend_json_post_data[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_amend_method[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_amend_post_data[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_chain_fallback_with_dynamic_url[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_chain_once[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_delete_header_with_undefined_value[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_fall_back[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_fall_back_after_exception[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_fall_back_async_delayed[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_not_chain_abort[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_not_chain_fulfill[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_override_request_url[firefox]": "failed",
|
||||
"tests.sync.test_page_request_fallback::test_should_work[firefox]": "failed",
|
||||
"tests.sync.test_page_request_gc::test_should_work[firefox]": "failed",
|
||||
"tests.sync.test_page_request_intercept::test_should_intercept_with_url_override[firefox]": "failed",
|
||||
"tests.sync.test_page_request_intercept::test_should_support_timeout_option_in_route_fetch[firefox]": "failed",
|
||||
"tests.sync.test_page_request_timeout::test_context_request_should_support_timeout_option[firefox]": "failed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_deselect_all_options_when_passed_no_values_for_a_multiple_select[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_deselect_all_options_when_passed_no_values_for_a_select_without_multiple[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_not_throw_when_select_causes_navigation[firefox]": "failed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_respect_event_bubbling[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_return_an_array_of_matched_values[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_return_an_array_of_one_element_when_multiple_is_not_set[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_return_on_no_matched_values[firefox]": "failed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_return_on_no_values[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_multiple_options[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_multiple_options_with_attributes[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_only_first_option[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_option_with_empty_value[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option_by_empty_label[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option_by_handle[firefox]": "failed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option_by_index[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option_by_index_0[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option_by_label[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_select_single_option_by_value[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_throw_when_element_is_not_a__select_[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_unselect_with_null[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_option_should_work_when_re_defining_top_level_event_class[firefox]": "passed",
|
||||
"tests.sync.test_page_select_option::test_select_options_should_fall_back_to_selecting_by_label[firefox]": "passed",
|
||||
"tests.sync.test_pdf::test_should_be_able_capture_pdf_without_path[firefox]": "skipped",
|
||||
"tests.sync.test_pdf::test_should_be_able_to_save_pdf_file[firefox]": "skipped",
|
||||
"tests.sync.test_queryselector::test_selectors_register_should_handle_errors[firefox]": "failed",
|
||||
"tests.sync.test_queryselector::test_selectors_register_should_work[firefox]": "failed",
|
||||
"tests.sync.test_queryselector::test_selectors_register_should_work_in_main_and_isolated_world[firefox]": "failed",
|
||||
"tests.sync.test_queryselector::test_selectors_register_should_work_with_path[firefox]": "failed",
|
||||
"tests.sync.test_queryselector::test_should_work_with_layout_selectors[firefox]": "failed",
|
||||
"tests.sync.test_request_fulfill::test_should_fetch_original_request_and_fulfill[firefox]": "failed",
|
||||
"tests.sync.test_request_fulfill::test_should_fulfill_json[firefox]": "failed",
|
||||
"tests.sync.test_request_fulfill::test_should_fulfill_json_overriding_existing_response[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_fulfill_intercepted_response[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_fulfill_response_with_empty_body[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_fulfill_with_any_response[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_intercept_by_glob[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_not_follow_redirects_when_max_redirects_is_set_to_0_in_route_fetch[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_override_with_defaults_when_intercepted_response_not_provided[firefox]": "failed",
|
||||
"tests.sync.test_request_intercept::test_should_support_fulfill_after_intercept[firefox]": "failed",
|
||||
"tests.sync.test_resource_timing::test_should_work[firefox]": "failed",
|
||||
"tests.sync.test_resource_timing::test_should_work_for_redirect[firefox]": "failed",
|
||||
"tests.sync.test_resource_timing::test_should_work_for_ssl[firefox]": "failed",
|
||||
"tests.sync.test_resource_timing::test_should_work_for_subresource[firefox]": "failed",
|
||||
"tests.sync.test_route_web_socket::test_should_pattern_match[firefox]": "failed",
|
||||
"tests.sync.test_route_web_socket::test_should_work_with_base_url[firefox]": "failed",
|
||||
"tests.sync.test_route_web_socket::test_should_work_with_no_trailing_slash[firefox]": "failed",
|
||||
"tests.sync.test_route_web_socket::test_should_work_with_server[firefox]": "failed",
|
||||
"tests.sync.test_route_web_socket::test_should_work_with_ws_close[firefox]": "failed",
|
||||
"tests.sync.test_route_web_socket::test_should_work_without_server[firefox]": "failed",
|
||||
"tests.sync.test_screencast::test_should_expose_screencast_property[firefox]": "passed",
|
||||
"tests.sync.test_screencast::test_start_should_deliver_frames_via_callback[firefox]": "failed",
|
||||
"tests.sync.test_screencast::test_starting_twice_should_throw[firefox]": "failed",
|
||||
"tests.sync.test_selectors_misc::test_should_work_with_internal_and[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_browser_context_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_browser_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_browser_type_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_call_sync_method_after_playwright_close_with_own_loop[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_click_should_accept_timedelta_for_timeout[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_close_should_reject_all_promises[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_console_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_console_should_work[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_dialog_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_expect_response_should_not_hang_when_predicate_throws[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_expect_response_should_use_context_timeout[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_expect_response_should_work[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_frame_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_page_repr[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_should_return_proper_api_name_on_error[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_click[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_download[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_sync_handle_multiple_pages[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_make_existing_page_sync[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_nested_query_selector[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_sync_network_events[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_sync_playwright_multiple_times[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_playwright_stop_multiple_times[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_query_selector[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_set_default_timeout[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_sync_wait_for_event[firefox]": "failed",
|
||||
"tests.sync.test_sync::test_sync_wait_for_event_raise[firefox]": "passed",
|
||||
"tests.sync.test_sync::test_sync_workers_page_workers[firefox]": "failed",
|
||||
"tests.sync.test_tap::test_should_not_send_mouse_events_touchend_is_canceled[firefox]": "failed",
|
||||
"tests.sync.test_tap::test_should_not_send_mouse_events_touchstart_is_canceled[firefox]": "failed",
|
||||
"tests.sync.test_tap::test_should_send_all_of_the_correct_events[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_browser_context_output_trace[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_browser_context_output_trace_chunk[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_browser_context_should_not_throw_when_stopping_without_start_but_not_exporting[firefox]": "passed",
|
||||
"tests.sync.test_tracing::test_should_collect_sources[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_collect_trace_with_resources_but_no_js[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_collect_two_traces[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_correctly_determine_sync_apiname[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_display_wait_for_load_state_even_if_did_not_wait_for_it[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_record_a_har_with_options[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_record_a_zipped_har_for_apirequestcontext[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_respect_traces_dir_and_name[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_show_tracing_group_in_action_list[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_start_and_stop_har[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_should_work_with_playwright_context_managers[firefox]": "failed",
|
||||
"tests.sync.test_tracing::test_start_stop[firefox]": "failed",
|
||||
"tests.sync.test_unroute_behavior::test_context_unroute_all_removes_all_handlers[firefox]": "passed",
|
||||
"tests.sync.test_unroute_behavior::test_page_route_returns_disposable[firefox]": "failed",
|
||||
"tests.sync.test_unroute_behavior::test_page_unroute_all_removes_all_routes[firefox]": "failed",
|
||||
"tests.sync.test_video::test_record_video_can_get_video_path_immediately[firefox]": "failed",
|
||||
"tests.sync.test_video::test_record_video_to_path[firefox]": "failed",
|
||||
"tests.sync.test_video::test_record_video_to_path_persistent[firefox]": "failed",
|
||||
"tests.sync.test_video::test_should_error_if_page_not_closed_before_save_as[firefox]": "failed",
|
||||
"tests.sync.test_video::test_should_expose_video_path[firefox]": "failed",
|
||||
"tests.sync.test_video::test_video_should_exist[firefox]": "failed"
|
||||
}
|
||||
@@ -310,7 +310,7 @@ def test_the_launcher_hands_over_its_own_seed(stub_motion, monkeypatch):
|
||||
seen["max_seconds"] = max_seconds
|
||||
return True
|
||||
|
||||
monkeypatch.setattr("invisible_playwright.launcher._enable_cursor_engine", spy)
|
||||
monkeypatch.setattr("invisible_playwright._session._enable_cursor_engine", spy)
|
||||
ip = InvisiblePlaywright(seed=777, humanize=2.0)
|
||||
ip._arm_cursor_engine(_FakeBrowser())
|
||||
assert seen == {"seed": 777, "max_seconds": 2.0}
|
||||
@@ -322,7 +322,7 @@ def test_binary_engine_arms_nothing(stub_motion, monkeypatch):
|
||||
"""Under the escape hatch our side must stay completely out of the way."""
|
||||
called = []
|
||||
monkeypatch.setattr(
|
||||
"invisible_playwright.launcher._enable_cursor_engine",
|
||||
"invisible_playwright._session._enable_cursor_engine",
|
||||
lambda *a, **k: called.append(a),
|
||||
)
|
||||
monkeypatch.setenv(_cursor.ENGINE_ENV, "binary")
|
||||
|
||||
+13
-4
@@ -154,7 +154,16 @@ def test_e9_linux_build_prefs_omits_windows_sandbox_key(monkeypatch):
|
||||
def stop(self) -> None:
|
||||
pass
|
||||
|
||||
from invisible_playwright import launcher as _l
|
||||
# ⛔ PATCHED WHERE THE CODE LIVES, not where it used to be imported.
|
||||
# `_resolve_headless` moved into `_session.CommonLaunch` on 2026-08-29,
|
||||
# when six methods duplicated across the sync and async entry points
|
||||
# became one, so it now resolves `make_virtual_display` from `_session`'s
|
||||
# namespace. `launcher` had only ever IMPORTED the name, and once nothing
|
||||
# in that file used it the import was removed as unused - which it was,
|
||||
# for that file, and was not for these four tests. An import is not unused
|
||||
# because the module holding it does not use it: something can be reaching
|
||||
# a name THROUGH it, and here that something is a monkeypatch target.
|
||||
from invisible_playwright import _session as _l
|
||||
monkeypatch.setattr(_l, "make_virtual_display", lambda: _FakeDisplay())
|
||||
|
||||
ip = InvisiblePlaywright(seed=42, headless=True)
|
||||
@@ -181,7 +190,7 @@ def test_e9b_windows_build_prefs_omits_sandbox_key_when_no_real_desktop(monkeypa
|
||||
import sys as _sys
|
||||
monkeypatch.setattr(_sys, "platform", "win32")
|
||||
|
||||
from invisible_playwright import launcher as _l
|
||||
from invisible_playwright import _session as _l
|
||||
monkeypatch.setattr(_l, "make_virtual_display", lambda: None)
|
||||
|
||||
ip = InvisiblePlaywright(seed=42, headless=True)
|
||||
@@ -211,7 +220,7 @@ def test_e10_linux_resolve_headless_invokes_xvfb_dispatcher(monkeypatch):
|
||||
def stop(self) -> None:
|
||||
events.append("stop")
|
||||
|
||||
from invisible_playwright import launcher as _l
|
||||
from invisible_playwright import _session as _l
|
||||
monkeypatch.setattr(_l, "make_virtual_display", lambda: _FakeDisplay())
|
||||
|
||||
ip = InvisiblePlaywright(seed=42, headless=True)
|
||||
@@ -238,7 +247,7 @@ def test_e11_linux_teardown_stops_virtual_display_and_is_idempotent(monkeypatch)
|
||||
def stop(self) -> None:
|
||||
stops.append(True)
|
||||
|
||||
from invisible_playwright import launcher as _l
|
||||
from invisible_playwright import _session as _l
|
||||
monkeypatch.setattr(_l, "make_virtual_display", lambda: _FakeDisplay())
|
||||
|
||||
ip = InvisiblePlaywright(seed=42, headless=True)
|
||||
|
||||
@@ -17,7 +17,7 @@ import threading
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_playwright._juggler import factory
|
||||
from invisible_playwright._juggler import transport as factory
|
||||
from invisible_playwright._juggler.connection import EventListeners
|
||||
|
||||
PAGE = b"""<!doctype html><html><head><title>seam</title></head><body>
|
||||
@@ -58,17 +58,26 @@ def _serve(body):
|
||||
|
||||
# ── without a browser ───────────────────────────────────────────────────────
|
||||
|
||||
def test_an_unknown_transport_is_REFUSED_not_silently_the_default(monkeypatch):
|
||||
"""⛔ THE KNOWN-BAD OF THE SWITCH. A typo would otherwise run the driver
|
||||
while the caller believed they were measuring the Python path, and every
|
||||
number taken that way would describe the wrong arm. This project has a rule
|
||||
about a bench arm that is not what it says it is."""
|
||||
def test_a_name_that_is_not_the_driver_gets_the_only_transport(monkeypatch):
|
||||
"""⛔ THIS ASSERTED THE OPPOSITE UNTIL 2026-08-29, and the reason it
|
||||
changed is that its reason expired.
|
||||
|
||||
The switch used to REFUSE an unknown value, arguing that a typo would
|
||||
otherwise run the driver while the caller believed they were measuring the
|
||||
Python path - a bench arm that is not what it says it is. That was true
|
||||
while there were two transports. There is one: any value that is not
|
||||
`driver` correctly yields the only thing there is, and a guard that
|
||||
protects against nothing is a concept for nothing.
|
||||
|
||||
What still has to hold is the OTHER half, tested below: `driver` by name
|
||||
must still explain what happened to it, because 0.7.4 shipped with the
|
||||
driver as the default and somebody can have it set in a shell.
|
||||
"""
|
||||
monkeypatch.setenv(factory.CHOICE_ENV, "jugler")
|
||||
with pytest.raises(ValueError) as failure:
|
||||
factory.chosen()
|
||||
assert "jugler" in str(failure.value)
|
||||
assert factory.JUGGLER in str(failure.value), (
|
||||
"the refusal does not say what the valid names are")
|
||||
assert factory.chosen() == "jugler"
|
||||
monkeypatch.setenv(factory.CHOICE_ENV, "anything-at-all")
|
||||
assert factory.chosen() != factory.DRIVER, (
|
||||
"only the exact name `driver` may reach the migration message")
|
||||
|
||||
|
||||
def test_the_default_is_the_PYTHON_SERVER(monkeypatch):
|
||||
|
||||
@@ -3,13 +3,19 @@ import pytest
|
||||
|
||||
from invisible_core import generate_profile
|
||||
|
||||
# ⛔ FROM THE CORE, not through `launcher`. Until 2026-08-29 these three
|
||||
# arrived here because the launcher IMPORTED them, not because they were its
|
||||
# own: an accidental re-export, which only became visible when those imports
|
||||
# turned unused in there and were removed. An import is not unused merely
|
||||
# because the file holding it does not use it - another module can be reaching
|
||||
# a name THROUGH it, and no single-file analysis can see that.
|
||||
from invisible_core.constants import (CHROME_H as _CHROME_H,
|
||||
CHROME_W as _CHROME_W,
|
||||
TASKBAR_PX as _TASKBAR_H)
|
||||
from invisible_playwright.launcher import (
|
||||
InvisiblePlaywright,
|
||||
_IANA_TO_POSIX_TZ,
|
||||
_tz_env,
|
||||
_CHROME_W,
|
||||
_CHROME_H,
|
||||
_TASKBAR_H,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -12,11 +12,17 @@ import pytest
|
||||
|
||||
from invisible_core import get_default_stealth_prefs
|
||||
from invisible_playwright import InvisiblePlaywright, _cursor
|
||||
# ⛔ FROM THE CORE, not through `launcher`. Until 2026-08-29 these three
|
||||
# arrived here because the launcher IMPORTED them, not because they were its
|
||||
# own: an accidental re-export, which only became visible when those imports
|
||||
# turned unused in there and were removed. An import is not unused merely
|
||||
# because the file holding it does not use it - another module can be reaching
|
||||
# a name THROUGH it, and no single-file analysis can see that.
|
||||
from invisible_core.constants import (CHROME_H as _CHROME_H,
|
||||
CHROME_W as _CHROME_W,
|
||||
TASKBAR_PX as _TASKBAR_H)
|
||||
from invisible_playwright.launcher import (
|
||||
_CHROME_H,
|
||||
_CHROME_W,
|
||||
_IANA_TO_POSIX_TZ,
|
||||
_TASKBAR_H,
|
||||
_tz_env,
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user