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
Copy file name to clipboardExpand all lines: docs/agents.md
+32-25Lines changed: 32 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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.
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:
Copy file name to clipboardExpand all lines: docs/configuration.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ export const config = {
44
44
45
45
-`timeout` — default per-test timeout in seconds; a test is killed if it stops responding.
46
46
-`mocha` — [Mocha options](https://mochajs.org/#configuring-mocha-nodejs), including extra reporters. See [Reporters](/reports).
47
+
-`workerInitializationDelay` — delay in milliseconds between spinning up parallel workers to prevent CPU spikes and stagger browser startup. Defaults to `200`. Set to `0` to disable.
48
+
-`workerInitializationMaxDelay` — maximum total delay (in milliseconds) for worker initialization staggering. Defaults to `10000` (10 s). Set to `0` to disable capping.
47
49
48
50
**BDD**
49
51
@@ -71,16 +73,18 @@ For TypeScript test files in CodeceptJS 4.x, use the [`tsx`](https://tsx.is) loa
71
73
// codecept.conf.ts
72
74
exportconst config = {
73
75
tests: './**/*_test.ts',
74
-
require: ['tsx/cjs'],
76
+
require: ['tsx/esm'],
75
77
helpers: {},
76
78
include: {},
77
79
}
78
80
```
79
81
82
+
This requires `"type": "module"` in `package.json` so `.ts` test files are compiled as ES Modules.
83
+
80
84
Combine several modules:
81
85
82
86
```ts
83
-
require: ['tsx/cjs', 'should', './lib/testSetup']
87
+
require: ['tsx/esm', 'should', './lib/testSetup']
84
88
```
85
89
86
90
The config file itself (`codecept.conf.ts`) and helpers are transpiled automatically — only test files need the loader. See [TypeScript](/typescript) for the full setup.
Copy file name to clipboardExpand all lines: docs/migration-4.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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.
0 commit comments