/pw:generatefrom pw
Generate Playwright tests from user stories, URLs, component paths, or feature descriptions. Automatically explores codebase conventions and uses templates for auth, CRUD, search, forms, and more.
Ships in pw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate production-ready Playwright tests from a user story, URL, component name, or feature description.
$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"Parse $ARGUMENTS to determine:
Use the Explore subagent to gather context:
playwright.config.ts for testDir, baseURL, projectstestDir for patterns, fixtures, and conventionspages/fixtures/auth.setup.ts or storageState config)Check templates/ in this plugin for matching patterns:
| If testing... | Load template from |
|---|---|
| Login/auth flow | 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.
Follow these rules:
Structure:
import { test, expect } from '@playwright/test';
// Import custom fixtures if the project uses them
test.describe('Feature Name', () => {
// Group related behaviors
test('should <expected behavior>', async ({ page }) => {
// Arrange: navigate, set up state
// Act: perform user action
// Assert: verify outcome
});
});
Locator priority (use the first that works):
getByRole() — buttons, links, headings, form elementsgetByLabel() — form fields with labelsgetByText() — non-interactive text contentgetByPlaceholder() — inputs with placeholder textgetByTestId() — when semantic options aren't availableAssertions — always web-first:
// GOOD — auto-retries
await expect(page.getByRole('heading')).toBeVisible();
await expect(page.getByRole('alert')).toHaveText('Success');
// BAD — no retry
const text = await page.textContent('.msg');
expect(text).toBe('Success');
Never use:
page.waitForTimeout()page.$(selector) or page.$$(selector)page.evaluate() for things locators can doAlways include:
await on every Playwright callbaseURL-relative navigation (page.goto('/') not page.goto('http://...')).spec.ts.spec.js with require() importstest-data/Run the generated test:
npx playwright test <generated-file> --reporter=list
If it fails:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/browserstackRun tests on BrowserStack. Use when user mentions "browserstack", "cross-browser", "cloud testing", "browser matrix", "test on safari", "test on firefox", or "browser compatibility"./coverageAnalyze test coverage gaps. Use when user says "test coverage", "what's not tested", "coverage gaps", "missing tests", "coverage report", or "what needs testing"./fixFix failing or flaky Playwright tests. Use when user says "fix test", "flaky test", "test failing", "debug test", "test broken", "test passes sometimes", or "intermittent failure"./initSet up Playwright in a project. Use when user says "set up playwright", "add e2e tests", "configure playwright", "testing setup", "init playwright", or "add test infrastructure"./migrateMigrate from Cypress or Selenium to Playwright. Use when user mentions "cypress", "selenium", "migrate tests", "convert tests", "switch to playwright", "move from cypress", or "replace selenium"./playwright-proProduction-grade Playwright testing toolkit. Use when the user mentions Playwright tests, end-to-end testing, browser automation, fixing flaky tests, test migration, CI/CD testing, or test suites. Generate tests, fix flaky failures, migrate from Cypress/Selenium, sync with TestRail, run on BrowserStack. 55 templates, 3 agents, smart reporting.npx claudepluginhub arogyareddy/alirezarezvani-claude-skills --plugin pw11 plugins ship this exact skill · first indexed Jun 3, 2026
Showing 6 of 11 plugins, one per repository first
Other plugins' skills for the same job