You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pin the selenium BiDi surface with a guarded test #281
The adapter reaches past the public API into driver.network.conn, bidi.network.NetworkEvent and bidi.session.Session. tests/test_bidi.py runs
entirely on fakes, so a selenium upgrade that moves any of them passes CI green
and degrades at runtime. Selenium PR 17761 regenerates that layer from a shared
schema, which makes the move likely rather than hypothetical.
Acceptance criteria
A test, skipped when selenium is absent, asserts those
three imports and attributes resolve on the installed selenium. It runs in python.yml and fails loudly on a selenium bump that moves them.
Partly addressed, and the CI half is provably unmet
#317 added one guarded test of this shape — test_pin_registers_without_a_browsing_context — because the preload depends on driver.script.pin() registering globally. pin()'s docstring says "Pins a script to the current browsing context", but it forwards no contexts argument and BiDi reads that as every context. That reliance is undocumented, so a test asserts it: if selenium ever scopes pin to one context, the test fails rather than the preload silently covering only the first document.
That does not close this issue, on either axis:
1. The named internals are still unpinned. This issue is about driver.network.conn, bidi.network.NetworkEvent and bidi.session.Session. None of those has a guard; tests/test_bidi.py still runs entirely on fakes.
2. The acceptance criterion "it runs in python.yml" cannot currently be met. The job installs nothing and runs PYTHONPATH=src python -m unittest discover -s tests, so selenium is absent and any test of the real surface must skip — which is exactly what the new one does:
Ran 230 tests in 3.812s
OK (skipped=1)
So the guard exists but never runs where it is supposed to protect. A selenium bump that moves these attributes still passes CI green, which is the failure this issue was filed to prevent.
The fix is therefore partly a CI change, not only a test: the Python job needs the adapter's own runtime dependency installed (pip install -e . or equivalent) before a guard of this kind is worth anything. That also makes the existing pin() guard live, and would let several other tests exercise real selenium rather than fakes.
Activity
vishnuv688 commentedon Aug 18, 2026
Partly addressed, and the CI half is provably unmet
#317 added one guarded test of this shape —
test_pin_registers_without_a_browsing_context— because the preload depends ondriver.script.pin()registering globally.pin()'s docstring says "Pins a script to the current browsing context", but it forwards nocontextsargument and BiDi reads that as every context. That reliance is undocumented, so a test asserts it: if selenium ever scopespinto one context, the test fails rather than the preload silently covering only the first document.That does not close this issue, on either axis:
1. The named internals are still unpinned. This issue is about
driver.network.conn,bidi.network.NetworkEventandbidi.session.Session. None of those has a guard;tests/test_bidi.pystill runs entirely on fakes.2. The acceptance criterion "it runs in
python.yml" cannot currently be met. The job installs nothing and runsPYTHONPATH=src python -m unittest discover -s tests, so selenium is absent and any test of the real surface must skip — which is exactly what the new one does:So the guard exists but never runs where it is supposed to protect. A selenium bump that moves these attributes still passes CI green, which is the failure this issue was filed to prevent.
The fix is therefore partly a CI change, not only a test: the Python job needs the adapter's own runtime dependency installed (
pip install -e .or equivalent) before a guard of this kind is worth anything. That also makes the existingpin()guard live, and would let several other tests exercise real selenium rather than fakes.