E2E Test Writer: Stable Playwright Tests, No Flakes

    by Ignasi

    1

    Write and debug resilient Playwright E2E tests for critical user journeys with automated flake checking.

    Free

    Security scanned

    Works with the AI Agents you already use

    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

    JourneyHappy PathUnhappy PathStatus
    Team InvitationInvite via emailInvalid email formatReady
    Team InvitationMember joins via linkExpired invite linkReady
    AuthLogin with storageStateIncorrect credentialsMapped

    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

    1. Run npx playwright show-trace to review the execution timeline.
    2. Add @axe-core/playwright to the invitation modal for accessibility testing.
    3. 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.route to 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

    1. Analysis of routes and components to build a journey coverage table.
    2. Infrastructure setup of the Playwright configuration including base URLs, web servers, and retry logic.
    3. Test authoring using web-first assertions and independent fixtures for unique test data.
    4. 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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
    PlaywrightNode.js

    Permissions

    Terminal / Shell
    Browser
    Environment Variables
    Listed11 days ago
    Updated1 day ago

    What's inside

    Frequently Asked Questions

    This skill generates complete Playwright test files (.spec.ts), configuration files, and reusable fixtures. It also provides a journey coverage report and ready-to-use GitHub Actions workflows for CI/CD integration.

    Unlike basic prompts, this skill uses a "flake-checking" cycle that runs tests multiple times under simulated load to identify race conditions. It also enforces a strict role-based locator strategy to ensure tests don't break when you change your CSS or layout.

    The skill is designed for TypeScript-based Playwright environments. While it excels with modern frameworks like React and Next.js, it can generate tests for any web application regardless of the backend, provided it is accessible via a URL.

    Yes, the skill includes built-in support for Playwright's `storageState`. It generates the necessary logic to log in once, save the session, and reuse that authentication state across all test files to significantly reduce execution time.

    Yes, the skill uses the `axe-core/playwright` library to automatically inject accessibility checks into your functional tests, helping you catch WCAG violations as part of your standard QA process.

    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.

    Free