Playwright E2E taste — промпт для ChatGPT: описание и установка
Промпт Playwright E2E taste для ChatGPT задаёт правила для E2E-тестов на Playwright. Он помогает спланировать тесты, которые проверяют основные пользовательские сценарии и не зависят от порядка запуска.
CC0-1.0 ★ 178 201 обновлён 2026-10-24
Открыть на GitHubЧто делает Playwright E2E taste
Промпт задаёт правила для E2E-тестов на Playwright: хранить их рядом с приложением, запускать через Playwright Test и проверять ключевые пользовательские пути. Для поиска элементов он предлагает использовать роли, подписи и data-testid, а ожидания строить через API expect с автоматическим ожиданием. Фиксированные паузы waitForTimeout исключены.
Каждый тест должен получать отдельный браузерный контекст и подготовленные данные. Промпт также описывает запуск в тестовом окружении, сбор трассировки и скриншотов при сбое, а внешние платёжные, почтовые и SMS-сервисы предлагает подменять заглушками. Тесты не должны обращаться к production.
Для Claude Code файл нужно положить по пути .claude/commands/prompts.csv.md. Правила также охватывают CI: закреплённую версию браузера, отложенный запуск медленных тестов и разбор трассировки перед изменением настроек повторного запуска.
Какие задачи решает
- спланировать E2E-проверки критических пользовательских сценариев
- выбрать устойчивые селекторы для элементов интерфейса
- изолировать тесты от порядка запуска и общих данных
- сократить нестабильность проверок в CI
Примеры запросов агенту
- Составь план E2E-тестов для входа, создания записи и выхода из приложения.
- Проверь эти Playwright-тесты на фиксированные паузы и зависимость от порядка запуска.
- Предложи правила для изоляции E2E-тестов и подмены внешних платёжных сервисов.
Как установить Playwright E2E taste
Как использовать
Вставьте текст в начало диалога или в инструкции проекта
Вручную: положить файлы
.claude/commands/prompts.csv.mdВопросы о Playwright E2E taste
Как установить Playwright E2E taste в Claude Code?
Помести файл промпта по пути .claude/commands/prompts.csv.md.
Что делает Playwright E2E taste?
Промпт задаёт подход к E2E-тестам на Playwright: от выбора селекторов и изоляции тестов до запуска в CI и разбора сбоев.
Какие селекторы рекомендует Playwright E2E taste?
Он предлагает предпочитать getByRole, getByLabel и getByTestId селекторам CSS и XPath. Стабильный data-testid добавляют, когда роли и подписи неоднозначны.
Исходный текст
prompts.csv · CC0-1.0
# Playwright E2E taste of a flake-intolerant QA engineer - Keep end-to-end tests in the same repository as the app, under a top-level `e2e/` or `tests/e2e/` folder. Confidence: 0.90 - Use Playwright Test as the runner; do not mix Cypress and Playwright in one project. Confidence: 0.90 - Prefer `getByRole`, `getByLabel` and `getByTestId` over CSS or XPath selectors that break on restyles. Confidence: 0.95 - Add a stable `data-testid` only when role and label are genuinely ambiguous, and document the convention in the README. Confidence: 0.85 - Assert with Playwright's auto-waiting expect API; never sprinkle fixed `waitForTimeout` calls to "make it pass". Confidence: 0.95 - Isolate each test with a fresh browser context and seed data; tests must not depend on run order. Confidence: 0.90 - Cover the critical user journeys first: sign-in, the main create/edit flow, checkout or publish, and sign-out. Confidence: 0.90 - Keep E2E count small and high-value; push edge cases and validation matrices down to unit and component tests. Confidence: 0.85 - Use Page Object or fixture helpers for shared flows, but keep assertions in the test file so failures stay readable. Confidence: 0.80 - Run tests against a dedicated preview or ephemeral environment with known seed data, not against production. Confidence: 0.90 - Capture trace, screenshot and video on failure only, and upload them as CI artifacts. Confidence: 0.90 - Pin the Playwright browser revision in CI so local and pipeline screenshots stay comparable. Confidence: 0.85 - Tag slow or third-party-dependent tests and exclude them from the default PR suite; run the full set on main or nightly. Confidence: 0.80 - Stub or mock external payments, email and SMS providers; never hit real vendor sandboxes from every PR. Confidence: 0.85 - Prefer API or storage-state setup for authenticated sessions instead of clicking through login in every test. Confidence: 0.90 - Fail the build when a test is flaky more than once in a short window; quarantine and fix instead of rerunning forever. Confidence: 0.85 - Use `test.step` to group actions in the report so a failure points at the broken step, not a wall of clicks. Confidence: 0.75 - Keep viewport and locale explicit in the config for visual checks; do not rely on developer laptop defaults. Confidence: 0.80 - Review traces for every new flake before merging a "retry" config change. Confidence: 0.85 - Document how to run one file and one headed test locally in a short CONTRIBUTING note. Confidence: 0.80
© f · CC0-1.0 · f/prompts.chat