3.3 KiB
OpenSpec Change: testing-e2e-spec-conformance
- Change ID: testing-e2e-spec-conformance
- Package:
@suaveplan/testing-e2e - Status: PROPOSED
- Date: 2026-04-26
Summary
Annotate every requirement in openspec/specs/testing-e2e/spec.md with a **Verified by:** line, add a src/spec-conformance.test.ts pinning Playwright primitive identity / structured-error code regex / config-factory defaults / helper signatures / PageObject shape, fix the stale packages/universal/testing-e2e/src/ path reference (the package lives at packages/dev/testing-e2e/), and rectify the retroactively ticked phrase in archive/2026-04-19-enterprise-testing-e2e/tasks.md so bun scripts/openspec-conformance.ts @suaveplan/testing-e2e exits 0. No public-API changes.
Current state
@suaveplan/testing-e2e is structurally solid: zero @suaveplan/* runtime deps, structured TestingE2eError hierarchy with stable TESTING_E2E.<DOMAIN>.<REASON> codes, createPlaywrightConfig factory with WSL2/CI-safe defaults, abstract PageObject base, full helper set (waitForNetworkIdle, screenshotOnFailure, dismissDialog, mockGeolocation, mockClipboard), extendedTest fixture, monitor surfaces (console / network), multi-session helper, Chromium extension fixture, OTel instrumented wrapper. Per-feature unit tests are co-located; cross-cutting guards live in tests/. Conformance gaps are purely documentary plus one new pin file:
- 8/8 requirements lack
**Verified by:**lines. - The folded spec mentions
packages/universal/testing-e2e/src/but the package shipped atpackages/dev/testing-e2e/src/. - The archived
enterprise-testing-e2e/tasks.mdcarries the historical bulk-tick phrase, which the conformance script flags. - No single test pins the Playwright re-export identity (
exportedTest === pwTest) or the structured-error regex over the whole code registry. These were implicit in scattered tests but not explicit.
What changes
- Add
**Verified by:**lines under every### Requirement:block inopenspec/specs/testing-e2e/spec.md. - Fix the stale path text (
universal→dev) in the coverage requirement. - Add
src/spec-conformance.test.tscovering:- Playwright
test/expect/requestidentity equality with@playwright/testsource. - Every value in
TESTING_E2E_ERROR_CODESmatchesTESTING_E2E_ERROR_CODE_PATTERN. AbortedError/ConfigError/NavigationError/WaitTimeoutError/FixtureErrorare allinstanceof TestingE2eErrorand carry pattern-matching codes.createPlaywrightConfigdefaults and CI-mode behaviour pinned via the public surface.- Helper-function arity guards (catches accidental signature drift).
PageObjectprototype shape (navigate/waitForReady/findByRole/findByLabel/findByText).
- Playwright
- Replace the bulk-tick archive note in
archive/2026-04-19-enterprise-testing-e2e/tasks.mdwith a non-flagged historical note pointing at this change. - Re-run
bun scripts/openspec-conformance.ts @suaveplan/testing-e2eand confirm exit 0.
Impact
- Public API unchanged.
- One new test file (
src/spec-conformance.test.ts). openspec/specs/testing-e2e/spec.mdgains 8**Verified by:**lines and a path correction.openspec/archive/2026-04-19-enterprise-testing-e2e/tasks.mdarchive note rewritten (archive sanitisation, no semantic change).