Skip to content

Commit 06b77c7

Browse files
committed
fix: update all end-user templates for WTR + Playwright test stack
Updated CONVENTIONS.md (browser test section, test matrix table), .cursorrules, .windsurfrules, copilot-instructions.md to reference WTR + Playwright instead of Puppeteer/E2E. Removed stale WEBJS_E2E references.
1 parent 1ce3888 commit 06b77c7

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

packages/cli/templates/.cursorrules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Quality bar stays the same — just no blocking on questions.
2727

2828
## Mandatory workflow (never skip)
2929

30-
1. TESTS: Every code change must include unit tests (test/unit/) and E2E
31-
tests (test/e2e/) for user-facing features. Run `npx webjs test` after
32-
every change. Never deliver code without passing tests.
30+
1. TESTS: Server tests in test/unit/ (node:test), browser tests in
31+
test/browser/ (WTR + Playwright, real Chromium). Run `npx webjs test`
32+
after every change. Never deliver code without passing tests.
3333

3434
2. DOCS: Update AGENTS.md for API changes. Update docs/ and website/ if
3535
they exist. The user should never have to ask for tests or docs.

packages/cli/templates/.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ If running without interactive approval (sandbox, auto-approve, etc.):
2424
Every code change must include:
2525
1. Commit and push — COMMIT AND PUSH after each logical unit of work.
2626
Always `git push` after committing. Don't accumulate changes. Automatic.
27-
2. Unit tests in test/unit/*.test.ts (server actions, components, utilities)
28-
3. E2E tests in test/e2e/*.test.ts for user-facing features (Puppeteer)
27+
2. Server tests in test/unit/*.test.ts (node:test for actions, queries, utilities)
28+
3. Browser tests in test/browser/*.test.js (WTR + Playwright, real Chromium)
2929
4. Documentation updates (AGENTS.md for API, docs/ for user guides)
3030
5. Convention validation: `npx webjs check` must pass
3131

packages/cli/templates/.windsurfrules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Quality bar stays the same — no blocking on questions.
2323
## Mandatory workflow (never skip)
2424

2525
Every code change must include:
26-
1. Unit tests in test/unit/*.test.ts
27-
2. E2E tests in test/e2e/*.test.ts for user-facing features
26+
1. Server tests in test/unit/*.test.ts (node:test)
27+
2. Browser tests in test/browser/*.test.js (WTR + Playwright, real Chromium)
2828
3. Documentation updates (AGENTS.md, docs/, website/ if they exist)
2929
4. Convention check: `npx webjs check` must pass
3030

packages/cli/templates/CONVENTIONS.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,28 +141,28 @@ test/
141141

142142
**Naming:** `test/unit/<module-name>.test.ts` (e.g., `test/unit/auth.test.ts`)
143143

144-
### E2E tests — `test/browser/`
144+
### Browser tests — `test/browser/`
145145

146146
```
147147
test/
148-
e2e/
149-
<feature>.test.ts Browser-level tests per feature
148+
browser/
149+
<feature>.test.js Real-browser tests per feature
150150
```
151151

152-
- Run with: `WEBJS_E2E=1 webjs test` or `WEBJS_E2E=1 node --test test/browser/*.test.ts`
153-
- Use WTR + Playwright for browser automation
154-
- Test full user flows: navigation, form submission, auth, real-time features
155-
- Each test file starts the dev server, runs tests, tears down
152+
- Run with: `webjs test --browser` or `npx wtr`
153+
- Uses **Web Test Runner (WTR) + Playwright** — tests run in real Chromium
154+
- Full Shadow DOM, events, adoptedStyleSheets, IntersectionObserver
155+
- Test components, user interactions, navigation, form submission
156156

157-
**Naming:** `test/browser/<feature>.test.ts` (e.g., `test/browser/auth-flow.test.ts`)
157+
**Naming:** `test/browser/<feature>.test.js` (e.g., `test/browser/auth.test.js`)
158158

159159
### When to write tests
160160

161-
| Change | Unit test | E2E test |
162-
|--------|-----------|----------|
163-
| New server action | Required | Optional |
164-
| New component | Required (SSR output) | If interactive |
165-
| New page/route | Optional | Required |
161+
| Change | Server test (node:test) | Browser test (WTR) |
162+
|--------|------------------------|-------------------|
163+
| New server action | Required | |
164+
| New component | Required (SSR output) | Required (interaction) |
165+
| New page/route | | Required |
166166
| Bug fix | Required (regression) | If user-facing |
167167
| Refactor | Existing tests must pass | Existing tests must pass |
168168

0 commit comments

Comments
 (0)