openspec-playwright 0.1.62 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -3
- package/README.zh-CN.md +4 -3
- package/bin/CLAUDE.md +11 -0
- package/dist/CLAUDE.md +17 -0
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.js +110 -73
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/editors.js +149 -95
- package/dist/commands/editors.js.map +1 -1
- package/dist/commands/init.js +105 -97
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcpSync.js +46 -31
- package/dist/commands/mcpSync.js.map +1 -1
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/run.js +74 -51
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/uninstall.d.ts +1 -0
- package/dist/commands/uninstall.js +133 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.js +79 -68
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +33 -26
- package/dist/index.js.map +1 -1
- package/package.json +19 -1
- package/schemas/playwright-e2e/templates/playwright.config.ts +22 -22
- package/templates/CLAUDE.md +15 -0
- package/templates/seed.spec.ts +5 -3
- package/.claude/commands/opsx/e2e-body.md +0 -39
- package/.claude/commands/opsx/e2e.md +0 -47
- package/.claude/skills/openspec-e2e/SKILL.md +0 -464
- package/.github/workflows/release.yml +0 -81
- package/docs/plans/2026-03-26-openspec-playwright-design.md +0 -180
- package/employee-standards.md +0 -44
- package/openspec/schemas/playwright-e2e/schema.yaml +0 -56
- package/openspec/schemas/playwright-e2e/templates/e2e-test.ts +0 -55
- package/openspec/schemas/playwright-e2e/templates/playwright.config.ts +0 -52
- package/openspec/schemas/playwright-e2e/templates/report.md +0 -27
- package/openspec/schemas/playwright-e2e/templates/test-plan.md +0 -24
- package/openspec-playwright-0.1.62.tgz +0 -0
- package/release-notes.md +0 -5
- package/src/commands/doctor.ts +0 -115
- package/src/commands/editors.ts +0 -606
- package/src/commands/init.ts +0 -252
- package/src/commands/mcpSync.ts +0 -160
- package/src/commands/run.ts +0 -172
- package/src/commands/update.ts +0 -192
- package/src/index.ts +0 -47
- package/tests/editors.test.ts +0 -180
- package/tsconfig.json +0 -18
- package/vitest.config.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,MAAM,EACN,WAAW,EACX,QAAQ,GACT,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,cAAc,CAAC;AAQtB,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAsB;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAElC,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,UAAU,CACzB,IAAI,CAAC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,IAAI,EAAE,CAAC,CAAC;QAC9C,MAAM,aAAa,GAAG;YACpB,cAAc;YACd,WAAW;YACX,aAAa;YACb,sBAAsB;YACtB,kBAAkB;SACnB,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;YACvC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,sDAAsD,CAAC,CACpE,CAAC;AACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
|
-
import { readFileSync } from
|
|
2
|
-
import { join, dirname } from
|
|
3
|
-
import { fileURLToPath } from
|
|
4
|
-
import { Command } from
|
|
5
|
-
import { init } from
|
|
6
|
-
import { update } from
|
|
7
|
-
import { doctor } from
|
|
8
|
-
import { run } from
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
import { join, dirname } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { init } from "./commands/init.js";
|
|
6
|
+
import { update } from "./commands/update.js";
|
|
7
|
+
import { doctor } from "./commands/doctor.js";
|
|
8
|
+
import { run } from "./commands/run.js";
|
|
9
|
+
import { uninstall } from "./commands/uninstall.js";
|
|
9
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
const pkg = JSON.parse(readFileSync(join(__dirname,
|
|
11
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
|
11
12
|
const program = new Command();
|
|
12
13
|
program
|
|
13
|
-
.name(
|
|
14
|
-
.description(
|
|
14
|
+
.name("openspec-pw")
|
|
15
|
+
.description("OpenSpec + Playwright E2E verification setup tool")
|
|
15
16
|
.version(pkg.version);
|
|
16
17
|
program
|
|
17
|
-
.command(
|
|
18
|
-
.description(
|
|
19
|
-
.option(
|
|
20
|
-
.option(
|
|
21
|
-
.option(
|
|
18
|
+
.command("init")
|
|
19
|
+
.description("Initialize OpenSpec + Playwright E2E integration in the current project")
|
|
20
|
+
.option("-c, --change <name>", "default change name", "default")
|
|
21
|
+
.option("--no-mcp", "skip Playwright MCP configuration")
|
|
22
|
+
.option("--no-seed", "skip seed test generation")
|
|
22
23
|
.action(init);
|
|
23
24
|
program
|
|
24
|
-
.command(
|
|
25
|
-
.description(
|
|
25
|
+
.command("doctor")
|
|
26
|
+
.description("Check if all prerequisites are installed")
|
|
27
|
+
.option("--json", "Output results as JSON")
|
|
26
28
|
.action(doctor);
|
|
27
29
|
program
|
|
28
|
-
.command(
|
|
29
|
-
.description(
|
|
30
|
-
.option(
|
|
31
|
-
.option(
|
|
30
|
+
.command("update")
|
|
31
|
+
.description("Update the CLI tool and skill to the latest version")
|
|
32
|
+
.option("--no-cli", "skip CLI update")
|
|
33
|
+
.option("--no-skill", "skip skill/command update")
|
|
32
34
|
.action(update);
|
|
33
35
|
program
|
|
34
|
-
.command(
|
|
35
|
-
.description(
|
|
36
|
-
.option(
|
|
37
|
-
.option(
|
|
36
|
+
.command("run <change-name>")
|
|
37
|
+
.description("Run Playwright E2E tests for an OpenSpec change")
|
|
38
|
+
.option("-p, --project <name>", "Playwright project to run (e.g., user, admin)")
|
|
39
|
+
.option("-t, --timeout <seconds>", "Test timeout in seconds", "300")
|
|
40
|
+
.option("--json", "Output results as JSON")
|
|
38
41
|
.action(run);
|
|
42
|
+
program
|
|
43
|
+
.command("uninstall")
|
|
44
|
+
.description("Remove OpenSpec + Playwright E2E integration from the current project")
|
|
45
|
+
.action(uninstall);
|
|
39
46
|
program.parse();
|
|
40
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,IA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AAErB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openspec-playwright",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.63",
|
|
4
4
|
"description": "OpenSpec + Playwright E2E verification setup tool for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"lint": "eslint src/ tests/",
|
|
13
|
+
"lint:fix": "eslint src/ tests/ --fix",
|
|
14
|
+
"format": "prettier --write src/ tests/",
|
|
11
15
|
"test": "vitest",
|
|
12
16
|
"test:run": "vitest run",
|
|
17
|
+
"test:smoke": "npm run build && vitest run tests/smoke.test.ts",
|
|
13
18
|
"prepublishOnly": "npm run build",
|
|
14
19
|
"release": "npm version patch && npm run build && git push && git push --tags && npm publish"
|
|
15
20
|
},
|
|
@@ -21,12 +26,25 @@
|
|
|
21
26
|
},
|
|
22
27
|
"devDependencies": {
|
|
23
28
|
"@types/node": "^22.0.0",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
30
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
31
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
32
|
+
"eslint": "^10.1.0",
|
|
33
|
+
"prettier": "^3.8.1",
|
|
24
34
|
"typescript": "^5.6.0",
|
|
25
35
|
"vitest": "^4.1.2"
|
|
26
36
|
},
|
|
27
37
|
"engines": {
|
|
28
38
|
"node": ">=20"
|
|
29
39
|
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"bin",
|
|
43
|
+
"templates",
|
|
44
|
+
"schemas",
|
|
45
|
+
"README.md",
|
|
46
|
+
"README.zh-CN.md"
|
|
47
|
+
],
|
|
30
48
|
"keywords": [
|
|
31
49
|
"openspec",
|
|
32
50
|
"playwright",
|
|
@@ -15,30 +15,30 @@ function findProjectRoot(start: string): string {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// ─── Find the npm project root (where package.json with scripts lives) ───
|
|
18
|
-
//
|
|
19
|
-
function findNpmRoot(projectRoot: string): string {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
const entries = readdirSync(projectRoot, { withFileTypes: true });
|
|
30
|
-
for (const entry of entries) {
|
|
31
|
-
if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name === 'node_modules') continue;
|
|
32
|
-
const subPkg = join(projectRoot, entry.name, 'package.json');
|
|
33
|
-
if (existsSync(subPkg)) {
|
|
34
|
-
const sub = JSON.parse(readFileSync(subPkg, 'utf-8'));
|
|
35
|
-
if (sub.scripts?.dev || sub.scripts?.start) {
|
|
36
|
-
return join(projectRoot, entry.name);
|
|
18
|
+
// Searches recursively up to maxDepth levels to support nested monorepos
|
|
19
|
+
function findNpmRoot(projectRoot: string, maxDepth = 5): string {
|
|
20
|
+
function search(dir: string, depth: number): string | null {
|
|
21
|
+
if (depth > maxDepth) return null;
|
|
22
|
+
const pkgPath = join(dir, 'package.json');
|
|
23
|
+
if (existsSync(pkgPath)) {
|
|
24
|
+
try {
|
|
25
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
26
|
+
if (pkg.scripts?.dev || pkg.scripts?.start || pkg.scripts?.serve || pkg.scripts?.preview) {
|
|
27
|
+
return dir;
|
|
37
28
|
}
|
|
38
|
-
}
|
|
29
|
+
} catch {}
|
|
39
30
|
}
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
try {
|
|
32
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name === 'node_modules') continue;
|
|
35
|
+
const found = search(join(dir, entry.name), depth + 1);
|
|
36
|
+
if (found) return found;
|
|
37
|
+
}
|
|
38
|
+
} catch {}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return search(projectRoot, 0) ?? projectRoot;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const projectRoot = findProjectRoot(__dirname);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<claude-mem-context>
|
|
2
|
+
# Recent Activity
|
|
3
|
+
|
|
4
|
+
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
|
|
5
|
+
|
|
6
|
+
### Mar 27, 2026
|
|
7
|
+
|
|
8
|
+
| ID | Time | T | Title | Read |
|
|
9
|
+
|----|------|---|-------|------|
|
|
10
|
+
| #5522 | 11:25 AM | 🔵 | Playwright auth setup template supports API and UI login | ~261 |
|
|
11
|
+
| #5514 | 11:22 AM | 🟣 | Created credentials.yaml template for E2E test authentication | ~227 |
|
|
12
|
+
| #5513 | " | 🟣 | Created auth.setup.ts template for Playwright Test Agents | ~276 |
|
|
13
|
+
| #5390 | 9:48 AM | 🔄 | Refactored openspec-playwright from CLI to setup tool + Claude Code skill | ~209 |
|
|
14
|
+
| #5375 | 9:44 AM | 🟣 | Created Playwright seed test template | ~224 |
|
|
15
|
+
</claude-mem-context>
|
package/templates/seed.spec.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copy this to tests/playwright/seed.spec.ts after running openspec-pw init
|
|
3
3
|
// Customize the page object and base URL for your application
|
|
4
4
|
|
|
5
|
-
import { test, expect, Page } from '@playwright/test';
|
|
5
|
+
import { test, expect, Page, ConsoleMessage } from '@playwright/test';
|
|
6
6
|
import { existsSync } from 'fs';
|
|
7
7
|
|
|
8
8
|
// Customize these for your application
|
|
@@ -49,11 +49,13 @@ test.describe('Application smoke tests', () => {
|
|
|
49
49
|
|
|
50
50
|
test('no console errors', async ({ page }) => {
|
|
51
51
|
const errors: string[] = [];
|
|
52
|
-
|
|
52
|
+
const handler = (msg: ConsoleMessage) => {
|
|
53
53
|
if (msg.type() === 'error') {
|
|
54
54
|
errors.push(msg.text());
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
|
+
page.on('console', handler);
|
|
58
|
+
test.afterEach(() => page.off('console', handler));
|
|
57
59
|
await page.reload();
|
|
58
60
|
await page.waitForLoadState('networkidle');
|
|
59
61
|
// Filter out known non-critical errors
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
Run Playwright E2E verification for an OpenSpec change.
|
|
2
|
-
|
|
3
|
-
## Workflow
|
|
4
|
-
|
|
5
|
-
1. **Validate environment**: Run the seed test to confirm your app is reachable.
|
|
6
|
-
```bash
|
|
7
|
-
npx playwright test tests/playwright/seed.spec.ts --project=chromium
|
|
8
|
-
```
|
|
9
|
-
If it fails, fix your BASE_URL or start the dev server first.
|
|
10
|
-
|
|
11
|
-
2. **Select the change**: If no change name is provided, run `openspec list --json` and pick one. Then announce: "Using change: `<name>`".
|
|
12
|
-
|
|
13
|
-
3. **Read specs**: Read all files from `openspec/changes/<name>/specs/*.md`.
|
|
14
|
-
|
|
15
|
-
4. **Detect auth**: Check if specs mention login, protected routes, or session handling. See `tests/playwright/auth.setup.ts` for auth setup.
|
|
16
|
-
|
|
17
|
-
5. **Generate test plan**: Create `openspec/changes/<name>/specs/playwright/test-plan.md` listing each test case with `@auth(required|none)` and `@role(...)` tags. Skip if already exists.
|
|
18
|
-
|
|
19
|
-
6. **Generate tests**: Write `tests/playwright/<name>.spec.ts` from the test plan. Follow the patterns in `seed.spec.ts`:
|
|
20
|
-
- Prefer `data-testid`, fallback to `getByRole`, `getByLabel`, `getByText`
|
|
21
|
-
- Include happy path AND error/edge cases
|
|
22
|
-
- Never use conditional `if (isVisible())` — always use `expect().toBeVisible()` (false-pass anti-pattern)
|
|
23
|
-
- Use `browser.newContext()` for auth guard tests (fresh session, no cookies)
|
|
24
|
-
|
|
25
|
-
7. **Run tests**:
|
|
26
|
-
```bash
|
|
27
|
-
openspec-pw run <change-name>
|
|
28
|
-
```
|
|
29
|
-
Or with role filtering:
|
|
30
|
-
```bash
|
|
31
|
-
npx playwright test tests/playwright/<name>.spec.ts --grep "@<role>"
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
8. **Fix failures**: If tests fail, analyze the error:
|
|
35
|
-
- Network/backend error → `test.skip()` + report
|
|
36
|
-
- Selector changed → use Playwright MCP tools to find equivalent selectors, fix, re-run
|
|
37
|
-
- Auto-heal up to 3 attempts
|
|
38
|
-
|
|
39
|
-
9. **Report**: Results are saved to `openspec/reports/playwright-e2e-<name>-<timestamp>.md`. Present the summary table to the user.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "OPSX: E2E"
|
|
3
|
-
description: Run Playwright E2E verification for an OpenSpec change
|
|
4
|
-
category: OpenSpec
|
|
5
|
-
tags: [openspec, playwright, e2e, testing]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Run Playwright E2E verification for an OpenSpec change.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
|
|
12
|
-
1. **Validate environment**: Run the seed test to confirm your app is reachable.
|
|
13
|
-
```bash
|
|
14
|
-
npx playwright test tests/playwright/seed.spec.ts --project=chromium
|
|
15
|
-
```
|
|
16
|
-
If it fails, fix your BASE_URL or start the dev server first.
|
|
17
|
-
|
|
18
|
-
2. **Select the change**: If no change name is provided, run `openspec list --json` and pick one. Then announce: "Using change: `<name>`".
|
|
19
|
-
|
|
20
|
-
3. **Read specs**: Read all files from `openspec/changes/<name>/specs/*.md`.
|
|
21
|
-
|
|
22
|
-
4. **Detect auth**: Check if specs mention login, protected routes, or session handling. See `tests/playwright/auth.setup.ts` for auth setup.
|
|
23
|
-
|
|
24
|
-
5. **Generate test plan**: Create `openspec/changes/<name>/specs/playwright/test-plan.md` listing each test case with `@auth(required|none)` and `@role(...)` tags. Skip if already exists.
|
|
25
|
-
|
|
26
|
-
6. **Generate tests**: Write `tests/playwright/<name>.spec.ts` from the test plan. Follow the patterns in `seed.spec.ts`:
|
|
27
|
-
- Prefer `data-testid`, fallback to `getByRole`, `getByLabel`, `getByText`
|
|
28
|
-
- Include happy path AND error/edge cases
|
|
29
|
-
- Never use conditional `if (isVisible())` — always use `expect().toBeVisible()` (false-pass anti-pattern)
|
|
30
|
-
- Use `browser.newContext()` for auth guard tests (fresh session, no cookies)
|
|
31
|
-
|
|
32
|
-
7. **Run tests**:
|
|
33
|
-
```bash
|
|
34
|
-
openspec-pw run <change-name>
|
|
35
|
-
```
|
|
36
|
-
Or with role filtering:
|
|
37
|
-
```bash
|
|
38
|
-
npx playwright test tests/playwright/<name>.spec.ts --grep "@<role>"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
8. **Fix failures**: If tests fail, analyze the error:
|
|
42
|
-
- Network/backend error → `test.skip()` + report
|
|
43
|
-
- Selector changed → use Playwright MCP tools to find equivalent selectors, fix, re-run
|
|
44
|
-
- Auto-heal up to 3 attempts
|
|
45
|
-
|
|
46
|
-
9. **Report**: Results are saved to `openspec/reports/playwright-e2e-<name>-<timestamp>.md`. Present the summary table to the user.
|
|
47
|
-
|