- How you use it
- You ask for it
- What it can do
- installs software · writes files
- What's inside
The option
| Option | ASkill · v1.0.0e2e-testing-patterns skill (wshobson/agents) |
|---|---|
| How you use it | You ask for it |
| What it can do | installs software · writes files |
| What's inside |
What this thread does
The problem
Your agent wrote a Playwright suite that looked fine on an empty app. Once the database holds real or leftover rows, tests fail with strict-mode errors, timeouts or the wrong item selected.
What one write-up found
Wei-Wei Wu of Momentic described running Claude Code on a todo app (post, page updated 20 September 2026; Momentic sells a competing tool, so read the vendor pitch at the end with care). The first run passed 40 of 70 tests. Causes he reports:
- Every row used the same
data-testid="todo-item", sogetByTestId('todo-item')matched 285 elements and Playwright's strict mode failed it. - Tests created rows with timestamps but did not delete them reliably, so data piled up across runs. The tests assumed a clean slate without making one.
- After the first fix, new failures: timeouts,
.first()pointing at the wrong row, and interference between parallel tests. - Claude's follow-up suggestion was to add more waits, which fixed some tests and caused timeouts in others.
His recommended fixes: isolate tests by clearing data between them or using unique ids, make locators specific from the start with .filter(), and replace waitForTimeout with assertions that wait for a condition.
What Playwright's own docs add
- Log in once: a
setupproject writes the browser state toplaywright/.auth/user.json, test projects depend on it viastorageState, and the folder goes in.gitignorebecause the file can hold sensitive data (auth docs). - If tests change shared server-side data, use one account per parallel worker (
testInfo.parallelIndexpicks the account).
Prompt wording to try
"Each test creates its own data with a unique name (include a random suffix), finds it by that name, and deletes it in cleanup. Never use a locator that can match more than one row. Do not use waitForTimeout; wait for a visible state instead."
Mistakes to avoid
- Fixing a strict-mode error by adding
.first(). It hides which row you got. - Cleanup that only runs on success. Put it in an
afterEachor a fixture so it also runs after a failure.
Limits
One vendor blog and the official docs; I did not run the suite. The post does not show the final code.
Started from a post by @Wei-Wei Wu (Momentic), packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.