openspec-playwright 0.1.16

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.
Files changed (38) hide show
  1. package/.claude/commands/opsx/e2e.md +8 -0
  2. package/.claude/skills/openspec-e2e/SKILL.md +138 -0
  3. package/.github/workflows/release.yml +41 -0
  4. package/README.md +133 -0
  5. package/README.zh-CN.md +118 -0
  6. package/bin/openspec-pw +4 -0
  7. package/bin/openspec-pw.js +2 -0
  8. package/dist/commands/doctor.d.ts +1 -0
  9. package/dist/commands/doctor.js +110 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/init.d.ts +6 -0
  12. package/dist/commands/init.js +174 -0
  13. package/dist/commands/init.js.map +1 -0
  14. package/dist/commands/run.d.ts +5 -0
  15. package/dist/commands/run.js +135 -0
  16. package/dist/commands/run.js.map +1 -0
  17. package/dist/commands/update.d.ts +5 -0
  18. package/dist/commands/update.js +91 -0
  19. package/dist/commands/update.js.map +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +40 -0
  22. package/dist/index.js.map +1 -0
  23. package/docs/plans/2026-03-26-openspec-playwright-design.md +180 -0
  24. package/package.json +39 -0
  25. package/schemas/playwright-e2e/schema.yaml +56 -0
  26. package/schemas/playwright-e2e/templates/e2e-test.ts +55 -0
  27. package/schemas/playwright-e2e/templates/playwright.config.ts +52 -0
  28. package/schemas/playwright-e2e/templates/report.md +27 -0
  29. package/schemas/playwright-e2e/templates/test-plan.md +24 -0
  30. package/src/commands/doctor.ts +114 -0
  31. package/src/commands/init.ts +209 -0
  32. package/src/commands/run.ts +172 -0
  33. package/src/commands/update.ts +130 -0
  34. package/src/index.ts +47 -0
  35. package/templates/auth.setup.ts +77 -0
  36. package/templates/credentials.yaml +33 -0
  37. package/templates/seed.spec.ts +63 -0
  38. package/tsconfig.json +18 -0
@@ -0,0 +1,63 @@
1
+ // Seed test for Playwright Test Agents
2
+ // Copy this to tests/playwright/seed.spec.ts after running openspec-pw init
3
+ // Customize the page object and base URL for your application
4
+
5
+ import { test, expect, Page } from '@playwright/test';
6
+
7
+ // Customize these for your application
8
+ const BASE_URL = process.env.BASE_URL || 'http://localhost:3000';
9
+
10
+ /**
11
+ * Page Object Pattern - customize these selectors for your app
12
+ */
13
+ class AppPage {
14
+ constructor(private page: Page) {}
15
+
16
+ async goto(path: string = '/') {
17
+ await this.page.goto(`${BASE_URL}${path}`);
18
+ }
19
+
20
+ // Add your app's common selectors here
21
+ // Example:
22
+ // async getLoginButton() {
23
+ // return this.page.locator('button[data-testid="login"]');
24
+ // }
25
+ }
26
+
27
+ /**
28
+ * Helper to create a new page object
29
+ */
30
+ function createPage(page: Page): AppPage {
31
+ return new AppPage(page);
32
+ }
33
+
34
+ // ──────────────────────────────────────────────
35
+ // Below are example tests - customize for your app
36
+ // ──────────────────────────────────────────────
37
+
38
+ test.describe('Application smoke tests', () => {
39
+ test.beforeEach(async ({ page }) => {
40
+ const app = createPage(page);
41
+ await app.goto('/');
42
+ });
43
+
44
+ test('page loads successfully', async ({ page }) => {
45
+ // Verify the page loads without errors
46
+ await expect(page).not.toHaveURL(/.*error.*/);
47
+ });
48
+
49
+ test('no console errors', async ({ page }) => {
50
+ const errors: string[] = [];
51
+ page.on('console', (msg) => {
52
+ if (msg.type() === 'error') {
53
+ errors.push(msg.text());
54
+ }
55
+ });
56
+ await page.reload();
57
+ // Filter out known non-critical errors
58
+ const criticalErrors = errors.filter(
59
+ (e) => !e.includes('favicon') && !e.includes('404')
60
+ );
61
+ expect(criticalErrors).toHaveLength(0);
62
+ });
63
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "declaration": true,
13
+ "sourceMap": true,
14
+ "types": ["node"]
15
+ },
16
+ "include": ["src/**/*"],
17
+ "exclude": ["node_modules", "dist", "templates", ".claude"]
18
+ }