From 18079644a2ba450035b415fbc41ad583f0be19a6 Mon Sep 17 00:00:00 2001 From: bymyself Date: Thu, 5 Feb 2026 13:01:25 -0800 Subject: [PATCH] fix: reorder retry patterns to prioritize simpler assertions Amp-Thread-ID: https://ampcode.com/threads/T-019c2f99-6c3b-701e-8f90-4f897ecf85d8 --- .claude/skills/writing-playwright-tests/SKILL.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.claude/skills/writing-playwright-tests/SKILL.md b/.claude/skills/writing-playwright-tests/SKILL.md index 301e7e98f4..a1d3d8ddae 100644 --- a/.claude/skills/writing-playwright-tests/SKILL.md +++ b/.claude/skills/writing-playwright-tests/SKILL.md @@ -77,14 +77,17 @@ test.describe('Feature', { tag: ['@screenshot', '@canvas'] }, () => { **Never use `waitForTimeout`** - it's always wrong. -| Pattern | Use Case | -| ------------------------ | -------------------------------------- | -| `expect.poll()` | Single value polling | -| `expect().toPass()` | Multiple assertions that must all pass | -| Auto-retrying assertions | `toBeVisible()`, `toHaveText()`, etc. | +| Pattern | Use Case | +| ------------------------ | ---------------------------------------------------- | +| Auto-retrying assertions | `toBeVisible()`, `toHaveText()`, etc. (prefer these) | +| `expect.poll()` | Single value polling | +| `expect().toPass()` | Multiple assertions that must all pass | ```typescript -// Single value +// Prefer auto-retrying assertions when possible +await expect(node).toBeVisible() + +// Single value polling await expect.poll(() => widget.getValue(), { timeout: 2000 }).toBe(100) // Multiple conditions