Skip to content

Commit 1a2db20

Browse files
DavertMikclaude
andcommitted
feat(setCommonPlugins): register browser + aiTrace as discoverable
Add `browser` and `aiTrace` to the common plugins block — registered without `enabled: true`, so they appear in `cfg.plugins` (discoverable by `-p all` and tooling) and can be activated ad-hoc via `-p browser:...` or by toggling `enabled: true` in user config. Drop the legacy `tryTo`/`retryTo` plugin entries — those are now imported from `codeceptjs/effects` in 4.x, not enabled as plugins. Bumps version label to 4.0.0-beta.3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 31d7a34 commit 1a2db20

5 files changed

Lines changed: 34 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
4.0.0-beta.3
2+
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`.
4+
15
4.0.0
26

37
* ESM-only release targeting CodeceptJS 4.x. Convert package + all hooks + bridge to native ESM (`type: module`).

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,19 @@ setCommonPlugins();
7575

7676
These plugins will be loaded:
7777

78-
* tryTo (enabled globally)
79-
* retryFailedStep (enabled globally)
80-
* retryTo (enabled globally)
81-
* eachElement (enabled globally)
82-
* pauseOnFail (disabled, should be turned on when needed)
83-
* screenshotOnFail (enable globally)
78+
**Enabled globally**
79+
80+
* `retryFailedStep`
81+
* `eachElement`
82+
* `screenshotOnFail`
83+
84+
**Registered but not enabled** — activate ad-hoc via `-p <name>` on the CLI, or by setting `enabled: true` in user config:
85+
86+
* `pauseOnFail` — pause when a step fails (`-p pauseOnFail`)
87+
* `browser` — override browser helper config from CLI (`-p browser:show`, `-p browser:browser=firefox`, etc.)
88+
* `aiTrace` — capture AI traces
89+
90+
Note: in CodeceptJS 4.x, `tryTo` and `retryTo` are no longer plugins — import them from `codeceptjs/effects`.
8491

8592
### setSharedCookies
8693

hooks/setCommonPlugins.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ export default function () {
44
config.addHook(cfg => {
55
if (!cfg.plugins) cfg.plugins = {}
66

7+
// Enabled globally
78
cfg.plugins.retryFailedStep = cfg.plugins.retryFailedStep || { enabled: true }
89
cfg.plugins.eachElement = cfg.plugins.eachElement || { enabled: true }
9-
cfg.plugins.pauseOnFail = cfg.plugins.pauseOnFail || {}
1010
cfg.plugins.screenshotOnFail = cfg.plugins.screenshotOnFail || {}
11+
12+
// Registered but not enabled — activate via `-p <name>` on the CLI or by
13+
// setting `enabled: true` in user config.
14+
cfg.plugins.pauseOnFail = cfg.plugins.pauseOnFail || {}
15+
cfg.plugins.browser = cfg.plugins.browser || {}
16+
cfg.plugins.aiTrace = cfg.plugins.aiTrace || {}
1117
})
1218
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codeceptjs/configure",
3-
"version": "4.0.0",
3+
"version": "4.0.0-beta.3",
44
"description": "Set of CodeceptJS config hooks to simplify configuration (ESM, CodeceptJS 4.x)",
55
"type": "module",
66
"main": "index.js",

test/index.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,17 @@ describe('Hooks tests', () => {
260260
const config = { helpers: {} }
261261
setCommonPlugins()
262262
Config.create(config)
263+
// enabled globally
263264
assert.ok(Config.get().plugins.screenshotOnFail)
264265
assert.ok(Config.get().plugins.eachElement)
266+
assert.equal(Config.get().plugins.eachElement.enabled, true)
267+
assert.equal(Config.get().plugins.retryFailedStep.enabled, true)
268+
// registered but not enabled
269+
assert.ok(Config.get().plugins.pauseOnFail)
270+
assert.ok(Config.get().plugins.browser)
271+
assert.equal(Config.get().plugins.browser.enabled, undefined)
272+
assert.ok(Config.get().plugins.aiTrace)
273+
assert.equal(Config.get().plugins.aiTrace.enabled, undefined)
265274
})
266275

267276
test('should not override plugins', () => {

0 commit comments

Comments
 (0)