You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix retryFailedStep config: own retry timing, stop mutating shared defaults
- retryFailedStep now sets minTimeout/maxTimeout/factor in its own
defaultConfig instead of falling through to the recorder globals,
so these values are configurable per-plugin
- stop mutating the shared module-level defaultConfig
(Object.assign({}, ...)), the same leak fixed for the recorder
in 4ef2af2 — config no longer bleeds across plugin instances
- correct JSDoc defaults (minTimeout 150, maxTimeout 10000)
- add config unit tests (defaults, overrides, no leak)
- rewrite docs/retry.md: helper vs step retries, Playwright-only
auto-waiting, WebDriver smartWait note, retry timing formula
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Remove user-facing `when` option from retryFailedStep config
The internal retry predicate (config.when) is still set for the
recorder; only the configurable customWhen hook is removed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: DavertMik <davert@testomat.io>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/retry.md
+48-18Lines changed: 48 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,24 +20,36 @@ CodeceptJS provides flexible retry mechanisms to handle flaky tests. Use retries
20
20
21
21
## Helper Retries
22
22
23
-
Browser automation helpers (Playwright, Puppeteer, WebDriver) have **built-in retry mechanisms** for element interactions. When you call `I.click('Button')`, Playwright automatically waits for the element to exist, be visible, stable, and enabled — retrying for up to 5 seconds.
23
+
Plawright has a built-in retry mechanism for element interactions. When you call `I.click('Button')`, after the element is located Playwright keeps retrying until it is actionable — up to `timeout` (default 5s).
24
24
25
-
Configure the timeout in your helper settings:
25
+
> WebDriver has a different auto-retry option: [smartWait](/webdriver#smartwait)
26
+
27
+
Even though the handle exists (from `.all()`), Playwright still waits for it to become visible, stable (not mid-animation), enabled, not covered by an overlay/modal, and not rerendering.
26
28
27
29
```js
28
30
helpers: {
29
31
Playwright: {
30
-
timeout:5000, // retry actions for up to 5 seconds
31
-
waitForAction:100//wait 100ms before each action
32
+
timeout:5000, // retry the action until the element is actionable
33
+
waitForAction:100//fixed pause AFTER click/doubleClick/pressKey
find element (no wait — fails instantly if locator matches nothing)
42
+
→ wait up to `timeout` for it to become actionable ← timeout
43
+
→ perform action
44
+
→ sleep `waitForAction` ms ← waitForAction (settle pause, not a wait)
45
+
```
46
+
47
+
`timeout` covers the action. If the locator matches nothing yet, the step fails immediately. Use [Failed Step Retries](#failed-step-retries) to cover that gap.
48
+
37
49
38
50
## Failed Step Retries
39
51
40
-
Automatically retry all failed steps without modifying test code:
52
+
CodeceptJS retries all failed steps by default by using the `retryFailedStep` plugin.
@@ -101,7 +102,6 @@ export default function (config) {
101
102
if(!store.autoRetries)returnfalse
102
103
if(err&&err.isTerminal)returnfalse
103
104
if(err&&err.message&&(err.message.includes('ERR_ABORTED')||err.message.includes('frame was detached')||err.message.includes('Target page, context or browser has been closed')))returnfalse
0 commit comments