codeceptjs 4.0.4 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/agents.md CHANGED
@@ -23,6 +23,38 @@ Agents get full control over test and browser execution:
23
23
 
24
24
  CodeceptJS is token-efficient: it stores HTML, ARIA, logs, and HTTP request data as files instead of streaming them through MCP. Agents read these files with their native shell tools—no extra API calls, no redundant context.
25
25
 
26
+ ## Essential Setup
27
+
28
+ Two things make agent testing work: the **skills** that teach the agent CodeceptJS, and the **MCP server** that lets it drive the browser. Set both up once, from your project directory.
29
+
30
+ Install the skills:
31
+
32
+ ```bash
33
+ npx skills add codeceptjs/skills
34
+ ```
35
+
36
+ Connect the MCP server (`npx codeceptjs-mcp`).
37
+
38
+ **Claude Code:**
39
+
40
+ ```bash
41
+ claude mcp add codeceptjs -- npx codeceptjs-mcp
42
+ ```
43
+
44
+ **Codex:**
45
+
46
+ ```bash
47
+ codex mcp add codeceptjs -- npx codeceptjs-mcp
48
+ ```
49
+
50
+ **Cursor** — add to `.cursor/mcp.json`:
51
+
52
+ ```json
53
+ { "mcpServers": { "codeceptjs": { "command": "npx", "args": ["codeceptjs-mcp"] } } }
54
+ ```
55
+
56
+ See [/mcp](/mcp) for full client setup. Now the agent is ready to run the loop.
57
+
26
58
  ## The loop
27
59
 
28
60
  Whether the agent is writing a new test or fixing an old one, it follows the same cycle.
@@ -96,31 +128,6 @@ Only `url` is inline. The rest are paths the agent opens with the right tool:
96
128
 
97
129
  Saved HTML is formatted, with non-semantic elements stripped out: `<style>`, `<script>`, Tailwind-style trash classes, and inline `style=""` attributes. `grep` can then effectively find the correct tree branch in raw page source. ARIA snapshots are smaller and more structured than HTML, which is why the agent prefers them when picking locators.
98
130
 
99
- ## Setup
100
-
101
- When CodeceptJS is installed, the MCP server can be launched with this command:
102
-
103
- ```bash
104
- npx codeceptjs-mcp
105
- ```
106
-
107
- > See [/mcp](/mcp) for detailed client setup.
108
-
109
- We recommend pairing CodeceptJS MCP with the skills bundle.
110
-
111
- Install for any agent:
112
-
113
- ```bash
114
- npx skills add codeceptjs/skills
115
- ```
116
-
117
- Or, in Claude Code:
118
-
119
- ```text
120
- /plugin marketplace add codeceptjs/skills
121
- /plugin install codeceptjs@codeceptjs-skills
122
- ```
123
-
124
131
  ## Usage Examples
125
132
 
126
133
  When MCP and skills are connected, the agent receives predefined workflows and can act effectively for testing purposes. Common scenarios it handles:
@@ -7,9 +7,31 @@ title: Migrating from 3.x to 4.x
7
7
 
8
8
  CodeceptJS 4.x is a major release. It moves the codebase from CommonJS to native ESM, drops several long-deprecated helpers and plugins, replaces legacy plugins with first-class APIs, and bumps most third-party dependencies.
9
9
 
10
- > Migrate automatically! Install CodeceptJS skills `npx skills add codeceptjs/skills` and run `/codeceptjs-3-to-4-migration` in your coding agent
10
+ ## Migrate Automatically with an Agent
11
11
 
12
- This guide tells you exactly what to change in your project to upgrade.
12
+ The fastest way to upgrade is to let an AI agent do it. This release is mechanical enough that an agent handles most of it end-to-end.
13
+
14
+ Install CodeceptJS 4:
15
+
16
+ ```bash
17
+ npm install codeceptjs@4
18
+ ```
19
+
20
+ Then install the skills bundle. It works the same in Claude Code or any other agent:
21
+
22
+ ```bash
23
+ npx skills add codeceptjs/skills
24
+ ```
25
+
26
+ The bundle ships a `migrate-codeceptjs-4` skill. Point an agent at the project and run it:
27
+
28
+ ```bash
29
+ claude "/migrate-codeceptjs-4"
30
+ ```
31
+
32
+ It reads your config and tests, applies the mechanical changes, runs the suite, and fixes what breaks.
33
+
34
+ The rest of this guide documents every change the skill makes — read it if you prefer to migrate by hand, or to review what the agent did.
13
35
 
14
36
  ## 1. Update Node and Package
15
37
 
package/lib/pause.js CHANGED
@@ -105,7 +105,7 @@ async function parseInput(cmd) {
105
105
  recorder.session.start('pause')
106
106
  if (cmd === '') next = true
107
107
  if (!cmd || cmd === 'resume' || cmd === 'exit') {
108
- finish()
108
+ if (typeof finish === 'function') finish()
109
109
  recorder.session.restore('pause')
110
110
  rl.close()
111
111
  history.save()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "type": "module",
5
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
6
6
  "keywords": [
@@ -95,7 +95,7 @@
95
95
  "@codeceptjs/helper": "2.0.4",
96
96
  "@cucumber/cucumber-expressions": "18",
97
97
  "@cucumber/gherkin": "38.0.0",
98
- "@cucumber/messages": "32.0.1",
98
+ "@cucumber/messages": "32.3.1",
99
99
  "@modelcontextprotocol/sdk": "^1.26.0",
100
100
  "@xmldom/xmldom": "0.9.8",
101
101
  "acorn": "8.15.0",
@@ -105,7 +105,7 @@
105
105
  "chalk": "4.1.2",
106
106
  "cheerio": "^1.0.0",
107
107
  "chokidar": "^5.0.0",
108
- "commander": "14.0.3",
108
+ "commander": "15.0.0",
109
109
  "cross-spawn": "7.0.6",
110
110
  "css-to-xpath": "0.1.0",
111
111
  "csstoxpath": "1.6.0",
@@ -183,15 +183,15 @@
183
183
  "rosie": "2.1.1",
184
184
  "runok": "^0.9.3",
185
185
  "semver": "7.7.3",
186
- "sinon": "21.0.1",
186
+ "sinon": "22.0.0",
187
187
  "sinon-chai": "^4.0.1",
188
- "ts-morph": "27.0.2",
188
+ "ts-morph": "28.0.0",
189
189
  "ts-node": "10.9.2",
190
190
  "tsd": "^0.33.0",
191
191
  "tsd-jsdoc": "2.5.0",
192
192
  "tsx": "^4.19.2",
193
193
  "typedoc": "0.28.16",
194
- "typedoc-plugin-markdown": "4.9.0",
194
+ "typedoc-plugin-markdown": "4.12.0",
195
195
  "typescript": "5.9.3",
196
196
  "wdio-docker-service": "3.2.1",
197
197
  "webdriverio": "9.23.0",