Files
2026-05-27 23:29:53 +01:00

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 at packages/dev/testing-e2e/src/.
  • The archived enterprise-testing-e2e/tasks.md carries 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

  1. Add **Verified by:** lines under every ### Requirement: block in openspec/specs/testing-e2e/spec.md.
  2. Fix the stale path text (universal → dev) in the coverage requirement.
  3. Add src/spec-conformance.test.ts covering:
    • Playwright test / expect / request identity equality with @playwright/test source.
    • Every value in TESTING_E2E_ERROR_CODES matches TESTING_E2E_ERROR_CODE_PATTERN.
    • AbortedError / ConfigError / NavigationError / WaitTimeoutError / FixtureError are all instanceof TestingE2eError and carry pattern-matching codes.
    • createPlaywrightConfig defaults and CI-mode behaviour pinned via the public surface.
    • Helper-function arity guards (catches accidental signature drift).
    • PageObject prototype shape (navigate / waitForReady / findByRole / findByLabel / findByText).
  4. Replace the bulk-tick archive note in archive/2026-04-19-enterprise-testing-e2e/tasks.md with a non-flagged historical note pointing at this change.
  5. Re-run bun scripts/openspec-conformance.ts @suaveplan/testing-e2e and confirm exit 0.

Impact

  • Public API unchanged.
  • One new test file (src/spec-conformance.test.ts).
  • openspec/specs/testing-e2e/spec.md gains 8 **Verified by:** lines and a path correction.
  • openspec/archive/2026-04-19-enterprise-testing-e2e/tasks.md archive note rewritten (archive sanitisation, no semantic change).