Skip to content

Commit 6597a51

Browse files
DavertMikclaude
andcommitted
fix(setCommonPlugins): drop eachElement; use pauseOn instead of pauseOnFail
`eachElement` was removed from CodeceptJS 4.x — it lives on `codeceptjs/effects` now and was never a plugin in 4.x. Stop adding it to `cfg.plugins`. `pauseOnFail` is superseded by the `pauseOn` plugin (4.x), which supports multiple modes (`fail`, `step`, `file`, `url`) controlled via `-p` args. Register `pauseOn` instead so `-p pauseOn:fail`, `-p pauseOn:step`, etc. work without config edits. Tests updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1a2db20 commit 6597a51

4 files changed

Lines changed: 15 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
4.0.0-beta.3
22

3-
* `setCommonPlugins` now registers `browser` and `aiTrace` as discoverable plugins (not enabled by default — activate via `-p <name>` on the CLI or `enabled: true` in user config). `tryTo`/`retryTo` are no longer added; in 4.x they are imported from `codeceptjs/effects`.
3+
* `setCommonPlugins` aligned with CodeceptJS 4.x plugin set:
4+
* Replaces `pauseOnFail` with the newer `pauseOn` plugin (registered, not enabled — activate via `-p pauseOn:fail`, `-p pauseOn:step`, `-p pauseOn:url:...`).
5+
* Adds `browser` and `aiTrace` as discoverable plugins (not enabled — activate via `-p browser:...` / `-p aiTrace`).
6+
* Drops `eachElement` — removed from CodeceptJS 4.x; available as `eachElement` import from `codeceptjs/effects`.
7+
* Drops `tryTo`/`retryTo` plugin entries — also moved to `codeceptjs/effects` in 4.x.
48

59
4.0.0
610

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,15 @@ These plugins will be loaded:
7878
**Enabled globally**
7979

8080
* `retryFailedStep`
81-
* `eachElement`
8281
* `screenshotOnFail`
8382

8483
**Registered but not enabled** — activate ad-hoc via `-p <name>` on the CLI, or by setting `enabled: true` in user config:
8584

86-
* `pauseOnFail` — pause when a step fails (`-p pauseOnFail`)
85+
* `pauseOn` — pause on failure / step / file / URL (`-p pauseOn:fail`, `-p pauseOn:step`, `-p pauseOn:file:tests/login_test.js`, `-p pauseOn:url:/checkout/*`)
8786
* `browser` — override browser helper config from CLI (`-p browser:show`, `-p browser:browser=firefox`, etc.)
88-
* `aiTrace` — capture AI traces
87+
* `aiTrace` — capture AI traces (`-p aiTrace`)
8988

90-
Note: in CodeceptJS 4.x, `tryTo` and `retryTo` are no longer plugins — import them from `codeceptjs/effects`.
89+
Note: in CodeceptJS 4.x, `tryTo` / `retryTo` / `eachElement` are no longer plugins — import them from `codeceptjs/effects`.
9190

9291
### setSharedCookies
9392

hooks/setCommonPlugins.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ export default function () {
66

77
// Enabled globally
88
cfg.plugins.retryFailedStep = cfg.plugins.retryFailedStep || { enabled: true }
9-
cfg.plugins.eachElement = cfg.plugins.eachElement || { enabled: true }
109
cfg.plugins.screenshotOnFail = cfg.plugins.screenshotOnFail || {}
1110

1211
// Registered but not enabled — activate via `-p <name>` on the CLI or by
1312
// setting `enabled: true` in user config.
14-
cfg.plugins.pauseOnFail = cfg.plugins.pauseOnFail || {}
13+
cfg.plugins.pauseOn = cfg.plugins.pauseOn || {}
1514
cfg.plugins.browser = cfg.plugins.browser || {}
1615
cfg.plugins.aiTrace = cfg.plugins.aiTrace || {}
1716
})

test/index.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,13 @@ describe('Hooks tests', () => {
262262
Config.create(config)
263263
// enabled globally
264264
assert.ok(Config.get().plugins.screenshotOnFail)
265-
assert.ok(Config.get().plugins.eachElement)
266-
assert.equal(Config.get().plugins.eachElement.enabled, true)
267265
assert.equal(Config.get().plugins.retryFailedStep.enabled, true)
266+
// removed in 4.x — must NOT be registered
267+
assert.equal(Config.get().plugins.eachElement, undefined)
268+
assert.equal(Config.get().plugins.pauseOnFail, undefined)
268269
// registered but not enabled
269-
assert.ok(Config.get().plugins.pauseOnFail)
270+
assert.ok(Config.get().plugins.pauseOn)
271+
assert.equal(Config.get().plugins.pauseOn.enabled, undefined)
270272
assert.ok(Config.get().plugins.browser)
271273
assert.equal(Config.get().plugins.browser.enabled, undefined)
272274
assert.ok(Config.get().plugins.aiTrace)
@@ -280,7 +282,7 @@ describe('Hooks tests', () => {
280282
Config.create(config)
281283
assert.ok(Config.get().plugins.screenshotOnFail)
282284
assert.equal(Config.get().plugins.screenshotOnFail.enabled, false)
283-
assert.ok(Config.get().plugins.eachElement)
285+
assert.ok(Config.get().plugins.retryFailedStep)
284286
assert.ok(Config.get().plugins.otherPlugin)
285287
})
286288
})

0 commit comments

Comments
 (0)