一键导入
e2e-testing
Write end-to-end tests using Playwright. Test user behavior, not implementation details. Also useful for non-test Playwright scripting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write end-to-end tests using Playwright. Test user behavior, not implementation details. Also useful for non-test Playwright scripting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Drive the project's task list unattended — pick the next dependency-unblocked task, dispatch a task-worker subagent to complete it, self-verify the result, then loop. Use when the user wants to work through tasks.md sequentially without supervision (e.g. overnight runs). By default continues past isolated task failures (parks the failed work non-destructively, skips its dependents, keeps going) and trips a circuit breaker only on systemic failure; pass --strict for stop-on-first-failure.
Migrate an npm package from long-lived NPM_TOKEN credentials to OIDC trusted publishing on GitHub Actions, with npm provenance attestations. Use this skill whenever the user mentions migrating to trusted publishing, eliminating NPM_TOKEN, setting up OIDC for npm, adding provenance attestations, publishing from CI without a token, or converting an existing release workflow to use a trusted publisher — even if they describe it in their own words like "get rid of the npm token" or "publish from GitHub Actions securely". Also use it proactively when reviewing a release workflow that still uses `NODE_AUTH_TOKEN`/`NPM_TOKEN` and the user is auditing CI secrets.
Write React components following idiomatic patterns, hooks best practices, and performance optimizations
Write React components designed to be easily tested with Playwright and Testing Library — semantic HTML, clear boundaries, no test-specific hacks
Write StyleX styles correctly — longhand properties, nested pseudo-classes/media queries, no shorthands
Execute test suites and report results. Runs unit tests (yarn test) and E2E tests (yarn e2e) without modifying code. Use when asked to run tests, check if tests pass, or get a test report.
| name | e2e-testing |
| description | Write end-to-end tests using Playwright. Test user behavior, not implementation details. Also useful for non-test Playwright scripting. |
Test what users see and do, never implementation details. Every selector choice should be semantic.
| Priority | Method | Use when |
|---|---|---|
| 1 | getByRole('button', { name: /submit/i }) | Any semantic element |
| 2 | getByLabel('Email') | Form inputs |
| 3 | getByPlaceholder(...) | Inputs without labels |
| 4 | getByAltText(...) | Images |
| 5 | getByTitle(...) | Icon buttons with no text |
| 6 | getByTestId(...) | Last resort only |
| 7 | getByText(...) | Non-interactive text only |
| ❌ | locator('.class') / XPath | Never |
await expect)await expect(page.getByRole('button', { name: 'Save' })).toBeVisible()
await expect(page.getByLabel('Email')).toHaveValue('user@example.com')
await expect(page.getByRole('checkbox')).toBeChecked()
await expect(page.getByRole('listitem')).toHaveCount(5)
await expect(page).toHaveURL('/dashboard')
Never use waitForTimeout() or waitForSelector() — await expect() auto-retries.
beforeEach for common setup within a suiteafterEach for cleanup (prefer API calls over UI)waitForTimeout() / arbitrary sleeps