Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问clear审计异常

testing-e2e测试端到端

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

242

周安装

10

GitHub Stars

17

下载量

79
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:testing-e2e(测试端到端)
来源仓库:https://github.com/alexei-led/claude-code-config
仓库路径:skills/testing-e2e
安装命令:
npx skills add https://github.com/alexei-led/claude-code-config --skill testing-e2e
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/alexei-led/claude-code-config --skill testing-e2e

简介

用于辅助端到端测试设计与自动化验证,支持测试用例编写与失败日志分析。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中规划回归测试或定位功能问题。
  • 使用时需明确项目测试框架、运行命令及夹具数据来源,防止误改业务逻辑。
  • 安装方式:通过 npx skills add 命令从指定 GitHub 仓库添加,兼容主流宿主平台。
  • 涉及浏览器或外部服务调用时应区分模拟环境与生产环境,避免意外副作用。

SKILL.md

E2E Testing with Playwright

Execute E2E testing workflows using Playwright MCP.

Use TodoWrite to track these 4 phases:

  1. Determine action (parse args or ask)
  2. Execute action (run/record/generate/verify)
  3. Verify results
  4. Present output

Phase 1: Parse Arguments

$ARGUMENTS:

  • run → Run existing E2E tests
  • record → Record browser session for test generation
  • generate → Generate test from URL or page description
  • verify <feature> → Verify specific feature works in browser
  • (empty) → Ask what to do

If no argument provided, use AskUserQuestion:

HeaderQuestionOptions
ActionWhat E2E testing task to run?1. Run tests - Execute existing Playwright tests 2. Record - Record browser session 3. Generate - Create test from URL/description 4. Verify - Check feature

Phase 2: Execute Action

Run Tests

npx playwright test

For specific test:

npx playwright test login.spec.ts

For headed mode (visible browser):

npx playwright test --headed

Record Session

Use Playwright MCP tools for browser interaction:

  1. browser_navigate - Go to target URL
  2. browser_snapshot - Inspect page structure
  3. browser_click, browser_type, browser_fill_form - Interact
  4. Generate test file with Page Object pattern

Generate Test

Spawn playwright-tester agent:

Task(
  subagent_type="playwright-tester",
  description="Generate E2E test",
  prompt="Generate E2E test for:
  URL: {target URL}
  Flow: {user flow description}

  Requirements:
  - Use Page Object pattern
  - Use semantic locators (getByRole, getByLabel, getByText)
  - Include assertions for expected outcomes
  - No hardcoded waits (use waitFor patterns)
  - Include accessibility checks where appropriate"
)

Verify Feature

Spawn playwright-tester agent for feature verification:

Task(
  subagent_type="playwright-tester",
  description="Verify feature",
  prompt="Verify this feature works correctly in the browser:
  Feature: {feature description}

  Steps:
  1. Navigate to appropriate page
  2. Execute user flow
  3. Assert expected outcomes
  4. Report PASS/FAIL with evidence (screenshots if needed)"
)

Phase 3: Verify Results

npx playwright test --headed

If tests fail, review output and fix issues.


Phase 4: Output

E2E TESTING
===========
Action: {run|record|generate|verify}
Result: {outcome}
Tests: {pass/fail count}

Details:
- [test results or generation summary]

Key Tools

ToolPurpose
browser_navigateGo to URL
browser_snapshotGet accessibility tree
browser_clickClick elements
browser_typeType text
browser_fill_formFill form fields
browser_generate_locatorGet best locator
browser_verify_textAssert text content

Supported Stacks

  • TypeScript: Playwright Test with Page Objects
  • Go/HTMX: Test HTMX interactions, form submissions, partial updates

HTMX Testing Tips

  • Use browser_snapshot to verify DOM updates after HTMX swaps
  • Test hx-trigger, hx-swap, hx-target behaviors
  • Verify HX-* response headers in network requests
  • Assert partial page updates without full reload

Error Scenarios & Handling

Element Not Found

// BAD: Immediate failure
await page.click("#submit-btn");

// GOOD: Wait with timeout + fallback
const btn = page.locator("#submit-btn");
if ((await btn.count()) === 0) {
  // Try alternative selector
  await page.click('button[type="submit"]');
} else {
  await btn.click();
}

Recovery strategies:

  1. Use browser_snapshot to inspect current DOM state
  2. Try alternative locators (text, role, data-testid)
  3. Check if element is in iframe/shadow DOM
  4. Verify page loaded correctly (check URL, title)

Timeout Errors

ErrorCauseSolution
Navigation timeoutSlow page loadIncrease timeout, check network
Action timeoutElement not interactableWait for visibility/enabled state
Expect timeoutAssertion failedVerify DOM state with snapshot
// Configure timeouts
test.setTimeout(60000); // Test timeout
page.setDefaultTimeout(30000); // Action timeout

// Or per-action
await page.click("#btn", { timeout: 10000 });

Network Issues

// Wait for network idle
await page.waitForLoadState("networkidle");

// Mock failing endpoints
await page.route("**/api/**", (route) => {
  route.fulfill({ status: 500, body: "Server Error" });
});

Flaky Test Patterns

Avoid:

  • Fixed page.waitForTimeout(1000) delays
  • Brittle selectors like .btn-23
  • Tests depending on animation timing

Prefer:

  • waitForSelector, waitForLoadState
  • Role/text-based selectors: getByRole('button', {name: 'Submit'})
  • Retry patterns for known flaky operations

Debugging Failed Tests

  1. Get snapshot: browser_snapshot shows accessibility tree
  2. Screenshot: Capture current visual state
  3. Console logs: Check browser console for JS errors
  4. Network tab: Verify API calls succeeded
  5. Trace: Enable Playwright trace for post-mortem
# Run with trace
npx playwright test --trace on

# View trace
npx playwright show-trace trace.zip

Execute E2E testing workflow now.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

28.85%
按下载量换算23

Claude Code

24.58%
按下载量换算19

Gemini CLI

17.98%
按下载量换算14

windsurf

11.49%
按下载量换算9

OpenCode

8.26%
按下载量换算7

Antigravity

3.86%
按下载量换算3

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills