mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
2.6 KiB
2.6 KiB
Playwright Integration Recommendations (2026-02-22)
This document captures practical follow-ups for improving bitvid's end-to-end and extension integration testing.
What is now in place
- Deterministic E2E matrix projects:
- Chromium (
e2e) - Firefox (
e2e-firefox)
- Optional extension project:
e2e-nip07-extension(opt-in viaPLAYWRIGHT_ENABLE_EXTENSION_E2E=1andPLAYWRIGHT_EXTENSION_PATH)
- Persistent-context extension launcher:
- Script:
scripts/playwright/run-extension-persistent.mjs - Command:
npm run test:e2e:extension - Purpose: run extension tests in Chromium with a real persistent profile context.
- Test harness upgrades:
setTestRelays(urls)alignsrelayManagerandnostrClient.setSignerDecryptBehavior(mode, opts)forces decrypt behavior for deterministic list-sync tests.getListSyncEvents(),clearListSyncEvents(),waitForListSyncEvent()capture and assert sync lifecycle.
- Stable sync/test selectors:
- Permission prompt, hashtag/subscription statuses, blocked-list status/list/empty state.
Recommended next steps
- Add CI extension smoke lane (manual workflow dispatch only)
- Keep extension smoke out of default PR path.
- Add a separate workflow that runs only when maintainers provide:
PLAYWRIGHT_EXTENSION_PATHartifact or unpacked extension directory- any extension secrets/profile setup needed by the signer.
- Add extension artifact capture on failure
- Always upload:
playwright-report- video/trace/screenshot for
tests/e2e-extension/** - JSON summary of
window.nostrcapabilities.
- Add capability contract test
- Add a single test that asserts minimum NIP-07 surface before running deeper flows:
getPublicKeysignEvent- at least one decrypt path (
nip04ornip44).
- Add "auth ready" test harness API
- Add a harness method that waits for authenticated app-ready state (
header UI + signer + relay ready) so tests stop duplicating custom waits.
- Add deterministic clock/random seed helper in test mode
- Expose optional fixed clock/random behavior to reduce cross-run variance in event ordering and timeout-sensitive tests.
- Add a small extension compatibility matrix note
- Track known-good extension versions for:
- Alby/Nostr Connect style extensions
- Chromium version pinned in CI.
Operational guardrails
- Keep deterministic tests (mock signer + mock relay) as the default required PR gate.
- Keep extension tests opt-in until flake rate is low and extension lifecycle setup is automated.
- Do not treat extension
content.jsruntime noise as app regression unless bitvid telemetry/events also fail in the same window.