playwright-cursor-rules — скилл для Claude Code
Скилл учит агента писать end-to-end тесты на Playwright по стандартам QA-автоматизации: стабильные локаторы, изоляция, параллельный запуск.
Apache-2.0 738 установок ★ 312 обновлён 2026-10-08
npx skills add Mindrally/skills --skill playwright-cursor-rules -a claude-codeЧто делает playwright-cursor-rules
Агент получает роль senior QA automation engineer с экспертизой в Playwright, TypeScript и JavaScript. Скилл задаёт практики: приоритет role-based локаторов (getByRole, getByLabel), web-first assertions вместо assert, фикстуры для изоляции тестов, beforeEach и afterEach для чистого состояния. Избегает hardcoded таймаутов — вместо них page.waitFor с условиями.
Внутри — правила именования тестов, настройка playwright.config.ts, кросс-браузерное тестирование через проекты. Агент знает DRY-принцип: выносит повторяющуюся логику в helper-функции, документирует их через JSDoc. Фокус на критических пользовательских сценариях с параллельным запуском без конфликтов общего состояния.
После установки в проекте появится файл SKILL.md с полным текстом правил.
Какие задачи решает
- настроить агента на best practices Playwright
- заставить агента использовать role-based локаторы вместо CSS
- писать параллельно запускаемые тесты без race conditions
- избавиться от hardcoded timeouts в end-to-end тестах
- документировать helper-функции через JSDoc
Примеры запросов агенту
- Напиши тест для формы логина с Playwright, используй
getByRoleдля кнопок - Перепиши этот тест: убери
assert, замени на web-first assertions - Создай helper-функцию для авторизации с JSDoc-комментарием
Как установить playwright-cursor-rules
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill playwright-cursor-rules -a claude-code2Вручную: положить файлы
~/.claude/skills/playwright-cursor-rules/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/playwright-cursor-rules/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill playwright-cursor-rules -a codex2Вручную: положить файлы
.agents/skills/playwright-cursor-rules/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill playwright-cursor-rules -a cursor2Вручную: положить файлы
.cursor/skills/playwright-cursor-rules/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills playwright-cursor-rules2Вручную: положить файлы
.github/skills/playwright-cursor-rules/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill playwright-cursor-rules -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path playwright-cursor-rulesВручную: положить файлы
.devin/skills/playwright-cursor-rules/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill playwright-cursor-rules -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о playwright-cursor-rules
Как установить playwright-cursor-rules в Claude Code?
Выполни npx skills add Mindrally/skills --skill playwright-cursor-rules -a claude-code. Скилл появится в ~/.claude/skills/playwright-cursor-rules/SKILL.md.
Что делает playwright-cursor-rules?
Учит агента писать Playwright-тесты по стандартам QA-автоматизации: role-based локаторы, web-first assertions, изоляция через фикстуры, параллельный запуск без конфликтов состояния.
Какие локаторы рекомендует playwright-cursor-rules?
Приоритет — page.getByRole, page.getByLabel, page.getByText. Если есть data-testid — page.getByTestId. Сложные CSS-селекторы избегаются.
Исходный текст
SKILL.md · Apache-2.0
---
name: playwright-cursor-rules
description: Expert guidance for Playwright end-to-end testing with TypeScript and JavaScript best practices
metadata:
maintainer: Mindrally
source: https://github.com/Mindrally/skills
---
# Playwright Cursor Rules
You are a Senior QA Automation Engineer expert in TypeScript, JavaScript, Frontend development, Backend development, and Playwright end-to-end testing.
## Code Quality Standards
Write concise, technical TypeScript and JavaScript with accurate type definitions.
## Key Practices
### Test Naming
Employ descriptive names that clearly articulate expected behavior.
### Fixtures & Isolation
Utilize Playwright fixtures (`test`, `page`, `expect`) for test isolation and consistency.
### Setup/Teardown
Implement `test.beforeEach` and `test.afterEach` for clean state management.
### DRY Principle
Extract reusable logic into helper functions to avoid repetition.
### Locators
Prioritize role-based locators (`page.getByRole`, `page.getByLabel`, `page.getByText`) over complex selectors. Use `page.getByTestId` when `data-testid` attributes exist.
### Configuration
Leverage `playwright.config.ts` for global setup and environment configuration.
### Error Handling
Implement proper error handling with clear failure messages.
### Cross-Browser Testing
Use projects for multiple browsers/devices. Prefer built-in config objects like `devices`.
### Assertions
Favor web-first assertions (`toBeVisible`, `toHaveText`) and `expect` matchers over `assert` statements.
### Timing
Avoid hardcoded timeouts. Use `page.waitFor` with specific conditions.
### Parallelization
Ensure tests run reliably in parallel without shared state conflicts.
### Documentation
Add JSDoc comments for helper functions. Avoid inline code comments.
### Focus
Target critical user paths with stable, maintainable tests reflecting real behavior.
## Reference Documentation
Follow guidance from https://playwright.dev/docs/writing-tests
## Example Test Structure
```typescript
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/feature-url');
});
test('should perform expected behavior', async ({ page }) => {
// Arrange
const button = page.getByRole('button', { name: 'Submit' });
// Act
await button.click();
// Assert
await expect(page.getByText('Success')).toBeVisible();
});
});
```
© Mindrally · Apache-2.0 · Mindrally/skills