Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计通过

qa-testing-playwrightQA 测试 Playwright

Agent Skill

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

总安装

7,848

周安装

327

GitHub Stars

59

下载量

2,616
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill qa-testing-playwright

简介

用于辅助测试设计、自动化测试、用例整理和回归验证。

  • 适合编写单元测试、端到端测试、测试计划或根据失败日志定位问题。
  • 使用时需确认项目测试框架、运行命令和夹具数据,避免为通过测试而改坏真实逻辑。
  • 涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。
  • 安装前建议确认权限范围和维护状态,以及是否会触发联网或文件读写。

SKILL.md

QA Testing (Playwright)

High-signal, cost-aware E2E testing for web applications.

Core docs:

Defaults (2026)

  • Keep E2E thin: protect critical user journeys only; push coverage down (unit/integration/contract).
  • Locator priority: getByRolegetByLabel/getByTextgetByTestId (fallback).
  • Waiting: rely on Playwright auto-wait + web-first assertions; no sleeps/time-based waits.
  • Isolation: tests must run alone, in parallel, and in any order; eliminate shared mutable state.
  • Flake posture: retries are a debugging tool; treat rerun-pass as a failure signal and fix root cause.
  • CI posture: smoke gate on PRs; shard/parallelize regression on schedule; always keep artifacts (trace/video/screenshot).

Quick Start

CommandPurpose
npm init playwright@latestInitialize Playwright
npx playwright testRun all tests
npx playwright test --grep @smokeRun smoke tests
npx playwright test --project=chromiumRun a single project
npx playwright test --uiDebug with UI mode
npx playwright test --debugStep through a test
npx playwright show-trace trace.zipInspect trace artifacts
npx playwright show-reportInspect HTML report

When to Use

  • E2E tests for web applications
  • Test user authentication flows
  • Verify form submissions
  • Test responsive designs
  • Automate browser interactions
  • Set up Playwright in CI/CD

When NOT to Use

ScenarioUse Instead
Unit testingJest, Vitest, pytest
API contractsqa-api-testing-contracts
Load testingk6, Locust, Artillery
Mobile nativeAppium

Authoring Rules

Locator Strategy

// 1. Role locators (preferred)
await page.getByRole('button', { name: 'Sign in' }).click();

// 2. Label/text locators
await page.getByLabel('Email').fill('user@example.com');

// 3. Test IDs (fallback)
await page.getByTestId('user-avatar').click();

Flake Control

  • Avoid sleeps; use Playwright auto-wait
  • Use retries as signal, not a crutch
  • Capture trace/screenshot/video on failure
  • Prefer user-like interactions; avoid force: true

Workflow

  • Write the smallest test that proves the user outcome (intent + oracle).
  • Stabilize locators and assertions before adding more steps.
  • Make state explicit: seed per test/worker, clean up deterministically, mock third-party boundaries.
  • In CI: shard/parallelize, capture artifacts, and fail fast on rerun-pass flakes.

Debugging Checklist

If something is flaky:

  • Open trace first; identify whether it is selector ambiguity, missing wait, or state leakage.
  • Replace brittle selectors with semantic locators; replace sleeps with expect(...) or a targeted wait.
  • Reduce global timeouts; add scoped timeouts only when the product truly needs it.
  • If it only fails in CI, look for concurrency, cold-start, CPU starvation, and environment differences.

Do / Avoid

  • Make tests independent and deterministic
  • Use network mocking for third-party deps
  • Run smoke E2E on PRs; full regression on schedule
  • "Test everything E2E" as default
  • Weakening assertions to "fix" flakes
  • Auto-healing that weakens assertions

Execution Preflight (High ROI)

Run this preflight before expensive E2E runs to prevent avoidable failures.

Preflight Checklist

  1. Repository shape:
  • Confirm working directory and expected app root exist.
  • Verify spec paths before execution (rg --files tests/e2e | rg <target>).
  1. Port/process hygiene:
  • Check and clear stale dev server port before run (example: lsof -i:3001).
  • Avoid parallel local servers colliding with Playwright webServer.
  1. Command validity:
  • Validate CLI flags for current tool versions before batch runs.
  • Prefer exact spec paths or --grep over broad globs during triage.
  1. Artifact expectations:
  • Confirm result artifact paths exist before reading (test -f <error-context.md>).
  • If artifact path missing, inspect latest test-results index first.

Mandatory Sandbox/Port Decisions

Before running Playwright in constrained environments (sandboxed terminals, CI containers, shared dev hosts), decide and document:

  • Bind host/port: confirm whether app server must use 127.0.0.1 or 0.0.0.0, and verify selected port is free.
  • Escalation path: if bind attempts fail with EPERM/EACCES, escalate immediately instead of retry loops.
  • Long-flow timeout budget: set explicit per-test timeout for API-heavy flows (generation/checkout/report) instead of inflating global timeout.
  • Build lock hygiene: clear stale .next/lock and terminate stale build/dev PIDs before rerun.

Triage Sequence (Fastest Signal)

  1. Reproduce one failing test with --workers=1.
  2. Capture trace/video/screenshot for that single failure.
  3. Fix determinism root cause.
  4. Re-run targeted suite.
  5. Only then run broad regression.

Failure Patterns to Treat as Environment, Not Product Bugs

  • EADDRINUSE on Playwright web server port
  • Missing spec/result paths from stale assumptions
  • Shell glob expansion failures for bracketed route segments

Resources

ResourcePurpose
references/playwright-mcp.mdMCP & AI testing
references/playwright-patterns.mdAdvanced patterns
references/playwright-ci.mdCI configurations
references/playwright-authentication.mdAuth patterns and session management
references/visual-regression-testing.mdVisual regression strategies
references/api-testing-playwright.mdAPI testing with APIRequestContext
references/playwright-preflight-sandbox.mdSandbox/port preflight and escalation decisions
data/sources.jsonDocumentation links

Templates

TemplatePurpose
assets/template-playwright-e2e-review-checklist.mdE2E review checklist
assets/template-playwright-fail-on-flaky-reporter.jsFail CI on rerun-pass flakes
assets/template-playwright-preflight-checklist.mdPreflight checklist for port/sandbox/timeouts

Related Skills

SkillPurpose
qa-testing-strategyOverall test strategy
software-frontendFrontend development
ops-devops-platformCI/CD integration

Fact-Checking

  • Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
  • Prefer primary sources; report source links and dates for volatile information.
  • If web access is unavailable, state the limitation and mark guidance as unverified.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

28.4%
按下载量换算743

Gemini CLI

23.2%
按下载量换算607

Cursor

16.21%
按下载量换算424

Codex

13.44%
按下载量换算352

Antigravity

7.75%
按下载量换算203

OpenCode

3.25%
按下载量换算85

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills