Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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".
.claude/skills/alirezarezvani-generate/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-24 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-25 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-05 | ✓→✗ | ▼ Worse | -70% | 0% |
| case-06 | ✓→✗ | ▼ Worse | 4% | 0% |
| case-07 | ✓→✗ | ▼ Worse | -16% | 0% |
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 | ../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.
Follow these rules:
Structure:
typescriptimport { 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:
typescript// 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:
bashnpx playwright test <generated-file> --reporter=list
If it fails:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 6,056 | 7,180 | +19% | 1 | 1 | 0% | 136 | 1,718 | +1163% | 0 | 0 | — |
case-02 | fail→fail | 3,181 | 3,994 | +26% | 1 | 1 | 0% | 186 | 1,395 | +650% | 0 | 0 | — |
case-03 | fail→fail | 4,197 | 4,486 | +7% | 1 | 1 | 0% | 333 | 1,409 | +323% | 0 | 0 | — |
case-04 | pass→pass | 14,648 | 16,234 | +11% | 1 | 1 | 0% | 3,019 | 4,597 | +52% | 0 | 0 | — |
case-05 | pass→fail | 21,375 | 5,022 | -77% | 1 | 1 | 0% | 4,831 | 1,459 | -70% | 0 | 0 | — |
case-06 | pass→fail | 5,977 | 3,424 | -43% | 1 | 1 | 0% | 1,201 | 1,253 | +4% | 0 | 0 | — |
case-07 | pass→fail | 8,221 | 4,771 | -42% | 1 | 1 | 0% | 1,627 | 1,366 | -16% | 0 | 0 | — |
case-08 | pass→fail | 9,382 | 5,565 | -41% | 1 | 1 | 0% | 1,771 | 1,464 | -17% | 0 | 0 | — |
case-09 | pass→fail | 7,641 | 4,539 | -41% | 1 | 1 | 0% | 1,624 | 1,403 | -14% | 0 | 0 | — |
case-10 | pass→fail | 16,889 | 4,385 | -74% | 1 | 1 | 0% | 3,419 | 1,420 | -58% | 0 | 0 | — |
case-11 | pass→pass | 1,973 | 1,171 | -41% | 1 | 1 | 0% | 344 | 1,299 | +278% | 0 | 0 | — |
case-12 | pass→fail | 7,724 | 4,161 | -46% | 1 | 1 | 0% | 1,785 | 1,347 | -25% | 0 | 0 | — |
case-13 | pass→fail | 13,885 | 4,026 | -71% | 1 | 1 | 0% | 3,108 | 1,322 | -57% | 0 | 0 | — |
case-14 | pass→fail | 9,518 | 4,828 | -49% | 1 | 1 | 0% | 1,780 | 1,317 | -26% | 0 | 0 | — |
case-15 | pass→pass | 13,725 | 12,252 | -11% | 1 | 1 | 0% | 2,773 | 3,348 | +21% | 0 | 0 | — |
case-16 | fail→fail | 19,412 | 4,674 | -76% | 1 | 1 | 0% | 3,834 | 1,278 | -67% | 0 | 0 | — |
case-17 | pass→fail | 6,081 | 5,928 | -3% | 1 | 1 | 0% | 1,038 | 1,530 | +47% | 0 | 0 | — |
case-18 | pass→fail | 15,942 | 4,717 | -70% | 1 | 1 | 0% | 3,399 | 1,296 | -62% | 0 | 0 | — |
case-19 | pass→pass | 5,729 | 3,905 | -32% | 1 | 1 | 0% | 1,052 | 1,687 | +60% | 0 | 0 | — |
case-20 | pass→fail | 8,007 | 5,284 | -34% | 1 | 1 | 0% | 1,423 | 2,066 | +45% | 0 | 0 | — |
case-21 | pass→pass | 5,651 | 4,560 | -19% | 1 | 1 | 0% | 1,098 | 1,904 | +73% | 0 | 0 | — |
case-22 | pass→pass | 4,138 | 4,536 | +10% | 1 | 1 | 0% | 749 | 1,833 | +145% | 0 | 0 | — |
case-23 | pass→pass | 10,036 | 1,138 | -89% | 1 | 1 | 0% | 1,787 | 1,294 | -28% | 0 | 0 | — |
case-24 | fail→pass | 8,538 | 2,014 | -76% | 1 | 1 | 0% | 1,346 | 1,439 | +7% | 0 | 0 | — |
case-25 | fail→pass | 5,903 | 2,102 | -64% | 1 | 1 | 0% | 1,004 | 1,413 | +41% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 10 counted toward the lift figure. The other 15 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -40 percentage points is the difference between those two pass rates over the 10 comparable cases. 12 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.