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
feat(plugins): unify screenshot/pause/aiTrace/heal under shared on= parameter (#5542)
* update docs
* updated docs, added browser plugin
* feat(plugins): unify screenshot/pause/aiTrace/heal under shared on= parameter
Adds a shared lib/utils/pluginParser.js with key=value parsing (`:` and `;`
separators) and a `resolveTrigger` helper. Renames screenshotOnFail → screenshot
and consolidates pauseOn/pauseOnFail → pause; aiTrace and heal grow `on=` filters.
Old plugin names live on as deprecated alias shims that warn and forward.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(plugins): drop pauseOn/stepByStepReport, fold slides into screenshot
- Remove lib/plugin/pauseOn.js (never shipped in a public release).
- Remove lib/plugin/stepByStepReport.js; slideshow generation moves into the
screenshot plugin behind slides=true (e.g. -p screenshot:on=step;slides=true)
with a modern, vanilla-CSS dark UI — no Bootstrap, no jQuery.
- Drop the redundant screenshot blocks from the acceptance test configs; the
default in lib/config.js already enables screenshot with on=fail.
- Strip allure mentions from plugin code and plugin docs; refresh PR template,
migration guide, debugging guide, plugins index, and commands docs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(plugins): centralize on= validation in resolveTrigger
resolveTrigger now takes { name, validModes }, performs the unknown-mode
and missing-path/pattern checks itself, prints the error via output.error,
and returns null. Each plugin shrinks to one call + early-return; heal
passes its narrower mode list as { validModes: ['fail', 'file', 'url'] }.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: DavertMik <davert@testomat.io>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/debugging.md
+20-15Lines changed: 20 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,28 +107,30 @@ After(({ I }) => {
107
107
})
108
108
```
109
109
110
-
## Pause On Plugin
110
+
## Pause Plugin
111
111
112
-
For automated debugging without modifying test code, use the `pauseOn` plugin. It pauses tests based on different triggers, controlled entirely from the command line.
112
+
For automated debugging without modifying test code, use the `pause` plugin. It pauses tests based on different triggers, controlled entirely from the command line. The default is `on=fail`.
113
113
114
114
### Pause on Failure
115
115
116
116
Automatically enters interactive pause when a step fails:
117
117
118
118
```bash
119
-
npx codeceptjs run -p pauseOn:fail
119
+
npx codeceptjs run -p pause
120
+
# or, explicit:
121
+
npx codeceptjs run -p pause:on=fail
120
122
```
121
123
122
124
This is the most common debug workflow — run your tests, and when one fails, you land in the interactive shell with the browser in the exact state of the failure. You can inspect elements, try different selectors, and figure out what went wrong.
123
125
124
-
> The older`pauseOnFail` plugin still works: `npx codeceptjs run -p pauseOnFail`
126
+
> The legacy`pauseOnFail` plugin still works as a deprecated alias.
125
127
126
128
### Pause on Every Step
127
129
128
130
Enters interactive pause at the start of the test. Use *ENTER* to advance step by step:
129
131
130
132
```bash
131
-
npx codeceptjs run -p pauseOn:step
133
+
npx codeceptjs run -p pause:on=step
132
134
```
133
135
134
136
This gives you full step-by-step execution. After each step, you're back in the interactive shell where you can inspect the page before pressing ENTER to continue.
@@ -138,13 +140,13 @@ This gives you full step-by-step execution. After each step, you're back in the
138
140
Pauses when execution reaches a specific file:
139
141
140
142
```bash
141
-
npx codeceptjs run -p pauseOn:file:tests/login_test.js
143
+
npx codeceptjs run -p pause:on=file:path=tests/login_test.js
142
144
```
143
145
144
146
With a specific line number:
145
147
146
148
```bash
147
-
npx codeceptjs run -p pauseOn:file:tests/login_test.js:43
149
+
npx codeceptjs run -p pause:on=file:path=tests/login_test.js;line=43
148
150
```
149
151
150
152
This works like a breakpoint — the test runs normally until it hits a step defined at that file and line, then opens the interactive shell.
@@ -154,14 +156,14 @@ This works like a breakpoint — the test runs normally until it hits a step def
154
156
Pauses when the browser navigates to a matching URL:
155
157
156
158
```bash
157
-
npx codeceptjs run -p pauseOn:url:/users/1
159
+
npx codeceptjs run -p pause:on=url:pattern=/users/1
158
160
```
159
161
160
162
Supports `*` wildcards:
161
163
162
164
```bash
163
-
npx codeceptjs run -p pauseOn:url:/api/*/edit
164
-
npx codeceptjs run -p pauseOn:url:/checkout/*
165
+
npx codeceptjs run -p pause:on=url:pattern=/api/*/edit
166
+
npx codeceptjs run -p pause:on=url:pattern=/checkout/*
165
167
```
166
168
167
169
This is useful when you want to inspect a specific page regardless of which test step navigates there.
@@ -243,15 +245,16 @@ Enabled by default. Saves a screenshot when a test fails:
243
245
244
246
```js
245
247
plugins: {
246
-
screenshotOnFail: {
248
+
screenshot: {
247
249
enabled:true,
250
+
on:'fail',
248
251
uniqueScreenshotNames:true,
249
252
fullPageScreenshots:true,
250
253
}
251
254
}
252
255
```
253
256
254
-
Screenshots are saved in the `output` directory.
257
+
Screenshots are saved in the `output` directory. The same plugin also supports `on=test`, `on=step`, `on=file`, and `on=url` to capture screenshots in other situations.
255
258
256
259
### Page Info on Failure
257
260
@@ -267,20 +270,22 @@ plugins: {
267
270
268
271
### Step-by-Step Report
269
272
270
-
Generates a slideshow of screenshots taken after every step — a visual replay of what the test did:
273
+
Generates a slideshow of screenshots taken after every step — a visual replay of what the test did. Set `slides: true` on the `screenshot` plugin (with `on=step`):
271
274
272
275
```js
273
276
plugins: {
274
-
stepByStepReport: {
277
+
screenshot: {
275
278
enabled:true,
279
+
on:'step',
280
+
slides:true,
276
281
deleteSuccessful:true, // keep only failed tests
277
282
fullPageScreenshots:true,
278
283
}
279
284
}
280
285
```
281
286
282
287
```bash
283
-
npx codeceptjs run -p stepByStepReport
288
+
npx codeceptjs run -p screenshot:on=step;slides=true
284
289
```
285
290
286
291
After the run, open `output/records.html` to browse through the slideshows.
Copy file name to clipboardExpand all lines: docs/migration-4.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,10 +187,21 @@ plugins: {
187
187
188
188
Inject `login` and call `login('admin')` — same as before.
189
189
190
+
### Renamed Plugins
191
+
192
+
4.x unifies four plugins (`screenshot`, `pause`, `aiTrace`, `heal`) under a shared `on=` parameter. The old names live on as deprecated aliases that emit a warning and forward to the new plugin.
`-p` accepts colon-chained arguments, so plugins can be enabled and configured from the command line without editing config:
456
467
457
468
```bash
458
-
npx codeceptjs run -p pauseOn:fail # pause on every failure
459
-
npx codeceptjs run -p pauseOn:url:/checkout/* # pause when URL matches
460
-
npx codeceptjs run -p browser:show # force visible browser
469
+
npx codeceptjs run -p pause # pause on every failure
470
+
npx codeceptjs run -p pause:on=url:pattern=/checkout/* # pause when URL matches
471
+
npx codeceptjs run -p screenshot:on=step # screenshot every step
472
+
npx codeceptjs run -p browser:show # force visible browser
461
473
npx codeceptjs run -p browser:browser=firefox:windowSize=1024x768
462
-
npx codeceptjs run -p plugin1,plugin2:arg # multiple plugins
474
+
npx codeceptjs run -p plugin1,plugin2:arg # multiple plugins
463
475
```
464
476
477
+
Each argument after the plugin name is a `key=value` pair. `:` separates pairs. `;` is an inline alternative for visually grouping related pairs (e.g. `path=...;line=...`). Reserved keys: `on`, `path`, `line`, `pattern`.
478
+
465
479
The `browser` plugin is new in 4.x — it overrides the active browser helper (Playwright, Puppeteer, WebDriver, Appium) from the CLI, useful for ad-hoc local runs and CI matrices. See [Commands](/commands).
466
480
467
481
The old `-p all` magic keyword is gone (it conflicted with the colon syntax). Enable specific plugins explicitly: `-p pluginA,pluginB`.
0 commit comments