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
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>
Copy file name to clipboardExpand all lines: docs/debugging.md
+15-12Lines changed: 15 additions & 12 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`and `pauseOn` plugins still work as deprecated aliases.
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.
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`.
Copy file name to clipboardExpand all lines: docs/tutorial.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,13 +153,13 @@ Please note, that you shouldn't use a real credit card number here. Good news, y
153
153
Run the test with next command:
154
154
155
155
```
156
-
npx codeceptjs run --debug -p pauseOnFail
156
+
npx codeceptjs run --debug -p pause
157
157
```
158
158
159
159
What are special options here?
160
160
161
161
*`--debug` flag is used to output additional information to the console, such as the details of each step in the test, the values of variables, and the results of test assertions. This can help you to identify and fix any issues in your tests.
162
-
*`-p pauseOnFail` option is also used to keep the browser opened even if a test fails. It will help us to identify to which point test was executed and what can be improved.
162
+
*`-p pause` option is also used to keep the browser opened even if a test fails (default `on=fail`). It will help us to identify to which point test was executed and what can be improved.
163
163
164
164
Add more test steps if needed, update locators, and notify business owners that all that purchases are made by you so your collegues won't call you in the night asking when you want to get a coffee cup 😀 Also the good idea is to run tests on staging website, to not interfere with business process.
0 commit comments