test-automator by 404kidwiz/claude-supercode-skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill test-automator提供自动化测试专业知识,专注于使用 Playwright、Cypress 和 AI 驱动测试工具的端到端测试框架。构建可靠、可维护的自动化测试套件,集成到包含视觉回归测试的 CI/CD 流水线中。
场景: 从零开始构建一个可维护的 E2E 测试框架。
实施:
结果:
场景: 测试复杂的支付网关集成。
实施:
结果:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
场景: 防止设计密集型应用程序中的 UI 回归。
实施:
结果:
| 需求 | 工具推荐 | 原因 |
|---|---|---|
| 现代 Web(React/Vue) | Playwright | 最快、可靠的定位器、多标签页支持。 |
| 遗留/简单 | Cypress | 优秀的开发者体验,但速度较慢且单标签页限制。 |
| 视觉测试 | Percy / Chromatic | 像素级差异(SaaS)。 |
| 移动原生 | Appium / Maestro | 真实设备自动化。 |
| 组件测试 | Playwright CT / Vitest | 无需完整应用堆栈即可渲染组件。 |
危险信号 → 升级到 devops-engineer:
目标: 使用 TypeScript 初始化一个健壮的 E2E 套件。
步骤:
安装
npm init playwright@latest
# 选择:TypeScript, GitHub Actions, Install Browsers
配置(playwright.config.ts)
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
video: 'retain-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
],
});
第一个测试(tests/login.spec.ts)
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/My App/);
});
test('login flow', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('password');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page).toHaveURL('/dashboard');
});
目标: 直接验证后端端点(比 UI 更快)。
步骤:
API 上下文
test('create user via API', async ({ request }) => {
const response = await request.post('/api/users', {
data: {
name: 'Test User',
email: `test-${Date.now()}@example.com`
}
});
expect(response.ok()).toBeTruthy();
const body = await response.json();
expect(body.id).toBeDefined();
});
目标: 在 5 分钟内运行 500 个测试(而不是 50 分钟)。
步骤:
GitHub Actions 策略
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
运行命令
npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
合并报告
blob-report 工件。npx playwright merge-reports --reporter html ./all-blob-reports。表现:
await page.waitForTimeout(5000);失败原因:
正确方法:
await expect(locator).toBeVisible();。await page.waitForURL()。表现:
失败原因:
正确方法:
表现:
page.locator('.btn-primary')失败原因:
正确方法:
getByRole('button', { name: 'Submit' }), getByLabel('Email'), getByTestId('submit-btn')。可靠性:
main 分支中不允许有不稳定的测试。如果不稳定则隔离。可维护性:
覆盖率:
每周安装数
57
代码仓库
GitHub 星标数
43
首次出现
Jan 24, 2026
安全审计
安装于
opencode46
claude-code44
codex43
gemini-cli41
cursor37
github-copilot36
Provides automated testing expertise specializing in end-to-end test frameworks using Playwright, Cypress, and AI-driven testing tools. Builds reliable, maintainable automated test suites integrated into CI/CD pipelines with visual regression testing.
Scenario: Building a maintainable E2E test framework from scratch.
Implementation:
Results:
Scenario: Testing complex payment gateway integrations.
Implementation:
Results:
Scenario: Preventing UI regressions in a design-heavy application.
Implementation:
Results:
| Requirement | Tool Recommendation | Why? |
|---|---|---|
| Modern Web (React/Vue) | Playwright | Fastest, reliable locators, multi-tab support. |
| Legacy / Simple | Cypress | Great DX, but slower and single-tab limit. |
| Visual Testing | Percy / Chromatic | Pixel-perfect diffs (SaaS). |
| Mobile Native | Appium / Maestro | Real device automation. |
| Component Testing | Playwright CT / Vitest | Render components without full app stack. |
Red Flags → Escalate todevops-engineer:
Goal: Initialize a robust E2E suite with TypeScript.
Steps:
Installation
npm init playwright@latest
# Select: TypeScript, GitHub Actions, Install Browsers
Configuration (playwright.config.ts)
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
video: 'retain-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
],
});
First Test (tests/login.spec.ts)
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/My App/);
});
test('login flow', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('password');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page).toHaveURL('/dashboard');
});
Goal: Verify backend endpoints directly (faster than UI).
Steps:
API Context
test('create user via API', async ({ request }) => {
const response = await request.post('/api/users', {
data: {
name: 'Test User',
email: `test-${Date.now()}@example.com`
}
});
expect(response.ok()).toBeTruthy();
const body = await response.json();
expect(body.id).toBeDefined();
});
Goal: Run 500 tests in 5 minutes (instead of 50).
Steps:
GitHub Actions Strategy
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
Run Command
npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
Merge Reports
blob-report artifact from each shard.npx playwright merge-reports --reporter html ./all-blob-reports.What it looks like:
await page.waitForTimeout(5000);Why it fails:
Correct approach:
await expect(locator).toBeVisible();.await page.waitForURL().What it looks like:
Why it fails:
Correct approach:
What it looks like:
page.locator('.btn-primary')Why it fails:
Correct approach:
getByRole('button', { name: 'Submit' }), getByLabel('Email'), getByTestId('submit-btn').Reliability:
main. Quarantined if flaky.Maintainability:
Coverage:
Weekly Installs
57
Repository
GitHub Stars
43
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode46
claude-code44
codex43
gemini-cli41
cursor37
github-copilot36
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
138,800 周安装