test(e2e): cross-browser smoke verification for assess()#15
Merged
Conversation
assess() detection was jsdom-verified only — and jsdom has no Worker, so the DevTools debugger detector and real-engine timing/navigator behaviour were never exercised. A browser update could silently turn a detector into a false negative without CI noticing. Add an e2e/ Playwright package: a Vite-built fixture loads Shield's source and exposes assess() on window; the spec drives it via page.evaluate and asserts result shape, that the shield.automation.webdriver signal mirrors the live navigator.webdriver, that a forced extension signature composes risk -> flags -> spanAttributes end-to-end, and that a clean session stays lean. This exercises the Worker-based DevTools debugger detector jsdom cannot run. CI runs Chromium + Firefox on ubuntu and WebKit on macos-latest (Playwright WebKit throws an internal error on Linux regardless of the static server, so it is gated off Linux and verified natively on macOS — the engine where timing heuristics diverge most). 8/8 green on Chromium + Firefox locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
assess()'s detection logic was jsdom-verified only. jsdom has noWorker, so the DevTools debugger detector — and real-engine timing/navigatorbehaviour generally — was never exercised. A browser update could silently turn a timing detector into a false negative and CI would stay green. This was the roadmap's "biggest single credibility / reliability gap."What
A new
e2e/Playwright package that runsassess()in real engines:demo/app uses) and exposesassess()onwindow; the spec drives it viapage.evaluate.shield.automation.webdrivermirrors the livenavigator.webdriver(correctlytrueunder Playwright); a forced__REACT_DEVTOOLS_GLOBAL_HOOK__signature composes the full detector → risk → flags →spanAttributespipeline; a clean session keepsspanAttributeslean.CI
e2ejob — Chromium + Firefox onubuntu-latest.e2e-webkitjob — WebKit onmacos-latest. Playwright's WebKit throws an "internal error" on Linux regardless of the server (confirmed empirically with bothvite previewand a plain Node static server), so it's gated off Linux and verified natively on macOS — the engine where timing heuristics diverge most.Verification
8/8 green on Chromium + Firefox locally. Artifacts (
node_modules,dist,test-results,playwright-report) are git-ignored; a contributorREADMEis included.