Agent skill · software engineering · alirezarezvani
generate
Use when asked to write Playwright or e2e tests for a page, component or feature ('write tests', 'add tests for', 'e2e test').
Why this skill is useful
Adds a comprehensive script for generating Playwright tests, including templates and project-specific conventions that the AI cannot infer on its own.
What it needs
Requires playwright installed locally. About 3k tokens when loaded. Last updated 2026-08-05. 23,939 stars on the source repository.
What this skill does
Generate Playwright Tests Generate production-ready Playwright tests from a user story, URL, component name, or feature description. Input $ARGUMENTS contains what to test. Examples: "user can log in with email and password" "the checkout flow" "src/components/UserProfile.tsx" "the search page with filters" Steps 1. Understand the Target Parse $ARGUMENTS to determine: User story: Extract the behavior to verify Component path: Read the component source code Page/URL: Identify the route and its elements Feature name: Map to relevant app areas 2. Explore the Codebase Use the Explore subagent to gather context: Read playwright.config.ts for testDir, baseURL, projects Check existing tests in testDir for patterns, fixtures, and conventions If a component path is given, read the component to understand its props, states, and interactions Check for existing page objects in pages/ Check for existing fixtures in fixtures/ Check for auth setup (auth.setup.ts or storageState config) 3. Select Templates Check templates/ in this plugin for matching patterns: If testing... Load template from --- --- Login/auth flow ../pw/templates/auth/login.md CRUD operations templates/crud/ Checkout/payment templates/checkout/ Search/filter UI templates/search/ Form submission templates/forms/ Dashboard/data templates/dashboard/ Settings page templates/settings/ Onboarding flow templates/onboarding/ API endpoints templates/api/ Accessibility templates/accessibility/ Adapt the template to the specific app — replace {{placeholders}} with actual selectors, URLs, and data. 4. Generate the Test Follow these rules: Structure: Locator priority (use the first that works): 1. getByRole() — buttons, links, headings, form elements 2. getByLabel() — form fields with labels 3. getByText() — non-interactive text content 4. getByPlaceholder() — inputs with placeholder text 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills alirezarezvani/generate--eb719e