用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/TianQue6916/reasonix --skill webapp-testing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | webapp-testing |
| description | Playwright 自动化测试 — 端到端测试、截图对比、表单交互、响应式测试 |
基于 Playwright 的 Web 应用端到端测试。
npm init playwright@latest
# 或
pip install pytest-playwright
playwright install
| 模式 | 用途 |
|---|---|
| 功能测试 | 用户操作流程验证 |
| 截图对比 | 视觉回归检测 |
| 响应式测试 | 多尺寸截图 |
| 表单测试 | 输入/提交/验证 |
| API Mock | 接口模拟 |
| 性能 | Lighthouse 指标 |
const { test, expect } = require('@playwright/test');
test('用户登录流程', async ({ page }) => {
await page.goto('/login');
await page.fill('#email', 'user@example.com');
await page.fill('#password', 'password123');
await page.click('button[type="submit"]');
await expect(page.locator('.welcome')).toBeVisible();
});
test('首页视觉回归', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveScreenshot('homepage.png');
});
const devices = ['iPhone 13', 'iPad Pro 11', 'Desktop'];
for (const device of devices) {
test(`页面在 ${device} 上的显示`, async ({ browser }) => {
const context = await browser.newContext({ viewport: getViewport(device) });
const page = await context.newPage();
await page.goto('/');
await expect(page).toHaveScreenshot(`${device}.png`);
});
}