AI Agent Hub
Back to skills
💻

Playwright Test Automation Assistant

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @org-02qudk26/playwright-skill-zh by following https://skillhub.cn/install/skillhub.md.

About this skill

Problem Solved

Playwright tests often become brittle in real projects: page.waitForTimeout(), raw CSS/XPath, shared state between tests, and local passes that miss cloud device combinations. This skill breaks the request into explicit decisions: local or cloud execution, target language, and whether the output should be a one-off script or a full test suite, so generated tests are easier to maintain.

How It Works

It works in three steps:
- Execution target: default to local when cloud, real devices, or cross-browser needs are not mentioned; route to cloud or specialized capabilities when signals like TestMu, LambdaTest, or HyperExecute appear.
- Language detection: default to TypeScript, with JavaScript, Python, Java, and C# patterns available by language.
- Scope selection: one-off scripts produce a standalone file; existing projects follow current conventions; new suites use scaffolding; flaky tests enter a debugging checklist.
Core practices emphasize Web-First assertions and selector priority: prefer getByRole(), getByLabel(), getByPlaceholder(), and getByText(), using getByTestId() only as a fallback. For projects with more than three tests, POM is recommended, with patterns for auth reuse, network mocking, visual regression, mobile testing, API testing, and CI sharding.

Boundary

Best for front-end or full-stack teams that need E2E test automation. When the focus is large-scale parallelism, dedicated visual regression, or real mobile devices, the skill points to the relevant references or specialized skills instead of forcing every case into local scripts.

Use Cases

  • Write Playwright E2E tests for login, checkout, and other critical flows
  • Debug flaky specs caused by hard waits and shared test state
  • Refactor brittle tests to role selectors and Web-First assertions
  • Configure cloud execution for local-impossible browser and OS combos

Best For

  • Front-end engineers maintaining E2E suites and needing stable selectors and assertions
  • Test engineers migrating local Playwright to TestMu or LambdaTest cloud execution
  • Engineers maintaining polyglot repos who need TypeScript, Python, or Java test patterns
  • QA engineers fixing flaky CI tests using a structured debugging checklist