Documentation
README
Skill: Playwright E2E Testing
Проверка окружения
# Проверить установлен ли Playwright
npx playwright --version 2>/dev/null || echo "Playwright not installed"
Если не установлен:
npm install -D @playwright/test
npx playwright install chromium
Запуск существующих тестов
npx playwright test
С UI отчётом:
npx playwright test --reporter=html
Создание нового теста
При создании E2E теста:
- Определить сценарий (user flow)
- Создать файл в
tests/e2e/илиe2e/ - Использовать паттерн:
import { test, expect } from '@playwright/test';
test('описание сценария', async ({ page }) => {
await page.goto('/');
// ... actions
await expect(page.locator('selector')).toBeVisible();
});
Когда использовать
This is the opening of the README. Read the full README on GitHub.