- Home
- Skills
- Testing & Debugging
- E2E Test Writer: Stable Playwright Tests, No Flakes
E2E Test Writer: Stable Playwright Tests, No Flakes
by Ignasi
Write and debug resilient Playwright E2E tests for critical user journeys with automated flake checking.
Free
E2E Test Writer: Stable Playwright Tests, No Flakes
Example session with this skill installed
Map the user journeys for my Next.js SaaS and write a Playwright test for the team invitation flow, including a flake check.
- Read your context and instructions
- Compiled the e2e test writer
I have analyzed the application structure and mapped the critical user journeys. I've implemented the invitation flow test using role-based locators and verified its stability with a repeat-check.
User Journey Coverage
| Journey | Happy Path | Unhappy Path | Status |
|---|---|---|---|
| Team Invitation | Invite via email | Invalid email format | Ready |
| Team Invitation | Member joins via link | Expired invite link | Ready |
| Auth | Login with storageState | Incorrect credentials | Mapped |
Invitation Flow Test
import { test, expect } from '@playwright/test';
test.describe('Team Management', () => {
test('user can invite a new member to the team', async ({ page }) => {
const uniqueEmail = `test-user-${Date.now()}@example.com`;
await page.goto('/settings/team');
await page.getByRole('button', { name: 'Invite Member' }).click();
await page.getByLabel('Email Address').fill(uniqueEmail);
await page.getByRole('combobox', { name: 'Role' }).selectOption('Editor');
await page.getByRole('button', { name: 'Send Invitation' }).click();
await expect(page.getByRole('status')).toContainText('Invitation sent');
await expect(page.getByText(uniqueEmail)).toBeVisible();
});
test('user sees error with invalid email', async ({ page }) => {
await page.goto('/settings/team');
await page.getByRole('button', { name: 'Invite Member' }).click();
await page.getByLabel('Email Address').fill('not-an-email');
await page.getByRole('button', { name: 'Send Invitation' }).click();
await expect(page.getByText('Invalid email format')).toBeVisible();
});
});
Next steps
- Run
npx playwright show-traceto review the execution timeline. - Add
@axe-core/playwrightto the invitation modal for accessibility testing. - Integrate the new spec into your
.github/workflows/e2e.yml.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual QA is slow and flaky UI tests cause more friction than they solve. This skill delivers stable Playwright end-to-end tests that focus on real user outcomes using resilient, role-based locators.
What it does
- Critical journey mapping identifies and ranks business-critical flows like auth, checkout, and CRUD operations by risk.
- Resilient locators prioritizes role-based and label-based selection over fragile CSS or XPath selectors.
- Efficient authentication implements storage state setup to log in once and reuse sessions across the entire suite.
- Network mocking handles third-party dependencies like payment gateways and maps via
page.routeto prevent external failures. - Flake prevention runs new tests repeatedly under load to identify race conditions and timing issues before they hit CI.
How it works
- Analysis of routes and components to build a journey coverage table.
- Infrastructure setup of the Playwright configuration including base URLs, web servers, and retry logic.
- Test authoring using web-first assertions and independent fixtures for unique test data.
- Validation through local execution, visual regression checks, and accessibility audits.
Frameworks & tools
TypeScript, Playwright, axe-core/playwright, and GitHub Actions. Supported application stacks include React, Vue, Next.js, Nuxt, Svelte, Rails, and Django.
Why this beats prompting it yourself
Generic prompts often produce fragile tests that rely on waitForTimeout or brittle CSS selectors. This skill enforces strict role-based locator priorities and automated flake-checking cycles that standard LLM outputs ignore.
Use cases
- Regression testing for core e-commerce checkout and payment flows.
- CI/CD integration to block broken builds with sharded test runs.
- Flaky test remediation by analyzing traces and fixing race conditions.
- Accessibility auditing to catch WCAG violations during functional testing.
Known limitations
Focuses on Chromium for speed; mobile Safari/Chrome are only added for key flows. Third-party mocks are restricted to specific external services like payments or email.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 11 days ago
- Free with an Agensi account
- Software
- Playwright
Node.js
Permissions
What's inside
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.