SKILL.md
Playwright E2E — ADRA Frontends
Guidance for E2E tests in adra-frontends using @nuxt/test-utils/playwright, @adra-network/testing-utilities, and Nx targets.
When to apply
- Adding or fixing files under
frontends/*/tests/e2e/
- Debugging flaky timeouts, auth redirects, or "element not found"
- Deciding serial vs parallel test execution
- Setting up
.env.test:e2e, .env.build-static, or .env.playwright
- Reviewing E2E PRs for selector/waiting anti-patterns
Workflow checklist
- Run through Nx —
pnpm exec nx test:e2e <app> (never raw playwright test for normal runs)
- Use generated config —
@adra-network/testing-utilities/nuxt in extends; config lives in .nuxt/playwright.config.ts (regenerated by nx prepare)
- Navigate with
createPathHelper() — CI prefixes app name; local does not
- Wait on UI signals —
expect(...).toBeVisible() after domcontentloaded; no waitForTimeout
- Select with
data-testid — add testids to components instead of CSS classes
- Choose isolation model — parallel by default; serial when tests share mutable backend state
- Debug one test —
pnpm exec nx test:e2e <app> -- --grep "partial title"
Quick reference (read rule files for detail)
| Rule |
Topic |
run-via-nx-not-playwright-cli |
Nx targets, env loading, cache |
use-createpathhelper-and-env-files |
Paths, .env.test:e2e, auth creds |
selectors-data-testid-not-css |
Stable locators |
waiting-and-assertions |
expect(), async data, negative checks |
auth-storage-state |
Default auth, public pages, .no-auth-setup |
serial-vs-parallel-workers |
Workers, fullyParallel, mode: 'serial' |
shared-state-and-test-isolation |
Same org/entity, helpers, reload |
debugging-and-running-subsets |
grep, single test, parallel nx invocations |
Architecture (one diagram)
nx test:e2e app
→ nx prepare (regenerates .nuxt/playwright.config.ts)
→ webServer: build-static once + serve :4173
→ auth setup (@playwright/test, cached playwright/.auth/auth.json)
→ ADRA-tests (@nuxt/test-utils/playwright, build: false against static server)
Local config defaults (packages/testing-utilities/playwright.config.ts):
workers: WORKERS_COUNT (default 6) when static server URL is set
fullyParallel: true when server URL is set
test.describe.configure({ mode: 'serial' }) overrides — forces 1 worker for that file/group
File layout
frontends/my-app/
tests/e2e/
landing-page.test.ts # public → test.use storage reset
organizations-authenticated.test.ts
helpers/ # shared navigation/setup
.env.test:e2e # OM_TEST_ORG_ID, DPM_TEST_ORG_ID, …
.env.build-static # SENTRY_DSN, build-time vars
Repo root: .env.playwright (gitignored) for ADTESTINGAUTH_*.
Related cortex-hub skills
frontend-best-practices → testing-utilities-use-createpathhelper (short path/auth primer)
- ADRA repo rules:
.cursor/rules/e2e-testing-guide.mdc, .cursor/rules/nx-env-and-testing.mdc
Real examples in adra-frontends
| Pattern |
File |
| Public landing |
frontends/directory/tests/e2e/landing-page.test.ts |
| Authenticated list |
frontends/directory/tests/e2e/organizations-authenticated.test.ts |
| Serial + shared org + helpers |
frontends/office-manager/tests/e2e/org-contact-validation.test.ts |
| Public app (no auth setup) |
frontends/donation-page-receiver/tests/e2e/.no-auth-setup |