playwright-test — скилл для Claude Code: что делает и как установить
Скилл playwright-test создаёт стабильные E2E-тесты Playwright по стандартам OpenMetadata с валидацией через API, проверкой прав ролей и запуском линтера.
Apache-2.0 ★ 15 831 обновлён 2026-10-24
npx skills add open-metadata/OpenMetadata --skill playwright-test -a claude-codeЧто делает playwright-test
Скилл генерирует сценарии Playwright на базе руководства PLAYWRIGHT_DEVELOPER_HANDBOOK.md. Сначала агент изучает правила проекта: запрет на waitForTimeout, networkidle и принудительные клики force: true. Для элементов под всплывающими уведомлениями используется хелпер clickIgnoringToasts. Каждый тест изолирован. Создание и удаление тестовых данных выносятся в вызовы API внутри хуков beforeAll и afterAll.
Перед завершением работы скилл запускает линтер командой yarn lint:playwright в каталоге интерфейса. Правила playwright/* и om-playwright/* настроены на уровень ошибок. Скилл запрещает добавлять записи в eslint-suppressions.json, поэтому сгенерированный тест обязан пройти проверку без компромиссов. Вне репозитория OpenMetadata скилл бесполезен без адаптации путей к справочнику и локальным правилам.
Какие задачи решает
- создавать E2E-тесты Playwright без нестабильных тайм-аутов и задержек
- проверять сценарии разграничения прав для разных ролей пользователей
- валидировать ответы API перед выполнением действий в веб-интерфейсе
- управлять жизненным циклом сущностей через API в хуках beforeAll и afterAll
Примеры запросов агенту
- /playwright-test Feature: Data Quality Rules Category: Features Entity: Table Domain: Observability Scenarios: - Администратор настраивает правила качества данных - Потребитель данных видит результаты, но не может менять правила Roles: admin, dataConsumer
- /playwright-test Feature: User Profile Category: Pages Entity: User Domain: Platform Scenarios: - Пользователь обновляет отображаемое имя - Изменения сохраняются после перезагрузки страницы Roles: admin
Как установить playwright-test
1Через Skills CLI (Vercel)
npx skills add open-metadata/OpenMetadata --skill playwright-test -a claude-code2Вручную: положить файлы
~/.claude/skills/playwright/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/playwright/
1Через Skills CLI (Vercel)
npx skills add open-metadata/OpenMetadata --skill playwright-test -a codex2Вручную: положить файлы
.agents/skills/playwright/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add open-metadata/OpenMetadata --skill playwright-test -a cursor2Вручную: положить файлы
.cursor/skills/playwright/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install open-metadata/OpenMetadata skills/playwright2Вручную: положить файлы
.github/skills/playwright/SKILL.md1Через Skills CLI (Vercel)
npx skills add open-metadata/OpenMetadata --skill playwright-test -a gemini-cli2Командой платформы
gemini skills install https://github.com/open-metadata/OpenMetadata --path skills/playwrightВручную: положить файлы
.devin/skills/playwright/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add open-metadata/OpenMetadata --skill playwright-test -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о playwright-test
Как установить playwright-test в Claude Code?
Выполните команду npx skills add open-metadata/OpenMetadata --skill playwright -a claude-code.
Что делает playwright-test?
Он генерирует готовые E2E-тесты Playwright, опираясь на архитектурные шаблоны OpenMetadata, семантические локаторы и проверку сетевых ответов.
Зачем запускается yarn lint:playwright?
Команда проверяет код правилами eslint-plugin-playwright и внутренними проверками проекта. Ошибки блокируют CI, а подавлять их через eslint-suppressions.json запрещено.
Исходный текст
SKILL.md · Apache-2.0
--- name: playwright-test description: Generate robust, zero-flakiness Playwright E2E tests following OpenMetadata patterns. Creates comprehensive test files with proper waits, API validation, multi-role permissions, and complete entity lifecycle management. user-invocable: true --- # Playwright Test Generator - OpenMetadata Generate production-ready, zero-flakiness Playwright tests following OpenMetadata conventions. ## Usage ``` /playwright-test Feature: <feature name> Category: <Features|Pages|Flow|VersionPages> Entity: <Table|Dashboard|Pipeline|Topic|Database|User|Team|Glossary|Other> Domain: <Governance|Discovery|Platform|Observability|Integration> Scenarios: - <scenario 1 description> - <scenario 2 description> - <scenario 3 description> Roles: <admin|dataConsumer|dataSteward|owner> (optional, defaults to admin) ``` ## Quick Example ``` /playwright-test Feature: Data Quality Rules Category: Features Entity: Table Domain: Observability Scenarios: - Admin can create and configure data quality rules - Data consumer can view test results but not edit rules - Test results are persisted after page reload Roles: admin, dataConsumer ``` --- ## Instructions ### Step 1: Read the Handbook FIRST **CRITICAL**: Before generating any tests, read and apply ALL patterns from: ``` openmetadata-ui/src/main/resources/ui/playwright/PLAYWRIGHT_DEVELOPER_HANDBOOK.md ``` The handbook contains: - Testing philosophy (user-centric, behavior-focused) - Anti-flakiness patterns (the :visible selector chain pattern, controls under the toast stack, etc.) - Test timeout strategies (test.slow() vs test.setTimeout()) - Common test patterns (form submission, dropdowns, multi-role testing) - Locator priority guidelines - Support classes reference - Domain tags - Validation checklist **Apply ALL handbook principles before proceeding.** --- ### Step 2: Generate Test Using Handbook Template Use the **Test File Structure Template** from the handbook. It includes: - Proper imports (performAdminLogin, entity classes, utilities) - test.describe with domain tags - beforeAll/afterAll for entity lifecycle via API - test.slow() for timeout handling - test.step() for clear organization - API response validation pattern --- ### Step 3: Apply Common Test Patterns from Handbook Reference the **Common Test Patterns** section for: - Form submission with API validation - Dropdown selection (with :visible chain pattern) - Multi-role permission testing - Data persistence verification - Navigation patterns - Search and filter patterns --- ### Step 4: Run ESLint Check Before returning the generated test, run the full Playwright lint gate — the same one CI runs: ```bash cd openmetadata-ui/src/main/resources/ui yarn lint:playwright ``` Every `playwright/*` and `om-playwright/*` guardrail rule runs at `error`; repo-wide `openmetadata-playwright/*` rules set their own severity and may be `warn`. Fix any errors before finalizing — never add a new entry to `eslint-suppressions.json` to make this pass. See the handbook's **ESLint Enforcement** section for the full, generated rule reference. ### Step 5: Validate Against Handbook Checklist Before returning the generated test, verify ALL items from the handbook's **Validation Checklist**: - ✅ Structure & Organization (test.step, domain tags, imports, beforeAll/afterAll) - ✅ Anti-Flakiness (no waitForTimeout, no networkidle, no force: true, no positional selectors, no stored :visible locators, `clickIgnoringToasts` for bottom-aligned controls) - ✅ API & Network (waitForResponse before actions, status code validation) - ✅ Waits & Assertions (waitForAllLoadersToDisappear, semantic locators, proper assertions) - ✅ ESLint (`yarn lint:playwright` passes with zero errors) - ✅ Coverage & Roles (multi-role tests, data persistence, error handling) --- ## Key Reminders **All patterns, rules, and best practices are in the handbook.** Read and apply the handbook sections in order: 1. **Anti-Flakiness Patterns** (CRITICAL - #1 cause of flaky tests) 2. **Test File Structure Template** (for proper test structure) 3. **Common Test Patterns** (for specific scenarios) 4. **ESLint Enforcement** (run `yarn lint:playwright` — every rule is `error`) 5. **Validation Checklist** (before returning generated test) --- ## Final Notes - Generate **production-ready** tests that pass 10/10 times - Follow ALL patterns from the handbook exactly - No comments for obvious code (e.g., `// Create entity` before `entity.create()`) - Test independence - each test runs in any order - Reference examples: `playwright/e2e/Pages/DataContractInheritance.spec.ts`, `playwright/e2e/Features/Table.spec.ts` **Generate tests that are production-ready, maintainable, and zero-flakiness by following the handbook patterns exactly.** --- ## Writing Playwright Tests (merged from the former `writing-playwright-tests` skill) **Reference**: `openmetadata-ui/src/main/resources/ui/playwright/PLAYWRIGHT_DEVELOPER_HANDBOOK.md` ### ESLint Enforcement All Playwright tests are linted with `eslint-plugin-playwright` plus this repo's local `om-playwright` rules. Run before submitting: ```bash cd openmetadata-ui/src/main/resources/ui yarn lint:playwright ``` Every guardrail rule runs at `error` and none is merely advisory; the severity column is authoritative for anything else. The generated rule table (per-rule severity and description) lives in the handbook's **ESLint Enforcement** section; it's produced by `yarn generate:playwright-rules` from `eslint.config.mjs`, so it can't drift from what actually blocks CI. Pre-existing violations are tracked in `eslint-suppressions.json` — that ledger may shrink as violations are fixed, never grow. ## Mandatory verification Before reporting the work complete, run: ```bash cd openmetadata-ui/src/main/resources/ui && yarn lint:playwright ``` This must exit 0. Do not suppress a new violation to make it pass — suppressions are a record of pre-existing debt, and adding to them is a plan failure. Fix the test instead.
© open-metadata · Apache-2.0 · open-metadata/OpenMetadata