Skip to content

Commit e5b88fa

Browse files
Document perform retry options in public API
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent b90647c commit e5b88fa

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ await page.perform("click the login button", {
195195
});
196196
```
197197

198+
**Perform retry options**:
199+
- `maxElementRetries`: attempts to refetch/find a target element before failing.
200+
- `retryDelayMs`: delay between element-refetch retries.
201+
- `maxContextSwitchRetries`: retries when a tab/context switch interrupts an in-flight action.
202+
- `contextSwitchRetryDelayMs`: delay between context-switch retries (defaults to 500ms, capped for safety).
203+
198204
### 🧠 `page.ai()` - Complex Multi-Step Tasks
199205

200206
**Best for**: Complex workflows requiring multiple steps and visual context

src/__tests__/public-api.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,15 @@ describe("public API exports", () => {
5656
const typeSmoke: PublicTypeSmoke | null = null;
5757
expect(typeSmoke).toBeNull();
5858
});
59+
60+
it("keeps perform retry option fields available on public PerformTaskParams", () => {
61+
const performParams: PerformTaskParams = {
62+
maxElementRetries: 5,
63+
retryDelayMs: 250,
64+
maxContextSwitchRetries: 4,
65+
contextSwitchRetryDelayMs: 500,
66+
};
67+
68+
expect(performParams.contextSwitchRetryDelayMs).toBe(500);
69+
});
5970
});

0 commit comments

Comments
 (0)