je_web_runner.api.debugging

Façade: cross browser parity / pr comment / extension harness.

class je_web_runner.api.debugging.BrowserRunResult(browser: 'str', title: 'str | None' = None, dom_text: 'str | None' = None, console: 'list[dict[str, Any]]'=<factory>, network: 'list[dict[str, Any]]'=<factory>, screenshot: 'bytes | None' = None)

Bases: object

browser: str
console: list[dict[str, Any]]
dom_text: str | None = None
network: list[dict[str, Any]]
screenshot: bytes | None = None
title: str | None = None
exception je_web_runner.api.debugging.CrossBrowserError

Bases: WebRunnerException

Raised when run input shape is invalid.

exception je_web_runner.api.debugging.ExtensionHarnessError

Bases: WebRunnerException

Raised when manifest is malformed or extension dir is invalid.

class je_web_runner.api.debugging.ExtensionInfo(name: 'str', version: 'str', manifest_version: 'int', popup: 'str | None' = None, background_script: 'str | None' = None, permissions: 'list[str] | None' = None, extension_dir: 'str | None' = None)

Bases: object

background_script: str | None = None
extension_dir: str | None = None
manifest_version: int
name: str
permissions: list[str] | None = None
popup: str | None = None
version: str
class je_web_runner.api.debugging.ParityFinding(browser: 'str', field: 'str', expected: 'Any', actual: 'Any', severity: 'str')

Bases: object

actual: Any
browser: str
expected: Any
field: str
severity: str
class je_web_runner.api.debugging.ParityReport(reference: 'str', findings_by_browser: 'dict[str, list[ParityFinding]]'=<factory>)

Bases: object

findings_by_browser: dict[str, list[ParityFinding]]
major_findings() list[ParityFinding]
property matches: bool
reference: str
exception je_web_runner.api.debugging.PrCommentError

Bases: WebRunnerException

Raised when posting / updating a PR comment fails.

class je_web_runner.api.debugging.PrSummary(total: 'int', passed: 'int', failed: 'int', skipped: 'int' = 0, duration_seconds: 'float | None' = None, flaky: 'int' = 0, sections: 'list[dict[str, Any]]'=<factory>)

Bases: object

duration_seconds: float | None = None
failed: int
flaky: int = 0
passed: int
sections: list[dict[str, Any]]
skipped: int = 0
total: int
je_web_runner.api.debugging.apply_extension_to_chrome_options(options: Any, extensions: Iterable[str | Path]) Any

給 Selenium ChromeOptions 加上 --load-extension。 Add --load-extension flags for each unpacked extension directory.

je_web_runner.api.debugging.assert_parity(report: ParityReport, allow_fields: Iterable[str] | None = None, only_major: bool = True) None

Raise if any disallowed finding remains.

je_web_runner.api.debugging.build_summary_markdown(summary: PrSummary, run_url: str | None = None) str
je_web_runner.api.debugging.diff_runs(runs: Iterable[BrowserRunResult], reference_browser: str | None = None) ParityReport

比對每個 run 與 reference_browser 的結果差異 Diff every run against reference_browser (default: the first run).

je_web_runner.api.debugging.extension_info(directory: str | Path) ExtensionInfo

Convenience: parse manifest under directory and stamp extension_dir.

je_web_runner.api.debugging.parse_manifest(manifest: str | Path | dict[str, Any]) ExtensionInfo

Parse a manifest dict / file path into ExtensionInfo.

je_web_runner.api.debugging.playwright_persistent_context_args(extensions: Iterable[str | Path], user_data_dir: str | Path, headless: bool = False) dict[str, Any]

Return kwargs for Playwright’s launch_persistent_context.

Playwright requires a persistent context to load a packed extension; headless mode is unreliable for MV3 service workers so the default is headless=False.

je_web_runner.api.debugging.post_or_update_comment(repo: str, pr_number: int, body: str, token: str | None = None) dict[str, Any]

依 marker 判斷新增或覆寫 WebRunner summary 留言 Find the WebRunner-marker comment on this PR and PATCH it; create a new one if no marker comment exists yet.