Loading...
Loading...
Generate Playwright tests. Use when user says "write tests", "generate tests", "add tests for", "test this component", "e2e test", "create test for", "test this page", or "test this feature".
npx skill4agent add alirezarezvani/claude-skills generate$ARGUMENTS"user can log in with email and password""the checkout flow""src/components/UserProfile.tsx""the search page with filters"$ARGUMENTSExploreplaywright.config.tstestDirbaseURLprojectstestDirpages/fixtures/auth.setup.tsstorageStatetemplates/| If testing... | Load template from |
|---|---|
| Login/auth flow | |
| CRUD operations | |
| Checkout/payment | |
| Search/filter UI | |
| Form submission | |
| Dashboard/data | |
| Settings page | |
| Onboarding flow | |
| API endpoints | |
| Accessibility | |
{{placeholders}}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
});
});getByRole()getByLabel()getByText()getByPlaceholder()getByTestId()// 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');page.waitForTimeout()page.$(selector)page.$$(selector)page.evaluate()awaitbaseURLpage.goto('/')page.goto('http://...').spec.ts.spec.jsrequire()test-data/npx playwright test <generated-file> --reporter=list