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

e2e-testing端到端测试

Agent Skill

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

总安装

360

周安装

15

GitHub Stars

160

下载量

120
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill e2e-testing

简介

基于 Playwright 1.58+ 实现 AI 辅助的关键用户旅程端到端验证。

  • 推荐使用语义化定位器(如 getByRole、getByLabel),避免脆弱的选择器。
  • 支持网络拦截、文件上传与认证状态管理等高级场景。
  • 测试应聚焦产品行为而非 UI 状态,确保功能正确性优先于视觉呈现。
  • e2e-testing 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

E2E Testing with Playwright 1.58+

Validate critical user journeys end-to-end with AI-assisted test generation.

Quick Reference - Semantic Locators

// PREFERRED: Role-based locators (most resilient)
await page.getByRole('button', { name: 'Add to cart' }).click();
await page.getByRole('link', { name: 'Checkout' }).click();

// GOOD: Label-based for form controls
await page.getByLabel('Email').fill('test@example.com');

// ACCEPTABLE: Test IDs for stable anchors
await page.getByTestId('checkout-button').click();

// AVOID: CSS selectors and XPath (fragile)
// await page.click('[data-testid="add-to-cart"]');

Locator Priority: getByRole() > getByLabel() > getByPlaceholder() > getByTestId()

Basic Test

import { test, expect } from '@playwright/test';

test('user can complete checkout', async ({ page }) => {
  await page.goto('/products');
  await page.getByRole('button', { name: 'Add to cart' }).click();
  await page.getByRole('link', { name: 'Checkout' }).click();
  await page.getByLabel('Email').fill('test@example.com');
  await page.getByRole('button', { name: 'Submit' }).click();
  await expect(page.getByRole('heading', { name: 'Order confirmed' })).toBeVisible();
});

AI Agents (1.58+)

Initialize AI Agents

# Initialize agents for your preferred AI tool
npx playwright init-agents --loop=claude    # For Claude Code
npx playwright init-agents --loop=vscode    # For VS Code (requires v1.105+)
npx playwright init-agents --loop=opencode  # For OpenCode

Generated Structure

Running init-agents creates the following:

Directory/FilePurpose
.github/Agent definitions and configuration
specs/Test plans in Markdown format
tests/seed.spec.tsSeed file for AI agents to reference

Working with AI Agents

After initialization, agents can:

  • Read test plans from specs/ and generate tests
  • Use seed.spec.ts as a template for consistent patterns
  • Auto-repair failing tests by analyzing failures

Breaking Changes (1.58)

The following features have been removed in Playwright 1.58:

RemovedMigration
_react selectorUse getByRole() or getByTestId()
_vue selectorUse getByRole() or getByTestId()
:light selector suffixUse standard CSS selectors without :light
devtools launch optionUse args: ['--auto-open-devtools-for-tabs'] instead
macOS 13 WebKit supportUpgrade to macOS 14+ for WebKit testing

Migration Examples

// Before (1.57 and earlier)
await page.locator('_react=MyComponent').click();
await page.locator('.card:light').click();

// After (1.58+)
await page.getByTestId('my-component').click();
await page.locator('.card').click();

// DevTools launch option
// Before
const browser = await chromium.launch({ devtools: true });

// After
const browser = await chromium.launch({
  args: ['--auto-open-devtools-for-tabs']
});

New Features (1.58+)

// Connect over CDP with local flag
const browser = await chromium.connectOverCDP({
  endpointURL: 'http://localhost:9222',
  isLocal: true  // NEW: Optimizes for local connections
});

// Assert individual class names
await expect(page.locator('.card')).toContainClass('highlighted');

// Flaky test detection
export default defineConfig({
  failOnFlakyTests: true,
});

// IndexedDB storage state
await page.context().storageState({
  path: 'auth.json',
  indexedDB: true  // Include IndexedDB in storage state
});

Timeline in Speedboard HTML Reports

HTML reports now include a timeline visualization showing:

  • Test execution sequence
  • Parallel test distribution
  • Time spent in each test phase
  • Performance bottlenecks
// Enable HTML reporter with timeline
export default defineConfig({
  reporter: [['html', { open: 'never' }]],
});

Anti-Patterns (FORBIDDEN)

// NEVER use CSS selectors for user interactions
await page.click('.submit-btn');

// NEVER use hardcoded waits
await page.waitForTimeout(2000);

// NEVER test implementation details
await page.click('[data-testid="btn-123"]');

// ALWAYS use semantic locators
await page.getByRole('button', { name: 'Submit' }).click();

// ALWAYS use Playwright's auto-wait
await expect(page.getByRole('alert')).toBeVisible();

Key Decisions

DecisionRecommendation
LocatorsgetByRole > getByLabel > getByTestId
BrowserChromium (Chrome for Testing in 1.58+)
Execution5-30s per test
Retries2-3 in CI, 0 locally
ScreenshotsOn failure only

Critical User Journeys to Test

  1. Authentication: Signup, login, password reset
  2. Core Transaction: Purchase, booking, submission
  3. Data Operations: Create, update, delete
  4. User Settings: Profile update, preferences

Detailed Documentation

ResourceDescription
references/playwright-1.57-api.mdComplete Playwright API reference
examples/test-patterns.mdUser flows, page objects, visual tests
checklists/e2e-checklist.mdTest selection and review checklists
scripts/page-object-template.tsPage object model template

Related Skills

  • integration-testing - API-level testing
  • webapp-testing - Autonomous test agents
  • performance-testing - Load testing
  • llm-testing - Testing AI/LLM components

Capability Details

semantic-locators

Keywords: getByRole, getByLabel, getByText, semantic, locator Solves:

  • Use accessibility-based locators
  • Avoid brittle CSS/XPath selectors
  • Write resilient element queries

visual-regression

Keywords: visual regression, screenshot, snapshot, visual diff Solves:

  • Capture and compare visual snapshots
  • Detect unintended UI changes
  • Configure threshold tolerances

cross-browser-testing

Keywords: cross browser, chromium, firefox, webkit, browser matrix Solves:

  • Run tests across multiple browsers
  • Configure browser-specific settings
  • Handle browser differences

ai-test-generation

Keywords: AI test, generate test, autonomous, test agent, planner, init-agents Solves:

  • Generate tests from user journeys
  • Use AI agents for test planning
  • Create comprehensive test coverage

ai-test-healing

Keywords: test healing, self-heal, auto-fix, resilient test Solves:

  • Automatically fix broken selectors
  • Adapt tests to UI changes
  • Reduce test maintenance

authentication-state

Keywords: auth state, storage state, login once, reuse session, indexedDB Solves:

  • Persist authentication across tests
  • Avoid repeated login flows
  • Share auth state between tests

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

29.77%
按下载量换算36

windsurf

21.17%
按下载量换算25

Gemini CLI

15.88%
按下载量换算19

Antigravity

11.86%
按下载量换算14

OpenCode

7.64%
按下载量换算9

trae

3.13%
按下载量换算4

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills