@assertrx/dino 1.0.0
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/README.md +293 -0
- package/extensions/dino.ts +70 -0
- package/extensions/mabl-mcp.ts +306 -0
- package/extensions/playwright-mcp.ts +142 -0
- package/package.json +47 -0
- package/prompts/create-pr.md +110 -0
- package/prompts/generate-bdd-from-url.md +65 -0
- package/prompts/generate-pom-from-url-cli.md +48 -0
- package/prompts/generate-pom-from-url.md +45 -0
- package/prompts/generate-spec-from-feature.md +64 -0
- package/prompts/heal-playwright-failures.md +106 -0
- package/prompts/setup-playwright.md +81 -0
- package/scripts/start-dino.cmd +8 -0
- package/scripts/start-dino.mjs +226 -0
- package/scripts/start-dino.ps1 +9 -0
- package/scripts/start-dino.sh +10 -0
- package/skills/acli/SKILL.md +292 -0
- package/skills/bdd-gherkin/SKILL.md +552 -0
- package/skills/build-review-interface/SKILL.md +96 -0
- package/skills/error-analysis/SKILL.md +164 -0
- package/skills/eval-audit/SKILL.md +183 -0
- package/skills/evaluate-rag/SKILL.md +177 -0
- package/skills/generate-synthetic-data/SKILL.md +131 -0
- package/skills/mabl-mcp/SKILL.md +79 -0
- package/skills/playwright-cli/SKILL.md +246 -0
- package/skills/playwright-cli/advanced-workflows.md +679 -0
- package/skills/playwright-cli/core-commands.md +375 -0
- package/skills/playwright-cli/device-emulation.md +475 -0
- package/skills/playwright-cli/request-mocking.md +373 -0
- package/skills/playwright-cli/running-custom-code.md +553 -0
- package/skills/playwright-cli/screenshots-and-media.md +457 -0
- package/skills/playwright-cli/session-management.md +425 -0
- package/skills/playwright-cli/storage-and-auth.md +487 -0
- package/skills/playwright-cli/test-generation.md +336 -0
- package/skills/playwright-cli/tracing-and-debugging.md +501 -0
- package/skills/playwright-core/SKILL.md +101 -0
- package/skills/playwright-core/accessibility.md +1517 -0
- package/skills/playwright-core/angular.md +1086 -0
- package/skills/playwright-core/api-testing.md +1623 -0
- package/skills/playwright-core/assertions-and-waiting.md +703 -0
- package/skills/playwright-core/auth-flows.md +1081 -0
- package/skills/playwright-core/authentication.md +1409 -0
- package/skills/playwright-core/browser-apis.md +673 -0
- package/skills/playwright-core/browser-extensions.md +319 -0
- package/skills/playwright-core/canvas-and-webgl.md +494 -0
- package/skills/playwright-core/clock-and-time-mocking.md +427 -0
- package/skills/playwright-core/common-pitfalls.md +1318 -0
- package/skills/playwright-core/component-testing.md +1179 -0
- package/skills/playwright-core/configuration.md +731 -0
- package/skills/playwright-core/crud-testing.md +945 -0
- package/skills/playwright-core/debugging.md +827 -0
- package/skills/playwright-core/drag-and-drop.md +992 -0
- package/skills/playwright-core/electron-testing.md +622 -0
- package/skills/playwright-core/error-and-edge-cases.md +1181 -0
- package/skills/playwright-core/error-index.md +1903 -0
- package/skills/playwright-core/file-operations.md +749 -0
- package/skills/playwright-core/file-upload-download.md +1012 -0
- package/skills/playwright-core/fixtures-and-hooks.md +1072 -0
- package/skills/playwright-core/flaky-tests.md +883 -0
- package/skills/playwright-core/forms-and-validation.md +1056 -0
- package/skills/playwright-core/i18n-and-localization.md +622 -0
- package/skills/playwright-core/iframes-and-shadow-dom.md +488 -0
- package/skills/playwright-core/locator-strategy.md +588 -0
- package/skills/playwright-core/locators.md +743 -0
- package/skills/playwright-core/mobile-and-responsive.md +1669 -0
- package/skills/playwright-core/multi-context-and-popups.md +581 -0
- package/skills/playwright-core/multi-user-and-collaboration.md +477 -0
- package/skills/playwright-core/network-mocking.md +1395 -0
- package/skills/playwright-core/nextjs.md +1013 -0
- package/skills/playwright-core/performance-testing.md +608 -0
- package/skills/playwright-core/react.md +1082 -0
- package/skills/playwright-core/search-and-filter.md +1366 -0
- package/skills/playwright-core/security-testing.md +624 -0
- package/skills/playwright-core/service-workers-and-pwa.md +524 -0
- package/skills/playwright-core/test-architecture.md +569 -0
- package/skills/playwright-core/test-data-management.md +1209 -0
- package/skills/playwright-core/test-organization.md +947 -0
- package/skills/playwright-core/third-party-integrations.md +754 -0
- package/skills/playwright-core/trace-analysis.md +161 -0
- package/skills/playwright-core/visual-regression.md +1027 -0
- package/skills/playwright-core/vue.md +1162 -0
- package/skills/playwright-core/websockets-and-realtime.md +623 -0
- package/skills/playwright-core/when-to-mock.md +827 -0
- package/skills/playwright-pom/SKILL.md +94 -0
- package/skills/playwright-pom/page-object-model.md +921 -0
- package/skills/playwright-pom/pom-vs-fixtures-vs-helpers.md +937 -0
- package/skills/validate-evaluator/SKILL.md +215 -0
- package/skills/write-judge-prompt/SKILL.md +144 -0
- package/themes/dino.json +66 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playwright-pom
|
|
3
|
+
description: Page Object Model patterns for Playwright — when to use POM, how to structure page objects, and when fixtures or helpers are a better fit.
|
|
4
|
+
author: Anand Gopalakrishnan
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Playwright Page Object Model
|
|
8
|
+
|
|
9
|
+
> Structure your test code for maintainability — know when POM helps and when simpler patterns win.
|
|
10
|
+
|
|
11
|
+
**2 guides** covering Page Object Model implementation and the decision framework for choosing between POM, fixtures, and helpers.
|
|
12
|
+
|
|
13
|
+
## Guide Index
|
|
14
|
+
|
|
15
|
+
| Topic | Guide |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Page Object Model patterns | [page-object-model.md](page-object-model.md) |
|
|
18
|
+
| POM vs fixtures vs helpers | [pom-vs-fixtures-vs-helpers.md](pom-vs-fixtures-vs-helpers.md) |
|
|
19
|
+
|
|
20
|
+
## Generating POMs with Playwright MCP
|
|
21
|
+
|
|
22
|
+
If the project has the Playwright MCP extension loaded, the `browser_*` tools are available for live page inspection. Use them to generate accurate, up-to-date page objects directly from a running application.
|
|
23
|
+
|
|
24
|
+
### When to use MCP for POM generation
|
|
25
|
+
|
|
26
|
+
- The user asks for a POM for an existing page or URL.
|
|
27
|
+
- The page is accessible (localhost, staging, or production the user owns/controls).
|
|
28
|
+
- The agent needs real element names, roles, test IDs, or ARIA labels to write resilient locators.
|
|
29
|
+
|
|
30
|
+
### MCP-driven POM workflow
|
|
31
|
+
|
|
32
|
+
1. **Navigate**: Use `browser_navigate` with the target URL.
|
|
33
|
+
2. **Inspect**: Use `browser_snapshot` to get the accessibility tree of the current page.
|
|
34
|
+
3. **Analyze**: Identify page sections, repeated components, and user-facing actions from the snapshot.
|
|
35
|
+
4. **Generate**: Create a page object class/module that exposes:
|
|
36
|
+
- Locators derived from `getByRole`, `getByLabel`, `getByTestId`, etc.
|
|
37
|
+
- High-level business methods that combine actions and assertions (e.g., `loginAs(user)`).
|
|
38
|
+
5. **Refine**: If needed, use `browser_click`, `browser_type`, or `browser_find` to verify interactions before finalizing the POM.
|
|
39
|
+
|
|
40
|
+
### Rules
|
|
41
|
+
|
|
42
|
+
- **Do not use MCP against pages the user does not own or have explicit authorization to test.**
|
|
43
|
+
- Prefer resilient locators (`getByRole`, `getByLabel`, `getByTestId`) over CSS selectors or XPath.
|
|
44
|
+
- Keep the page object focused on **one page or one reusable component**.
|
|
45
|
+
- Move implementation details (selectors, URLs) into the page object; tests should read like user workflows.
|
|
46
|
+
- If MCP is not available, fall back to the static guidance in [page-object-model.md](page-object-model.md).
|
|
47
|
+
|
|
48
|
+
### Example interaction
|
|
49
|
+
|
|
50
|
+
**User:** "Generate a POM for the login page at http://localhost:3000/login"
|
|
51
|
+
|
|
52
|
+
**Agent steps:**
|
|
53
|
+
1. Call `browser_navigate` with `url: "http://localhost:3000/login"`.
|
|
54
|
+
2. Call `browser_snapshot` to capture the accessibility tree.
|
|
55
|
+
3. From the snapshot, identify elements such as:
|
|
56
|
+
- email input (`getByLabel('Email')`)
|
|
57
|
+
- password input (`getByLabel('Password')`)
|
|
58
|
+
- submit button (`getByRole('button', { name: 'Sign in' })`)
|
|
59
|
+
- error message region (`getByRole('alert')`)
|
|
60
|
+
4. Generate:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
export class LoginPage {
|
|
64
|
+
constructor(private readonly page: Page) {}
|
|
65
|
+
|
|
66
|
+
emailInput = () => this.page.getByLabel('Email');
|
|
67
|
+
passwordInput = () => this.page.getByLabel('Password');
|
|
68
|
+
signInButton = () => this.page.getByRole('button', { name: 'Sign in' });
|
|
69
|
+
errorMessage = () => this.page.getByRole('alert');
|
|
70
|
+
|
|
71
|
+
async login(email: string, password: string) {
|
|
72
|
+
await this.emailInput().fill(email);
|
|
73
|
+
await this.passwordInput().fill(password);
|
|
74
|
+
await this.signInButton().click();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async expectError(message: string) {
|
|
78
|
+
await expect(this.errorMessage()).toContainText(message);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## When POM is the right choice
|
|
84
|
+
|
|
85
|
+
- The page has multiple tests that interact with the same elements.
|
|
86
|
+
- The page has complex interactions that would clutter tests.
|
|
87
|
+
- The page is stable enough that maintaining selectors is worthwhile.
|
|
88
|
+
- Multiple team members need to read or write tests against the same page.
|
|
89
|
+
|
|
90
|
+
## When fixtures or helpers are better
|
|
91
|
+
|
|
92
|
+
- The page is simple and only used in one or two tests.
|
|
93
|
+
- The interaction is a small, reusable utility (e.g., fill a credit-card form).
|
|
94
|
+
- You want to compose behavior across pages without creating a class hierarchy.
|