test: activate the full e2e (browser-driving) suite + add fetch --force
The 138 @pytest.mark.e2e tests were doubly inactive: deselected by addopts AND skipped without a cached binary — and 3 of the 6 per-file firefox_binary fixtures silently ignored INVPW_BINARY_PATH, so they'd test whatever was cached even when you pointed the suite elsewhere (a false-confidence trap). - Centralize firefox_binary into conftest.py (env INVPW_BINARY_PATH → cache → skip); delete the 6 duplicates. Unify test_webrtc_realness onto the same env. - scripts/run_e2e.py: one command that runs ALL e2e against a chosen binary, with reruns so an under-load interaction flake (dblclick/hover pass 3/3 in isolation) self-heals while a real break fails every attempt. The webrtc e2e fake a TCP-only SOCKS locally, so the suite is offline. This is the MANDATORY pre-release browser gate (local — hosted runners are too interaction-flaky). - Running the suite against firefox-9 surfaced a real gap: `invisible_playwright fetch --force` was unrecognized (the subparser took no args) though the e2e test + docstring expect it. Implement it: drop the cached version dir, refetch. - Add pytest-rerunfailures + playwright to the dev extras. Baseline against firefox-9: 136 passed, 1 skipped (linux_only on win host), 1 was the --force gap now fixed.
This commit is contained in:
@@ -27,12 +27,10 @@ Run only this file:
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
from invisible_playwright.constants import BINARY_ENTRY_REL
|
||||
|
||||
|
||||
# ────────────────────────────────────────────────────────────────────
|
||||
@@ -53,32 +51,6 @@ PIN = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def firefox_binary():
|
||||
"""Locate the patched Firefox binary. Three lookup paths:
|
||||
1. ``INVPW_BINARY_PATH`` env var (for dev iteration against a local build)
|
||||
2. Cached binary under ``cache_dir_for_version()`` (post-fetch)
|
||||
3. Skip cleanly (no implicit network download)."""
|
||||
import os
|
||||
env_path = os.environ.get("INVPW_BINARY_PATH")
|
||||
if env_path:
|
||||
from pathlib import Path
|
||||
if Path(env_path).exists():
|
||||
return env_path
|
||||
pytest.skip(f"INVPW_BINARY_PATH={env_path!r} does not exist")
|
||||
if sys.platform not in BINARY_ENTRY_REL:
|
||||
pytest.skip(f"unsupported platform: {sys.platform}")
|
||||
from invisible_playwright.download import cache_dir_for_version
|
||||
entry = cache_dir_for_version() / BINARY_ENTRY_REL[sys.platform]
|
||||
if not entry.exists():
|
||||
pytest.skip(
|
||||
"patched Firefox not cached; run "
|
||||
"`python -m invisible_playwright fetch` first, or set "
|
||||
"INVPW_BINARY_PATH to a local build"
|
||||
)
|
||||
return str(entry)
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def page(firefox_binary):
|
||||
"""One headless browser shared across the whole module.
|
||||
|
||||
Reference in New Issue
Block a user