playwright-testing · laurigates — скилл Claude Code: установка и возможности
Скилл playwright-testing помогает писать E2E-тесты для веб-приложений в Playwright: проверять браузеры, мобильные viewport, API и визуальные снимки.
MIT 106 установок ★ 60 обновлён 2026-11-16
npx skills add laurigates/claude-plugins --skill playwright-testing -a claude-codeЧто делает playwright-testing
Скилл ведёт агента при создании E2E-тестов на Playwright для веб-приложений. Он охватывает Chromium, Firefox и WebKit, работу с локаторами и проверками, перехват сетевых запросов, визуальную регрессию и мобильную эмуляцию. Подходит для сценариев в браузере, но не для модульных тестов или проверки только API.
Внутри есть команды для инициализации проекта, установки браузеров, запуска всех тестов или отдельного файла, отладки, записи сценариев через codegen и просмотра отчётов и trace. Конфигурация может задавать каталог тестов, baseURL, тайм-аут, проекты браузеров и режим trace. Без bunx playwright install нужные браузеры не будут доступны для запуска тестов.
Какие задачи решает
- написать E2E-тест входа в приложение
- проверить интерфейс в Chromium, Firefox и WebKit
- снять и обновить визуальные snapshots
- эмулировать мобильный viewport
- отладить падение теста через trace
Примеры запросов агенту
- Напиши E2E-тест для входа через
tests/login.spec.tsи проверь переход на/dashboard. - Настрой Playwright для Chromium и добавь проверку визуального снимка страницы.
- Запусти
bunx playwright test --trace on --reporter=lineи разберись с падением теста.
Как установить playwright-testing
1Через Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill playwright-testing -a claude-code2Вручную: положить файлы
~/.claude/skills/playwright-testing/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/playwright-testing/
1Через Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill playwright-testing -a codex2Вручную: положить файлы
.agents/skills/playwright-testing/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill playwright-testing -a cursor2Вручную: положить файлы
.cursor/skills/playwright-testing/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install laurigates/claude-plugins testing-plugin/skills/playwright-testing2Вручную: положить файлы
.github/skills/playwright-testing/SKILL.md1Через Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill playwright-testing -a gemini-cli2Командой платформы
gemini skills install https://github.com/laurigates/claude-plugins --path testing-plugin/skills/playwright-testingВручную: положить файлы
.devin/skills/playwright-testing/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill playwright-testing -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о playwright-testing
Как установить playwright-testing в Claude Code?
Выполните npx skills add laurigates/claude-plugins --skill playwright-testing -a claude-code. Файл скилла появится по пути ~/.claude/skills/playwright-testing/SKILL.md.
Что делает playwright-testing?
Скилл помогает создавать и запускать E2E-тесты Playwright для веб-приложений. Он охватывает кросс-браузерные проверки, визуальную регрессию, API-сценарии и мобильную эмуляцию.
Что нужно установить перед запуском тестов?
После добавления скилла проекту нужны Playwright и браузеры. Для браузеров используется команда bunx playwright install, а в Linux доступна установка системных зависимостей через bunx playwright install --with-deps.
Исходный текст
SKILL.md · MIT
---
created: 2025-12-16
modified: 2026-11-14
reviewed: 2025-12-16
name: playwright-testing
description: "Playwright E2E testing — cross-browser, visual regression, API testing, mobile emulation. Use when writing E2E tests or setting up automated UI testing for web apps."
user-invocable: false
allowed-tools: Glob, Grep, Read, Bash(bunx playwright test *), Bash(bunx playwright show-report *), Bash(bunx playwright show-trace *), Edit, Write, TodoWrite, WebFetch, WebSearch
---
# Playwright Testing
Playwright is a modern end-to-end testing framework for web applications. It provides reliable, fast, and cross-browser testing with excellent developer experience.
## When to Use This Skill
| Use this skill when... | Use another skill instead when... |
|------------------------|----------------------------------|
| Writing E2E browser tests | Writing unit tests (use vitest-testing) |
| Testing across Chromium, Firefox, WebKit | Testing Python code (use python-testing) |
| Setting up visual regression testing | Analyzing test quality (use test-quality-analysis) |
| Mocking network requests in E2E tests | Generating property-based tests (use property-based-testing) |
| Testing mobile viewports | Testing API contracts only (use api-testing) |
## Core Expertise
- **Cross-browser**: Test on Chromium, Firefox, WebKit (Safari)
- **Reliable**: Auto-wait, auto-retry, no flaky tests
- **Fast**: Parallel execution, browser context isolation
- **Modern**: TypeScript-first, async/await, auto-complete
- **Multi-platform**: Windows, macOS, Linux
## Installation
```bash
bun create playwright # Initialize (recommended)
bun add --dev @playwright/test # Or install manually
bunx playwright install # Install browsers
bunx playwright install --with-deps # With system deps (Linux)
bunx playwright --version # Verify
```
## Configuration (playwright.config.ts)
```typescript
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
timeout: 30000,
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});
```
## Essential Commands
```bash
bunx playwright test # Run all tests
bunx playwright test tests/login.spec.ts # Specific file
bunx playwright test --headed # See browser
bunx playwright test --debug # Debug mode
bunx playwright test --project=chromium # Specific browser
bunx playwright test --ui # UI mode
bunx playwright codegen http://localhost:3000 # Record tests
bunx playwright show-report # Last report
bunx playwright show-trace trace.zip # Trace viewer
bunx playwright test --update-snapshots # Update snapshots
```
## Writing Tests
### Basic Test Structure
```typescript
import { test, expect } from '@playwright/test';
test('basic test', async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example/);
});
test.describe('login flow', () => {
test('should login successfully', async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="email"]', '[email protected]');
await page.fill('input[name="password"]', 'password123');
await page.click('button[type="submit"]');
await expect(page).toHaveURL('/dashboard');
});
});
```
### Selectors and Locators
```typescript
// Text/Role selectors (recommended)
await page.getByText('Sign in').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByLabel('Email').fill('[email protected]');
await page.getByPlaceholder('Enter your name').fill('John');
await page.getByTestId('login-button').click();
// CSS/XPath selectors
await page.locator('.button-primary').click();
await page.locator('xpath=//button[text()="Submit"]').click();
// Chaining
await page.locator('.card').filter({ hasText: 'Product' }).getByRole('button').click();
```
### Key Assertions
| Assertion | Description |
|-----------|-------------|
| `toHaveTitle(title)` | Page title |
| `toHaveURL(url)` | Page URL |
| `toBeVisible()` | Element visible |
| `toBeEnabled()` | Element enabled |
| `toHaveText(text)` | Element text |
| `toContainText(text)` | Partial text |
| `toHaveAttribute(name, value)` | Attribute value |
| `toHaveClass(class)` | CSS class |
| `toHaveValue(value)` | Input value |
| `toBeEmpty()` | Empty input |
| `toHaveCount(n)` | Element count |
| `not.toBeDisabled()` | Negation |
## Agentic Optimizations
| Context | Command |
|---------|---------|
| Quick test | `bunx playwright test --reporter=line --bail` |
| CI test | `bunx playwright test --reporter=github` |
| Single browser | `bunx playwright test --project=chromium --reporter=line` |
| Debug failing | `bunx playwright test --trace on --reporter=line` |
| Headed debug | `bunx playwright test --headed --debug` |
For detailed examples, advanced patterns, and best practices, see [REFERENCE.md](REFERENCE.md).
Testing a WebGL app (CesiumJS, three.js, MapLibre) on a GPU-less CI runner: see [WebGL Apps in GPU-less CI](REFERENCE.md#webgl-apps-in-gpu-less-ci) for the SwiftShader flags, the lhci `chromeFlags` string trap, and frame-rate capping.
## References
- Official docs: https://playwright.dev
- Configuration: https://playwright.dev/docs/test-configuration
- API reference: https://playwright.dev/docs/api/class-test
- Best practices: https://playwright.dev/docs/best-practices
- CI/CD: https://playwright.dev/docs/ci
- Trace viewer: https://playwright.dev/docs/trace-viewer
© laurigates · MIT · laurigates/claude-plugins
Похожие скиллы
Все скиллы по теме «Тесты и QA» →Сначала — playwright-testing от других авторов.