2.6 KiB
2.6 KiB
Why
@suaveplan/testing-e2e is the entry point for every Playwright E2E test in the genesis monorepo. Per the testing-package separation hard rule, it owns Playwright fixtures, page objects, helpers, and a createPlaywrightConfig() factory. It is the third and final Layer 0 testing-infrastructure package.
Layer 0 — testing-infra packages take no @suaveplan/* workspace deps. External catalog deps only.
What Changes
- New package
@suaveplan/testing-e2eatpackages/universal/testing-e2e/(genesis-fresh, version0.1.0). - Substitutions per genesis rules:
- Local
TestingE2eError extends Errorwith{ code, cause, context }shape (no@suaveplan/error) @opentelemetry/apidirect (no@suaveplan/opentelemetry)zoddirect (no@suaveplan/schema-registry)- English-only
codemachine-contract messages (no@suaveplan/i18n)
- Local
- No
@suaveplan/*runtime deps.@suaveplan/testingis allowed as adevDependencyonly (mirroring the testing-dom precedent).
Public surface (this package)
- Re-exports of Playwright primitives:
test,expect,Page,Browser,BrowserContext,Locator,request createPlaywrightConfig(options)— factory that emits aPlaywrightTestConfigwith WSL2-safe defaults (fullyParallel: falsefor stability, retries on CI, screenshot/video/trace on failure)PageObjectbase class — typed wrapper around a PlaywrightPageexposing common patterns (navigate,waitForReady,findByRole-style locators)- Test fixtures —
extendedTestextending Playwright'stestwith a stable shared fixture set:userPage(pre-authenticated),apiContext(Playwrightrequestinstance),freshPage(forced new context) - Helpers:
waitForNetworkIdle,screenshotOnFailure,dismissDialog,mockGeolocation,mockClipboard - Errors:
TestingE2eError,NavigationError,WaitTimeoutError,ConfigError,FixtureError,AbortedErrorwithTESTING_E2E.<DOMAIN>.<REASON>codes
Capabilities
New Capabilities
testing-e2e: Playwright fixtures, page-object base class, helpers, config factory, structured errors. Layer 0; no@suaveplan/*runtime deps.
Modified Capabilities
(none)
Impact
- Affected code:
packages/universal/testing-e2e/**(fresh). - Affected consumers: every E2E-testing app/package (none yet on genesis).
- Version:
0.1.0. - Catalogs:
@playwright/testis already incatalogs.testingon main; carry over or add the version. - Pre-publish gate:
bunx turbo lint typecheck test --filter=@suaveplan/testing-e2egreen + ≥ 95% coverage on touched modules.