Skip to content

Commit d3ed088

Browse files
authored
Merge branch '4.x' into feature/5425-ai-trace-plugin
2 parents 7f9ea43 + c64194a commit d3ed088

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1315
-6689
lines changed

.github/workflows/publish-beta.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.release.prerelease || contains(github.event.release.tag_name, 'alpha') || contains(github.event.release.tag_name, 'beta') || contains(github.event.release.tag_name, 'rc') }}
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.release.target_commitish }}
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- run: npm install -g npm@latest
27+
28+
- run: npm ci
29+
30+
- name: Set package version
31+
run: |
32+
TAG="${{ github.event.release.tag_name }}"
33+
VERSION="${TAG#v}"
34+
npm version "$VERSION" --no-git-tag-version
35+
36+
- name: Publish to npm
37+
run: npm publish --provenance --tag beta

README.md

Lines changed: 35 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -233,127 +233,61 @@ Scenario('test title', () => {
233233
})
234234
```
235235

236-
## HTML Reporter
236+
## HTML Reports
237237

238-
CodeceptJS includes a powerful built-in HTML Reporter that generates comprehensive, interactive test reports with detailed information about your test runs. The HTML reporter is **enabled by default** for all new projects and provides:
238+
Generate beautiful HTML reports using **[@testomatio/reporter](https://github.com/testomatio/reporter)** package.
239239

240-
### Features
241-
242-
- **Interactive Dashboard**: Visual statistics, pie charts, and expandable test details
243-
- **Step-by-Step Execution**: Shows individual test steps with timing and status indicators
244-
- **BDD/Gherkin Support**: Full support for feature files with proper scenario formatting
245-
- **System Information**: Comprehensive environment details including browser versions
246-
- **Advanced Filtering**: Real-time filtering by status, tags, features, and test types
247-
- **History Tracking**: Multi-run history with trend visualization
248-
- **Error Details**: Clean formatting of error messages and stack traces
249-
- **Artifacts Support**: Display screenshots and other test artifacts
250-
251-
### Visual Examples
252-
253-
#### Interactive Test Dashboard
254-
255-
The main dashboard provides a complete overview with interactive statistics and pie charts:
256-
257-
![HTML Reporter Dashboard](docs/shared/html-reporter-main-dashboard.png)
258-
259-
#### Detailed Test Results
260-
261-
Each test shows comprehensive execution details with expandable step information:
262-
263-
![HTML Reporter Test Details](docs/shared/html-reporter-test-details.png)
240+
### Installation
264241

265-
#### Advanced Filtering Capabilities
266-
267-
Real-time filtering allows quick navigation through test results:
268-
269-
![HTML Reporter Filtering](docs/shared/html-reporter-filtering.png)
242+
```sh
243+
npm install @testomatio/reporter --save-dev
244+
```
270245

271-
#### BDD/Gherkin Support
246+
### Configuration
272247

273-
Full support for Gherkin scenarios with proper feature formatting:
248+
Add the `testomatio` plugin to your `codecept.conf.js`:
274249

275-
![HTML Reporter BDD Details](docs/shared/html-reporter-bdd-details.png)
250+
```js
251+
plugins: {
252+
testomatio: {
253+
enabled: true,
254+
require: '@testomatio/reporter/lib/adapter/codecept',
255+
},
256+
}
257+
```
276258

277-
The HTML reporter generates self-contained reports that can be easily shared with your team. Learn more about configuration and features in the [HTML Reporter documentation](https://codecept.io/plugins/#htmlreporter).
259+
### Usage
278260

279-
## MCP Server
261+
Generate HTML reports by setting the `TESTOMATIO_HTML_REPORT_SAVE` environment variable:
280262

281-
CodeceptJS includes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that enables AI agents (like Claude, ChatGPT) to interact with and control your tests programmatically. This allows AI to:
263+
```sh
264+
TESTOMATIO_HTML_REPORT_SAVE=1 npx codeceptjs run
265+
```
282266

283-
- **List all tests** in your project
284-
- **List all available actions** (I.* methods) from enabled helpers
285-
- **Run arbitrary CodeceptJS code** and capture artifacts (ARIA snapshots, screenshots, HTML, logs)
286-
- **Run specific tests** with AI-friendly trace files generated by the aiTrace plugin
287-
- **Run tests step by step** for detailed debugging and analysis
288-
- **Control browser sessions** (start/stop)
267+
The report will be saved to `html-report/testomatio-report.html`.
289268

290269
### Features
291270

292-
- **AI-Friendly Trace Files**: When enabled, the aiTrace plugin generates comprehensive trace files with screenshots, HTML, ARIA snapshots, browser logs, and HTTP requests
293-
- **Real-time Monitoring**: Get trace file URLs at the start of test execution so AI can monitor tests in real-time
294-
- **Artifact Capture**: Automatically capture ARIA snapshots, page source, console logs, and more
295-
- **Browser Management**: Automatic or manual browser lifecycle control
296-
- **Timeout Control**: Configurable timeouts for all operations
271+
- Modern, responsive interface with real-time statistics
272+
- Detailed test information with step-by-step breakdown
273+
- Screenshots, videos, and artifacts display
274+
- BDD/Gherkin support with proper scenario formatting
275+
- Customizable output location and filename
276+
- Optional integration with [Testomat.io](https://testomat.io) cloud
297277

298-
### Quick Start
278+
### Customization
299279

300-
1. Install the MCP SDK:
301280
```sh
302-
npm install @modelcontextprotocol/sdk
303-
```
304-
305-
2. Configure your MCP client (e.g., Claude Desktop):
306-
```json
307-
{
308-
"mcpServers": {
309-
"codeceptjs": {
310-
"command": "node",
311-
"args": ["path/to/codeceptjs/bin/mcp-server.js"]
312-
}
313-
}
314-
}
315-
```
316-
317-
3. Enable the aiTrace plugin in `codecept.conf.js`:
318-
```javascript
319-
plugins: {
320-
aiTrace: {
321-
enabled: true
322-
}
323-
}
324-
```
281+
# Custom output folder
282+
TESTOMATIO_HTML_REPORT_SAVE=1 TESTOMATIO_HTML_REPORT_FOLDER=./reports npx codeceptjs run
325283

326-
### Usage Examples
284+
# Custom filename
285+
TESTOMATIO_HTML_REPORT_SAVE=1 TESTOMATIO_HTML_FILENAME=my-report.html npx codeceptjs run
327286

328-
**List all tests:**
329-
```json
330-
{
331-
"name": "list_tests"
332-
}
333-
```
334-
335-
**Run CodeceptJS code:**
336-
```json
337-
{
338-
"name": "run_code",
339-
"arguments": {
340-
"code": "await I.amOnPage('/'); await I.see('Welcome')"
341-
}
342-
}
287+
# Integrate with Testomat.io cloud
288+
TESTOMATIO_HTML_REPORT_SAVE=1 TESTOMATIO=your_api_key npx codeceptjs run
343289
```
344290

345-
**Run a test with trace:**
346-
```json
347-
{
348-
"name": "run_test",
349-
"arguments": {
350-
"test": "tests/login_test.js"
351-
}
352-
}
353-
```
354-
355-
Learn more about the MCP Server in the [MCP documentation](https://github.com/codeceptjs/CodeceptJS/blob/main/docs/mcp.md).
356-
357291
## PageObjects
358292

359293
CodeceptJS provides the most simple way to create and use page objects in your test.

docs/helpers/Appium.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,13 +960,17 @@ Returns **void** automatically synchronized promise through #recorder
960960

961961
Opposite to `seeElement`. Checks that element is not visible (or in DOM)
962962

963+
The second parameter is a context (CSS or XPath locator) to narrow the search.
964+
963965
```js
964966
I.dontSeeElement('.modal'); // modal is not shown
967+
I.dontSeeElement('.modal', '#container');
965968
```
966969

967970
#### Parameters
968971

969972
* `locator` **([string][5] | [object][11])** located by CSS|XPath|Strict locator.
973+
* `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
970974

971975
Returns **void** automatically synchronized promise through #recorder
972976

@@ -1009,6 +1013,8 @@ Returns **void** automatically synchronized promise through #recorder
10091013
Fills a text field or textarea, after clearing its value, with the given string.
10101014
Field is located by name, label, CSS, or XPath.
10111015

1016+
The third parameter is a context (CSS or XPath locator) to narrow the search.
1017+
10121018
```js
10131019
// by label
10141020
I.fillField('Email', 'hello@world.com');
@@ -1018,12 +1024,15 @@ I.fillField('password', secret('123456'));
10181024
I.fillField('form#login input[name=username]', 'John');
10191025
// or by strict locator
10201026
I.fillField({css: 'form#login input[name=username]'}, 'John');
1027+
// within a context
1028+
I.fillField('Name', 'John', '#section2');
10211029
```
10221030

10231031
#### Parameters
10241032

10251033
* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator.
10261034
* `value` **([string][5] | [object][11])** text value to fill.
1035+
* `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
10271036

10281037
Returns **void** automatically synchronized promise through #recorder
10291038

@@ -1194,13 +1203,17 @@ Returns **void** automatically synchronized promise through #recorder
11941203
Checks that a given Element is visible
11951204
Element is located by CSS or XPath.
11961205

1206+
The second parameter is a context (CSS or XPath locator) to narrow the search.
1207+
11971208
```js
11981209
I.seeElement('#modal');
1210+
I.seeElement('#modal', '#container');
11991211
```
12001212

12011213
#### Parameters
12021214

12031215
* `locator` **([string][5] | [object][11])** located by CSS|XPath|strict locator.
1216+
* `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
12041217

12051218
Returns **void** automatically synchronized promise through #recorder
12061219

@@ -1247,13 +1260,17 @@ Selects an option in a drop-down select.
12471260
Field is searched by label | name | CSS | XPath.
12481261
Option is selected by visible text or by value.
12491262

1263+
The third parameter is a context (CSS or XPath locator) to narrow the search.
1264+
12501265
```js
12511266
I.selectOption('Choose Plan', 'Monthly'); // select by label
12521267
I.selectOption('subscription', 'Monthly'); // match option by text
12531268
I.selectOption('subscription', '0'); // or by value
12541269
I.selectOption('//form/select[@name=account]','Premium');
12551270
I.selectOption('form select[name=account]', 'Premium');
12561271
I.selectOption({css: 'form select[name=account]'}, 'Premium');
1272+
// within a context
1273+
I.selectOption('age', '21-60', '#section2');
12571274
```
12581275

12591276
Provide an array for the second argument to select multiple options.
@@ -1266,6 +1283,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
12661283

12671284
* `select` **([string][5] | [object][11])** field located by label|name|CSS|XPath|strict locator.
12681285
* `option` **([string][5] | [Array][8]\<any>)** visible text or value of option.
1286+
* `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
12691287

12701288
Returns **void** automatically synchronized promise through #recorderSupported only for web testing
12711289

0 commit comments

Comments
 (0)