Agent skill

Fix Failing Playwright Spec

by appsmithorg in appsmithorg/appsmith

Fixes failing Playwright specs by reading the error, classifying the cause in the test code and applying corrections that follow project conventions.

Apache-2.0Auto-check passedTesting & QA

Install Fix Failing Playwright Spec

skills CLI
$ npx skills add appsmithorg/appsmith --skill fix-pw-spec -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install appsmithorg/appsmith fix-pw-spec --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/appsmithorg/appsmith.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/fix-pw-spec .claude/skills/fix-pw-spec && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fix-pw-spec
GitHub stars
41k
Token cost
~1.3k tokens
SKILL.md length
449 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Fixes failing Playwright specs by reading the error, classifying the cause in the test code and applying corrections that follow project conventions.

  • Works in 5 steps: Gather Failure Context → Classify the Error → Fix Using Conventions → …
  • A Playwright test fails because of selectors, waits or assertions
  • SKILL.md covers When to Use, Step 1 — Gather Failure Context, Step 2 — Classify the Error and Step 3 — Fix Using Conventions, plus 3 more sections
  • Calls npx

What it does

The skill is for bugs in test code, not in the product: wrong selectors, bad waits, incorrect assertions and code errors. It gathers the Playwright error output, the failing spec and the trace or screenshots from the results folder. If the product itself is broken, it hands off to the separate diagnose-pw-failure skill.

A table classifies error patterns and pairs each with a fix. Timeouts waiting for a locator mean updating the selector, strict mode violations call for .first(), .nth() or a tighter locator, wrong expected text means checking the target element and test data, closed targets or failed navigation need waitForResponse or waitForURL, hidden elements need the right state or scrolling, and import errors need path fixes. ECONNREFUSED and net errors are deployment issues the spec cannot fix. Selector replacements follow a priority from getByRole, getByPlaceholder and getByTestId to the project's widget selector constants, with CSS selectors last.

When your agent uses it

  • A Playwright test fails because of selectors, waits or assertions
  • Fixing a flaky Playwright spec
  • Interpreting a strict mode violation or a locator timeout

Example prompts

  • “This Playwright spec is failing with a locator timeout. Find out why and fix it.”
  • “Fix the flaky test in the datasources spec.”
  • “Here is the trace folder from the failed run. Work out whether the spec or the product is wrong.”

Requirements

  • A Playwright test setup with the failing spec and its error output

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Gather Failure Context
  2. Classify the Error
  3. Fix Using Conventions
  4. Re-run and Verify
  5. Validate Fix Quality

What it can do on your machine

Read from SKILL.md and the folder at commit 552488b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fix Failing Playwright Spec loads about 1.3k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 449 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from appsmithorg/appsmith at commit 552488b, republished under its Apache-2.0 licence (© appsmithorg). 449 words, ~1,256 tokens.

Download SKILL.mdSave it as .claude/skills/fix-pw-spec/SKILL.md (or your agent's skills folder).
name
fix-pw-spec
description
Fix a failing Playwright spec by analyzing error output, identifying the root cause in the test code, and applying corrections. Use when a Playwright test fails due to wrong selectors, bad waits, incorrect assertions, or code errors. Trigger phrases: "fix this playwright test", "this spec is failing", "playwright test broken", "fix the flaky test".

Fix Failing Playwright Spec

When to Use

This skill fixes test code bugs — not product bugs. Use it when:

  • A spec you wrote (or someone else wrote) fails due to selectors, waits, or assertion logic
  • The product behavior is correct but the test doesn't match it
  • Playwright reports timeouts, strict mode violations, or wrong expected values

If the product itself is broken, use diagnose-pw-failure instead.

Step 1 — Gather Failure Context

Read these three things:

  1. The Playwright error output from the terminal (the test run output)
  2. The spec file that failed
  3. The trace or screenshot if available:
    • Traces: app/client/playwright/results/<test-path>/trace.zip
    • Screenshots: app/client/playwright/results/<test-path>/*.png

Step 2 — Classify the Error

Error patternRoot causeFix
Timeout waiting for locator("...")Selector doesn't match any elementInspect the actual page; update selector
strict mode violation: locator resolved to N elementsLocator too broadAdd .first(), .nth(), or refine with chained locators
expect(received).toHaveText("X") received "Y"Wrong expected value OR wrong elementVerify which element you're targeting; update expected value if test data changed
Target closed / page.goto: Navigation failedPage navigated away before action completedAdd waitForResponse or waitForURL before the action
locator.click: Element is not visibleElement exists but hidden (behind modal, off-screen)Wait for the right state, scroll into view, or close blocking elements
Cannot find module / TypeScript errorImport path wrong or missing exportFix the import path; check that POM/helper exports the symbol
ECONNREFUSED / net::ERR_*Not a spec bug — deployment issueStop. This is not fixable in the spec.

Step 3 — Fix Using Conventions

When fixing, follow the project conventions (from .cursor/rules/playwright.mdc):

Show full SKILL.md (189 more words)Show less
Selector fixes

Prefer this priority order when replacing a broken selector:

  1. page.getByRole("button", { name: /submit/i }) — best
  2. page.getByPlaceholder("Search...") — for inputs without proper label association
  3. page.getByTestId("my-element") — explicit contract
  4. page.locator(SELECTORS.widgetInDeployed("text")) — Appsmith widget selectors from constants
  5. CSS selector with comment — last resort only

Do not: Guess selectors. If unsure what's on the page, add a temporary await page.pause() or read the component source to find the actual DOM structure.

Wait fixes

Replace any hard waits or networkidle with specific conditions:

typescript
// Instead of waitForTimeout or networkidle, wait for the element:
await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible();

// For mutations, wait for the API response:
const response = page.waitForResponse(r => r.url().includes(API.actionsExecute));
await page.getByRole("button", { name: "Save" }).click();
await response;
Assertion fixes

Ensure all assertions use the auto-retrying form:

typescript
// WRONG — non-retrying
expect(await locator.textContent()).toBe("value");

// RIGHT — auto-retrying
await expect(locator).toHaveText("value");

Step 4 — Re-run and Verify

After fixing, re-run the specific test:

bash
cd app/client && npx playwright test <spec-file> --project=<project>

If it still fails, go back to Step 2 with the new error output.

Budget: Max 3 fix attempts per failure. After 3, either:

  • The spec is fundamentally wrong (rewrite from scratch)
  • The product has a bug (switch to diagnose-pw-failure)

Step 5 — Validate Fix Quality

Before declaring the fix done, check:

  • No networkidle introduced
  • No waitForTimeout introduced
  • No hardcoded API URLs or CSS selectors
  • Assertions use auto-retrying expect
  • No unused imports left behind
  • Run npx eslint <file> --ext .ts clean

Output

Summarize what was wrong and what was fixed:

## Spec Fix Summary

**File**: playwright/tests/sanity/widgets/table-filter.spec.ts
**Attempts**: 2

### Fix 1
- **Error**: Timeout waiting for locator `getByRole("button", { name: "Filter" })`
- **Cause**: Button text is "Add Filter", not "Filter"
- **Fix**: Updated to `getByRole("button", { name: /add filter/i })`

### Fix 2
- **Error**: strict mode violation on `.first()` table row
- **Cause**: Filter hadn't applied yet when assertion ran
- **Fix**: Added `waitForResponse` on the execute API before asserting row content

**Result**: PASS

© appsmithorg, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/fix-pw-spec of appsmithorg/appsmith.

Open the folder on GitHubat commit 552488b

Compare with similar skills

Fix Failing Playwright Spec next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fix Failing Playwright Spec compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fix Failing Playwright Spec this skillappsmithorg/appsmith41k—~1.3kAutomated safety check: PassApache-2.0
Debug E2E Testbitovi/ai-enablement-prompts121—~677Automated safety check: PassMIT
Cucumber and Playwright E2E Testslanggenius/dify158k—~682Automated safety check: PassCustom licence
Debug Playwright Prowquay/quay2.8k—~2.2kAutomated safety check: PassApache-2.0
Testingkortix-ai/suna20k—~3.6kAutomated safety check: NotesCustom licence
Debugging Opik E2E Testscomet-ml/opik22k—~1.8kAutomated safety check: PassApache-2.0

Similar skills

  • Debug E2E Test

    bitovi/ai-enablement-prompts

    Debug and fix failing Playwright E2E tests. An agent skill from bitovi/ai-enablement-prompts.

    121 GitHub stars~677 tokensUpdated 27 days ago
    Testing & QAAuto-check passed
  • Guides changes and reviews of the Cucumber and Playwright end-to-end suite under `e2e/`: feature files, step definitions, support code, tags, locators and assertions.

    158k GitHub stars~682 tokensUpdated today
    Testing & QAAuto-check passed
  • Deep-dive diagnosis of a Playwright test failure already isolated to one Quay Prow/OpenShift CI run: downloads its GCS artifacts (results.json, JUnit, build/pod logs, Jaeger traces), classifies real…

    2.8k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing

    kortix-ai/suna

    A skill your agent uses for every Kortix test task, behavior change, bug fix, refactor, API route change, CLI change, SDK change, browser journey, test failure, coverage question, local benchmark…

    20k GitHub stars~3.6k tokensUpdated today
    Testing & QAAuto-check: notes
  • Investigates a failed Opik end-to-end test from CI, TestOps or a local run, decides regression versus flake, and proposes a fix without editing tests.

    22k GitHub stars~1.8k tokensUpdated today
    Testing & QAAuto-check passed
  • Diagnose any Quay Prow job failure end to end: prowjob.json - top-level build log - JUnit - resolved failing step - Playwright results.json when the failing step is Playwright, continuing through…

    2.8k GitHub stars~2.9k tokensUpdated today
    Testing & QAAuto-check passed

More from appsmithorg/appsmith

  • Writes a Playwright end-to-end test from a prompt, runs it against a live Appsmith deployment and retries with fixes up to three times until it passes.

    41k GitHub stars~2.9k tokensUpdated today
    Auto-check: notes
  • Investigates a stubbornly failing Playwright test as a possible product bug, using error output, screenshots, traces and server code, and writes a structured bug report.

    41k GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Fix Failing Playwright Spec

What does Fix Failing Playwright Spec do?

Fixes failing Playwright specs by reading the error, classifying the cause in the test code and applying corrections that follow project conventions. The skill is for bugs in test code, not in the product: wrong selectors, bad waits, incorrect assertions and code errors. It gathers the Playwright error output, the failing spec and the trace or screenshots from the results folder.

When should I use Fix Failing Playwright Spec?

Fix Failing Playwright Spec fits situations like: A Playwright test fails because of selectors, waits or assertions; fixing a flaky Playwright spec; interpreting a strict mode violation or a locator timeout.

How do I install Fix Failing Playwright Spec in Claude Code?

Run `npx skills add appsmithorg/appsmith --skill fix-pw-spec -a claude-code`. Or copy the skill folder (.cursor/skills/fix-pw-spec in appsmithorg/appsmith) into .claude/skills/fix-pw-spec in your project. Claude Code loads it when a task matches its description.

How do I install Fix Failing Playwright Spec in Codex?

Run `npx skills add appsmithorg/appsmith --skill fix-pw-spec -a codex`. Or copy the skill folder (.cursor/skills/fix-pw-spec in appsmithorg/appsmith) into .agents/skills/fix-pw-spec in your project. Codex loads it when a task matches its description.

Can I use Fix Failing Playwright Spec in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add appsmithorg/appsmith --skill fix-pw-spec -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fix-pw-spec, .gemini/skills/fix-pw-spec, .github/skills/fix-pw-spec and .opencode/skills/fix-pw-spec in your project.

What does Fix Failing Playwright Spec need to run?

Going by SKILL.md and its folder, Fix Failing Playwright Spec needs the command-line tools its instructions call (npx). Our summary lists: A Playwright test setup with the failing spec and its error output.

Does Fix Failing Playwright Spec access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Fix Failing Playwright Spec safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fix Failing Playwright Spec use?

Fix Failing Playwright Spec is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fix Failing Playwright Spec use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fix Failing Playwright Spec?

Skills that share tags, products or a category with Fix Failing Playwright Spec: Debug E2E Test (bitovi/ai-enablement-prompts, 121 stars), Cucumber and Playwright E2E Tests (langgenius/dify, 158k stars), Debug Playwright Prow (quay/quay, 2.8k stars) and Testing (kortix-ai/suna, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fix Failing Playwright Spec?

appsmithorg (a GitHub organization) maintains it in appsmithorg/appsmith, which has 41,030 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 8, 2026.

Source: appsmithorg/appsmith on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.