用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ariadoss/superskills --skill playwright命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Use when executing implementation plans with independent tasks in the current session
基于 SOC 职业分类
正在显示 SKILL.md
| name | playwright |
| description | End-to-end testing with Playwright — generate, run, and debug E2E tests. |
| allowed-tools | ["Bash","Read","Write","Edit","Grep","Glob"] |
Generate and run Playwright end-to-end tests for web applications.
npx playwright --version
If not installed:
npm init playwright@latest
# or add to existing project:
npm install -D @playwright/test && npx playwright install
Read the source files for the page/component to test. Understand routes, interactive elements, and expected behaviors.
Create a test file following the project's existing patterns and directory structure.
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
// Setup: navigate, authenticate, seed data
});
test('should do expected behavior', async ({ page }) => {
// Arrange
// Act
// Assert
});
});
npx playwright test <file> # Run specific test file
npx playwright test --headed # With visible browser
npx playwright test --ui # Playwright UI mode
npx playwright test --trace on # Capture trace for debugging
--trace on and open trace viewer: npx playwright show-trace trace.zipawait page.screenshot({ path: 'debug.png' })page.pause() for step-by-step debugging in headed modepage.goto(), URL assertions, redirect verificationpage.fill(), page.selectOption(), page.check(), multi-step wizardsexpect(page).toHaveURL(), expect(locator).toBeVisible(), toHaveText()page.screenshot(), full-page, element-levelexpect(page).toHaveScreenshot() with thresholds@axe-core/playwright, ARIA role selectors, keyboard navigationpage.route() for mocking, page.waitForResponse() for API callsdata-testid attributes for stable selectorstest.step() for complex multi-step flowsbaseURL in playwright.config.tspage.waitForResponse() for async navigation