Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.
generate
Security Scan Summary
Status: Safe
Source: Syntic Skills registry
Automated security scan completed with no high-risk patterns detected. Manual review is still required.
About This Skill
Use when generating production-ready Playwright tests from user stories, URLs, components, or feature descriptions.
Downloadable SKILL.md
Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.
---
name: generate
description: Use when generating production-ready Playwright tests from user stories, URLs, components, or feature descriptions.
category: Engineering
version: 1.0.0
tools: []
---
# Generate Playwright Tests
Create production-ready Playwright tests from user stories, features, or components.
## Input
Parse arguments to determine:
- User story: behavior to verify
- Component path: read source to understand props/states/interactions
- Page/URL: identify route and elements
- Feature name: map to app areas
## Explore Codebase
- Read `playwright.config.ts` for testDir, baseURL, projects
- Check existing tests for patterns, fixtures, conventions
- Read components to understand their structure
- Check for page objects in `pages/`
- Check fixtures in `fixtures/`
- Check auth setup in `auth.setup.ts`
## Test Structure
```typescript
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test('should <expected behavior>', async ({ page }) => {
// Arrange
// Act
// Assert
});
});
```
## Locator Priority
1. `getByRole()` — buttons, links, headings, form elements
2. `getByLabel()` — form fields with labels
3. `getByText()` — text content
4. `getByPlaceholder()` — input placeholder
5. `getByTestId()` — when semantic options fail
## Assertions (web-first, auto-retry)
```typescript
// GOOD
await expect(page.getByRole('heading')).toBeVisible();
// BAD (no retry)
const text = await page.textContent('.msg');
```
## Never Use
- `waitForTimeout()`
- `page.$(selector)` or `page.$$(selector)`
- Bare CSS selectors (unless necessary)
- `page.evaluate()` for locator tasks
## Always Include
- Descriptive test names explaining behavior
- Error/edge case tests alongside happy path
- `await` on every Playwright call
- baseURL-relative navigation (`page.goto('/')`)
## Match Project Conventions
- TypeScript → `.spec.ts`, JavaScript → `.spec.js`
- Use page objects if project has them
- Use custom fixtures if defined
- Use project's test data directory
## Supporting Files
- **Page object**: if test touches 5+ locators on one page
- **Fixture**: if test needs shared setup (auth, data)
- **Test data**: JSON file in test-data/ if structured data used
## Verify
```bash
npx playwright test <file> --reporter=list
```
Test must pass. If app issue, report it.
Bundle Download
Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.
Install Targets
Syntic App
- 1. Create a dedicated folder for this skill in your local skills library.
- 2. Place SKILL.md into that folder.
- 3. Restart Syntic and invoke this skill on matching tasks.
Syntic Code (CLI)
- 1. Save SKILL.md in your local Syntic Code skills directory.
- 2. Keep related files in the same skill folder.
- 3. Run in a safe environment and validate outputs.
Source
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/generate/SKILL.md
Open Source LinkRelated Skills
a11y-audit
Use when auditing WCAG 2.2 Level A/AA accessibility, fixing violations in React, Next.js, Vue, Angular...
Engineeringadversarial-reviewer
Use when reviewing recent code changes or a PR before merge and you want a genuinely critical review, not...
Engineeringagent-designer
Use when architecting multi-agent systems, selecting orchestration patterns, or evaluating agent performance.
Engineeringagent-harness
Use when building bounded agentic loops with verified task execution and state machines.