@serenity-js/cucumber 3.36.2 → 3.37.0

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +121 -91
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.37.0](https://github.com/serenity-js/serenity-js/compare/v3.36.2...v3.37.0) (2025-12-02)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependency @cucumber/cucumber to v12.3.0 ([7056e71](https://github.com/serenity-js/serenity-js/commit/7056e7129928f7e1db57ed6e7657ffa8bfd486ed))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.36.2](https://github.com/serenity-js/serenity-js/compare/v3.36.1...v3.36.2) (2025-11-26)
7
18
 
8
19
  **Note:** Version bump only for package @serenity-js/cucumber
package/README.md CHANGED
@@ -1,135 +1,165 @@
1
- # Serenity/JS
1
+ # Serenity/JS Cucumber
2
+
3
+ [![NPM Version](https://badge.fury.io/js/%40serenity-js%2Fcucumber.svg)](https://badge.fury.io/js/%40serenity-js%2Fcucumber)
4
+ [![Build Status](https://github.com/serenity-js/serenity-js/actions/workflows/main.yaml/badge.svg?branch=main)](https://github.com/serenity-js/serenity-js/actions)
5
+ [![Maintainability](https://qlty.sh/gh/serenity-js/projects/serenity-js/maintainability.svg)](https://qlty.sh/gh/serenity-js/projects/serenity-js)
6
+ [![Code Coverage](https://qlty.sh/gh/serenity-js/projects/serenity-js/coverage.svg)](https://qlty.sh/gh/serenity-js/projects/serenity-js)
7
+ [![Contributors](https://img.shields.io/github/contributors/serenity-js/serenity-js.svg)](https://github.com/serenity-js/serenity-js/graphs/contributors)
8
+ [![Known Vulnerabilities](https://snyk.io/test/npm/@serenity-js/cucumber/badge.svg)](https://snyk.io/test/npm/@serenity-js/cucumber)
9
+ [![GitHub stars](https://img.shields.io/github/stars/serenity-js/serenity-js?style=flat)](https://github.com/serenity-js/serenity-js)
2
10
 
3
11
  [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
4
12
  [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
5
13
  [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
6
14
  [![Support Serenity/JS on GitHub](https://img.shields.io/badge/Support-@serenity--js-703EC8?logo=github)](https://github.com/sponsors/serenity-js)
7
15
 
8
- [Serenity/JS](https://serenity-js.org) is an innovative open-source framework designed to make acceptance and regression testing
9
- of complex software systems faster, more collaborative and easier to scale.
10
-
11
- ⭐️ Get started with Serenity/JS!
12
- - [Serenity/JS web testing tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario)
13
- - [Serenity/JS Handbook](https://serenity-js.org/handbook)
14
- - [API documentation](https://serenity-js.org/api/)
15
- - [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/)
16
-
17
- 👋 Join the Serenity/JS Community!
18
- - Meet other Serenity/JS developers and maintainers on the [Serenity/JS Community chat channel](https://matrix.to/#/#serenity-js:gitter.im),
19
- - Find answers to your Serenity/JS questions on the [Serenity/JS Forum](https://github.com/orgs/serenity-js/discussions/categories/how-do-i),
20
- - Learn how to [contribute to Serenity/JS](https://serenity-js.org/community/contributing/),
21
- - Support the project and gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks) by becoming a [Serenity/JS GitHub Sponsor](https://github.com/sponsors/serenity-js)!
16
+ [`@serenity-js/cucumber`](https://serenity-js.org/api/cucumber/) integrates Serenity/JS with [Cucumber](https://github.com/cucumber/cucumber-js/),
17
+ enabling you to run automated, plain-language scenarios with rich reporting and powerful Screenplay-based abstractions.
22
18
 
23
- ## Serenity/JS Cucumber
19
+ ## Features
24
20
 
25
- [`@serenity-js/cucumber`](https://serenity-js.org/api/cucumber/) contains a set of adapters you register with [Cucumber CLI runners](https://github.com/cucumber/cucumber-js/) to enable integration and reporting between Cucumber.js and Serenity/JS.
21
+ - Integrates Serenity/JS with Cucumber.js
22
+ - Supports all Cucumber.js versions from 0.x to 12.x
23
+ - Enriches Serenity reports with Gherkin feature descriptions, scenarios, and steps
24
+ - Supports using Screenplay Pattern APIs in step definitions
26
25
 
27
- **Please note:** To use Cucumber and Serenity/JS to execute web-based acceptance tests, you should register Serenity/JS Cucumber adapter using Protractor configuration file.
26
+ ## Installation
28
27
 
29
- Learn more about integrating Serenity/JS Cucumber:
30
- - with [Protractor and Cucumber.js](https://serenity-js.org/handbook/test-runners/protractor/),
31
- - with [Cucumber.js](https://serenity-js.org/handbook/test-runners/cucumber/).
32
-
33
- ### Installation
34
-
35
- To install this module, run:
36
28
  ```
37
29
  npm install --save-dev @serenity-js/cucumber @serenity-js/core
38
30
  ```
39
31
 
40
- This module reports test scenarios executed by **any version of Cucumber.js**, from 0.x to 9.x, which you need to install
41
- separately.
42
-
43
- To install [Cucumber 9.x](https://www.npmjs.com/package/@cucumber/cucumber), run:
44
- ```
45
- npm install --save-dev @cucumber/cucumber
46
- ```
32
+ See the [Serenity/JS Installation Guide](https://serenity-js.org/handbook/installation/).
47
33
 
48
- To install [Cucumber 6.x](https://www.npmjs.com/package/cucumber) or earlier, run:
49
- ```
50
- npm install --save-dev cucumber
51
- ```
34
+ ## Quick Start
52
35
 
36
+ ```ts
37
+ import { actorCalled, actorInTheSpotlight } from '@serenity-js/core';
38
+ import { Given, When, Then } from '@cucumber/cucumber';
39
+ import { Ensure, equals } from '@serenity-js/assertions';
53
40
 
54
- ### Command line usage
41
+ Given('{word} has {int} apples', async (actorName: string, count: number) => {
42
+ // Create or retrieve the actor by name
43
+ await actorCalled(actorName).attemptsTo(
44
+ // Add tasks or interactions
45
+ );
46
+ });
55
47
 
56
- #### Cucumber 7.x and newer
48
+ When('she adds {int} apples', async (count: number) => {
49
+ // Retrieve the most recently used actor
50
+ await actorInTheSpotlight().attemptsTo(
51
+ // Add tasks or interactions
52
+ )
53
+ });
57
54
 
58
- ```
59
- cucumber-js --format @serenity-js/cucumber \
60
- --require ./features/support/setup.js \
61
- --require ./features/step_definitions/sample.steps.js
55
+ Then('she has {int} apples', async (expectedCount: number) => {
56
+ await actorInTheSpotlight().attemptsTo(
57
+ Ensure.that(/* actual count */, equals(expectedCount))
58
+ )
59
+ })
62
60
  ```
63
61
 
64
- ```
65
- '--format-options', `{ "specDirectory": "${ path.resolve(__dirname, '../../cucumber-specs/features') }" }`,
66
- ```
62
+ Explore practical examples and in-depth explanations in the [Serenity/JS Handbook](https://serenity-js.org/handbook/).
67
63
 
68
- #### Cucumber 3.x to 6.x
64
+ ## Configuration
69
65
 
70
- ```
71
- cucumber-js --format node_modules/@serenity-js/cucumber \
72
- --require ./features/support/setup.js \
73
- --require ./features/step_definitions/sample.steps.js
74
- ```
75
-
76
- #### Cucumber 0.x to 2.x
66
+ When using Serenity/JS with WebdriverIO, follow the official [Serenity/JS WebdriverIO + Cucumber integration guide](https://serenity-js.org/handbook/test-runners/webdriverio/#integrating-serenityjs-reporting).
77
67
 
78
- ```
79
- cucumber-js --require=node_modules/@serenity-js/cucumber/lib/index.js \
80
- --require ./features/support/setup.js \
81
- --require ./features/step_definitions/sample.steps.js
82
- ```
68
+ To use Serenity/JS with Cucumber and Playwright, follow the steps below, or use one of the available [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/#playwright).
83
69
 
84
- ### Configuration
70
+ ### Configuring Cucumber.js
85
71
 
86
- When used with a configuration file written in JavaScript:
72
+ Use the [`cucumber.js` configuration file](https://github.com/cucumber/cucumber-js/blob/main/docs/profiles.md)
73
+ to set up Cucumber to use Serenity/JS as the "formatter" and load extra `*.config.ts` files.
87
74
 
88
75
  ```javascript
89
- // features/support/setup.js
76
+ // cucumber.js
77
+ module.exports = {
78
+ default: {
79
+ // Use TypeScript in-memory transpiler, ts-node
80
+ // requires `npm install --save-dev ts-node`
81
+ requireModule: ['ts-node/register'],
82
+
83
+ // Use Serenity/JS Cucumber adapter
84
+ format: ['@serenity-js/cucumber'],
85
+ // Configure the adapter
86
+ formatOptions: {
87
+ specDirectory: 'features'
88
+ },
89
+ require: [
90
+ // Load configuration files
91
+ './features/**/*.config.ts',
92
+ // Load step definition libraries
93
+ './features/**/*.steps.ts'
94
+ ],
95
+ }
96
+ }
97
+ ```
98
+
99
+ ### Configuring Serenity/JS
100
+
101
+ To configure Serenity/JS, create a `serenity.config.ts` file with the following content:
90
102
 
91
- const { configure } = require('@serenity-js/core')
92
-
93
- configure({
94
- // ... configure Serenity/JS
103
+ ```typescript
104
+ // features/support/serenity.config.ts
105
+ import { configure, Cast } from '@serenity-js/core'
106
+ import { BeforeAll } from '@cucumber/cucumber'
107
+
108
+ BeforeAll(async () => {
109
+
110
+ // ... start any services or browsers here
111
+
112
+ // Configure Serenity/JS
113
+ configure({
114
+
115
+ actors: Cast.where(actor => {
116
+ return actor.whoCan(
117
+ // ... add abilities here
118
+ )
119
+ }),
120
+
121
+ crew: [
122
+ [ '@serenity-js/console-reporter', { theme: 'auto' } ],
123
+ // ... add other crew members here
124
+ ]
125
+ })
95
126
  })
96
127
  ```
97
128
 
98
- When used with a configuration file written in TypeScript:
129
+ See the Serenity/JS [configuration options](https://serenity-js.org/api/core/class/SerenityConfig/) and [reporting guide](https://serenity-js.org/handbook/reporting/).
99
130
 
100
- ```typescript
101
- // features/support/setup.ts
131
+ ## Documentation
102
132
 
103
- import { configure } from '@serenity-js/core'
133
+ - [API Reference](https://serenity-js.org/api/)
134
+ - [Screenplay Pattern Guide](https://serenity-js.org/handbook/design/screenplay-pattern/)
135
+ - [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/)
136
+ - [Tutorial: First Web Scenario](https://serenity-js.org/handbook/tutorials/your-first-web-scenario/)
137
+ - [Tutorial: First API Scenario](https://serenity-js.org/handbook/tutorials/your-first-api-scenario/)
104
138
 
105
- configure({
106
- // ... configure Serenity/JS
107
- })
108
- ```
139
+ ## Contributing
109
140
 
110
- ### Integration
141
+ Contributions of all kinds are welcome! Get started with the [Contributing Guide](https://serenity-js.org/community/contributing/).
111
142
 
112
- This module can be integrated with:
113
- - [`@serenity-js/serenity-bdd`](https://serenity-js.org/api/serenity-bdd) to produce HTML reports and living documentation,
114
- - [`@serenity-js/console-reporter`](https://serenity-js.org/api/console-reporter) to print test execution reports to your computer terminal,
115
- - [`@serenity-js/protractor`](https://serenity-js.org/api/protractor) to implement Cucumber scenarios interacting with Web applications.
143
+ ## Community
116
144
 
117
- Learn more about [Serenity/JS modular architecture](https://serenity-js.org/handbook/about/architecture).
145
+ - [Community Chat](https://matrix.to/#/#serenity-js:gitter.im)
146
+ - [Discussions Forum](https://github.com/orgs/serenity-js/discussions)
147
+ - Visit the [💡How to... ?](https://github.com/orgs/serenity-js/discussions/categories/how-to) section for answers to common questions
118
148
 
119
- ## 📣 Stay up to date
149
+ If you enjoy using Serenity/JS, make sure to star ⭐️ [Serenity/JS on GitHub](https://github.com/serenity-js/serenity-js) to help others discover the framework!
120
150
 
121
- New features, tutorials, and demos are coming soon!
122
- Follow [Serenity/JS on LinkedIn](https://www.linkedin.com/company/serenity-js),
123
- subscribe to [Serenity/JS channel on YouTube](https://www.youtube.com/@serenity-js) and join the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im) to stay up to date!
124
- Please also make sure to star ⭐️ [Serenity/JS on GitHub](https://github.com/serenity-js/serenity-js) to help others discover the framework!
151
+ ## License
125
152
 
126
- [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
127
- [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
128
- [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
129
- [![GitHub stars](https://img.shields.io/github/stars/serenity-js/serenity-js?label=Serenity%2FJS&logo=github&style=badge)](https://github.com/serenity-js/serenity-js)
153
+ The Serenity/JS code base is licensed under the [Apache-2.0](https://opensource.org/license/apache-2-0) license,
154
+ while its documentation and the [Serenity/JS Handbook](https://serenity-js.org/handbook/) are licensed under the [Creative Commons BY-NC-SA 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/).
155
+
156
+ See the [Serenity/JS License](https://serenity-js.org/legal/license/).
157
+
158
+ ## Support
130
159
 
131
- ## 💛 Support Serenity/JS
160
+ Support ongoing development through [GitHub Sponsors](https://github.com/sponsors/serenity-js). Sponsors gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks)
161
+ and priority help in the [Discussions Forum](https://github.com/orgs/serenity-js/discussions).
132
162
 
133
- If you appreciate all the effort that goes into making sophisticated tools easy to work with, please support our work and become a Serenity/JS GitHub Sponsor today!
163
+ For corporate sponsorship or commercial support, please contact [Jan Molak](https://www.linkedin.com/in/janmolak/).
134
164
 
135
- [![GitHub Sponsors](https://img.shields.io/badge/Support%20@serenity%2FJS-703EC8?style=for-the-badge&logo=github&logoColor=white)](https://github.com/sponsors/serenity-js)
165
+ [![GitHub Sponsors](https://img.shields.io/badge/Support%20@serenity%2FJS-703EC8?style=for-the-badge&logo=github&logoColor=white)](https://github.com/sponsors/serenity-js).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/cucumber",
3
- "version": "3.36.2",
3
+ "version": "3.37.0",
4
4
  "description": "Serenity/JS test runner adapter for seamless integration with any version of Cucumber.js, facilitating BDD-style test automation and leveraging Serenity/JS reporting capabilities",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@cucumber/messages": "26.0.1",
54
- "@serenity-js/core": "3.36.2",
54
+ "@serenity-js/core": "3.37.0",
55
55
  "cli-table3": "0.6.5",
56
56
  "gherkin": "5.1.0",
57
57
  "tiny-types": "1.24.3"
@@ -69,7 +69,7 @@
69
69
  }
70
70
  },
71
71
  "devDependencies": {
72
- "@cucumber/cucumber": "12.2.0",
72
+ "@cucumber/cucumber": "12.3.0",
73
73
  "@integration/testing-tools": "3.0.0",
74
74
  "@types/chai": "4.3.20",
75
75
  "@types/mocha": "10.0.10",
@@ -79,5 +79,5 @@
79
79
  "ts-node": "10.9.2",
80
80
  "typescript": "5.9.3"
81
81
  },
82
- "gitHead": "bce71a2454b8c6e2639bc351cc84f47c0c8cbb0a"
82
+ "gitHead": "dae146cd99a04f09b5926fb9d3205af562fa2927"
83
83
  }