Await & Retry Strategy
SkillWeb & browsingHelps your agent fix flaky end-to-end tests by waiting and retrying properly instead of using fixed delays.
Use Await & Retry Strategy in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Await & Retry Strategy and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Await & Retry Strategy skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
About this skill
Await and retry strategy for Suite E2E tests: Playwright auto-waiting, expect polling, Redux waits, flakiness prevention. Use every time a test is flaky due to timing.
What this skill tells your AI
The instructions your AI receives, as published by trezor/trezor-suite in suite/e2e/skills/retries/SKILL.md and read by ahel’s review.
When to use: Every time you wonder why a test is flaky due to timing. Prerequisites: locators for locator strategies used in examples.
Core Patterns (3 Essentials)
1. Expect-Based Retry (Full Operation Retry)
Wrap the full flaky operation in expect(async () => { ... }).toPass({ timeout }). The entire block retries with exponential backoff. Use for UI operations that fail intermittently (dropdown selection, navigation).
2. Poll-Based Retry (Value Polling)
Use expect.poll(() => fn, message).toBeGreaterThanOrEqual(n) to poll a specific value until a condition is met. Use for analytics request counts, state change counters.
3. Redux State Waits
Use page.expectReduxObjectNotToBeEmpty(), page.expectReduxObjectToEqual(), or page.expectReduxSubtreeToContain() before actions that have race conditions in automation. To find the right property to wait on, use page.runWithReduxDump() — it writes before/after state snapshots to disk; diff the files to identify what changed.
Device Interaction (Critical)
Always verify the device prompt is shown before triggering a device action (device.pressYes(), etc.). Use devicePrompt.confirmOnDevicePromptIsShown() or devicePrompt.waitForFinalPromptAndConfirm() for multi-step flows.
Verify display before action: use device.expectToContainOnDisplay() before device.pressYes()
Network Waits (Race Condition Prevention)
Golden Rule: Create the waitForRequest promise before triggering the action that fires the request, not after.
Anti-Patterns
❌ Arbitrary Delays
await page.waitForTimeout(5000); // DON'T do this
Exception LAST RESORT: Only with explanation comment for animation sync.
await page.waitForTimeout(500); // Wait for walletSwitcher animation
Signals
- GitHub stars
- 1k
- Forks
- 384
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
retries- Source
- github.com/trezor/trezor-suite
github.com/trezor/trezor-suite
Related picks
Skill · davila7
The pick for Reactreact-doctor
Skill · millionco
The pick for Reactsetup-ts-deep-modules
Skill · mattpocock
The pick for TypeScripttypescript-pro
Skill · jeffallan
The pick for TypeScriptbrowser-use
Skill · browser-use
More in Web & browsingwebapp-testing
Skill · anthropics
More in Web & browsing