End-to-end testing patterns with Playwright for full-stack Python/React applications.
Works with
Covers test structure, page object model, selector strategy (data-testid > role > label), and wait strategies for reliable cross-browser testing
Includes auth state reuse to avoid repeated logins, test data management via API helpers, and debugging techniques for flaky tests
Provides CI integration examples, fixture setup for authentication, and naming conventions for tests, pages, and locators
S
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versione2e-testingExecute the skills CLI command in your project's root directory to begin installation:
Fetches e2e-testing from hieutrtr/ai1-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate e2e-testing. Access via /e2e-testing in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
8
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
8
stars
Activate this skill when:
Do NOT use this skill for:
react-testing-patterns)pytest-patterns)tdd-workflow)pytest-patterns with httpx)e2e/
├── playwright.config.ts # Global Playwright configuration
├── fixtures/
│ ├── auth.fixture.ts # Authentication state setup
│ └── test-data.fixture.ts # Test data creation/cleanup
├── pages/
│ ├── base.page.ts # Base page object with shared methods
│ ├── login.page.ts # Login page object
│ ├── users.page.ts # Users list page object
│ └── user-detail.page.ts # User detail page object
├── tests/
│ ├── auth/
│ │ ├── login.spec.ts
│ │ └── logout.spec.ts
│ ├── users/
│ │ ├── create-user.spec.ts
│ │ ├── edit-user.spec.ts
│ │ └── list-users.spec.ts
│ └── smoke/
│ └── critical-paths.spec.ts
└── utils/
├── api-helpers.ts # Direct API calls for test setup
└── test-constants.ts # Shared constants
Naming conventions:
<feature>.spec.ts<page-name>.page.ts<concern>.fixture.tsEvery page gets a page object class that encapsulates selectors and actions. Tests never interact with selectors directly.
Base page object:
// e2e/pages/base.page.ts
import { type Page, type Locator } from "@playwright/test";
export abstract class BasePage {
constructor(protected readonly page: Page) {}
/** Navigate to the page's URL. */
abstract goto(): Promise<void>;
/** Wait for the page to be fully loaded. */
async waitForLoad(): Promise<void> {
await this.page.waitForLoadState("networkidle");
}
/** Get a toast/notification message. */
get toast(): Locator {
return this.page.getByRole("alert");
}
/** Get the page heading. */
get heading(): Locator {
return this.page.getByRole("heading", { level: 1 });
}
}
Concrete page object:
// e2e/pages/users.page.ts
import { type Page, type Locator } from "@playwright/test";
import { BasePage } from "./base.page";
export class UsersPage extends BasePage {
// ─── Locators ─────────────────────────────────────────
readonly createButton: Locator;
readonly searchInput: Locator;
readonly userTable: Locator;
constructor(page: Page) {
super(page);
this.createButton = page.getByTestId("create-user-btn");
this.searchInput = page.getByRole("searchbox", { name: /search users/i });
this.userTable = page.getByRole("table");
}
// ─── Actions ──────────────────────────────────────────
async goto(): Promise<void> {
await this.page.goto("/users");
await this.waitForLoad();
}
async searchFor(query: string): Promise<void> {
await this.searchInput.fill(query);
// Wait for search results to update (debounced)
await this.page.waitForResponse("**/api/v1/users?*");
}
async clickCreateUser(): Promise<void> {
await this.createButton.click();
}
async getUserRow(email: string): Promise<Locator> {
return this.userTable.getByRole("row").filter({ hasText: email });
}
async getUserCount(): Promise<number> {
// Subtract 1 for header row
return (await this.userTable.getByRole("row").count()) - 1;
}
}
Rules for page objects:
Priority order (highest to lowest):
| Priority | Selector | Example | When to Use |
|---|---|---|---|
| 1 | data-testid |
getByTestId("submit-btn") |
Interactive elements, dynamic content |
| 2 | Role | getByRole("button", { name: /save/i }) |
Buttons, links, headings, inputs |
| 3 | Label | getByLabel("Email") |
Form inputs with labels |
| 4 | Placeholder | getByPlaceholder("Search...") |
Search inputs |
| 5 | Text | getByText("Welcome back") |
Static text content |
NEVER use:
.class-name, #id) -- brittle, break on styling changes//div[@class="foo"]) -- unreadable, extremely brittlediv > span:nth-child(2)) -- break on layout changesAdding data-testid attributes:
// In React components -- add data-testid to interactive elements
<button data-testid="create-user-btn" onClick={handleCreate}>
Create User
</button>
// Convention: kebab-case, descriptive
// Pattern: <action>-<entity>-<element-type>
// Examples: create-user-btn, user-email-input, delete-confirm-dialog
NEVER use hardcoded waits:
// BAD: Hardcoded wait -- flaky, slow
await page.waitForTimeout(3000);
// BAD: Sleep
await new Promise((resolve) => setTimeout(resolve, 2000));
Use explicit wait conditions:
// GOOD: Wait for a specific element to appear
await page.getByRole("heading"<Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
github/awesome-copilot
aj-geddes/useful-ai-prompts
refoundai/lenny-skills
skillcreatorai/ai-agent-skills
supercent-io/skills-template
davila7/claude-code-templates
e2e-testing is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Keeps context tight: e2e-testing is the kind of skill you can hand to a new teammate without a long onboarding doc.
e2e-testing has been reliable in day-to-day use. Documentation quality is above average for community skills.
e2e-testing fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
e2e-testing has been reliable in day-to-day use. Documentation quality is above average for community skills.
e2e-testing reduced setup friction for our internal harness; good balance of opinion and flexibility.
I recommend e2e-testing for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Registry listing for e2e-testing matched our evaluation — installs cleanly and behaves as described in the markdown.
Keeps context tight: e2e-testing is the kind of skill you can hand to a new teammate without a long onboarding doc.
We added e2e-testing from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 27