skills/engineering-team/playwright-pro/skills/generate/SKILL.md
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 skillsauth add neekware/ehayeskills generateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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:
tools
# ehAye Multimedia Use this skill for **video, audio, images, media conversion, previews, transcription, thumbnails, frame extraction, Spotter visual search, or FFmpeg-backed processing**. Core rule: use ehAye native media tools first. Do not reach first for shell `ffmpeg`, `ffprobe`, Python, or `mediainfo` when a native media tool can do the job. Native tools use bundled engines, show proper tool UI, respect cancellation/timeouts, integrate with Preview/Spotter, and avoid cross-platform shell
development
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and Mocha. Use when the user asks to write tests, improve test coverage, practice TDD, generate mocks or stubs, or mentions testing frameworks like Jest, pytest, or JUnit. Handles test generation from source code, coverage report parsing (LCOV/JSON/XML), quality scoring, and framework conversion for TypeScript, JavaScript, Python, and Java projects.
tools
Help a user set up Telegram for ehAye Dojo. Default to Personal private bots (recommended). Group setup is advanced for teams/observers/demos.
development
# Writing Skills ## Overview **Writing skills IS Test-Driven Development applied to process documentation.** **Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.agents/skills/` for Codex)** You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes). **Core principle:** If you didn't watch an agent fail without the ski