@serenity-js/cucumber 3.36.2 → 3.37.1
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/CHANGELOG.md +22 -0
- package/README.md +120 -90
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.1](https://github.com/serenity-js/serenity-js/compare/v3.37.0...v3.37.1) (2025-12-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update dependency @cucumber/cucumber to v12.4.0 ([f6238bb](https://github.com/serenity-js/serenity-js/commit/f6238bb27f185138a53caf2163dbd0c2984475b0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.37.0](https://github.com/serenity-js/serenity-js/compare/v3.36.2...v3.37.0) (2025-12-02)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **deps:** update dependency @cucumber/cucumber to v12.3.0 ([7056e71](https://github.com/serenity-js/serenity-js/commit/7056e7129928f7e1db57ed6e7657ffa8bfd486ed))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [3.36.2](https://github.com/serenity-js/serenity-js/compare/v3.36.1...v3.36.2) (2025-11-26)
|
|
7
29
|
|
|
8
30
|
**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
|
+
[](https://badge.fury.io/js/%40serenity-js%2Fcucumber)
|
|
4
|
+
[](https://github.com/serenity-js/serenity-js/actions)
|
|
5
|
+
[](https://qlty.sh/gh/serenity-js/projects/serenity-js)
|
|
6
|
+
[](https://qlty.sh/gh/serenity-js/projects/serenity-js)
|
|
7
|
+
[](https://github.com/serenity-js/serenity-js/graphs/contributors)
|
|
8
|
+
[](https://snyk.io/test/npm/@serenity-js/cucumber)
|
|
9
|
+
[](https://github.com/serenity-js/serenity-js)
|
|
2
10
|
|
|
3
11
|
[](https://www.linkedin.com/company/serenity-js)
|
|
4
12
|
[](https://www.youtube.com/@serenity-js)
|
|
5
13
|
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
6
14
|
[](https://github.com/sponsors/serenity-js)
|
|
7
15
|
|
|
8
|
-
[
|
|
9
|
-
|
|
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
|
-
##
|
|
19
|
+
## Features
|
|
24
20
|
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
70
|
+
### Configuring Cucumber.js
|
|
85
71
|
|
|
86
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
configure
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
-
// features/support/setup.ts
|
|
131
|
+
## Documentation
|
|
102
132
|
|
|
103
|
-
|
|
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
|
-
|
|
106
|
-
// ... configure Serenity/JS
|
|
107
|
-
})
|
|
108
|
-
```
|
|
139
|
+
## Contributing
|
|
109
140
|
|
|
110
|
-
|
|
141
|
+
Contributions of all kinds are welcome! Get started with the [Contributing Guide](https://serenity-js.org/community/contributing/).
|
|
111
142
|
|
|
112
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
127
|
-
[
|
|
128
|
-
|
|
129
|
-
[
|
|
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
|
-
|
|
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
|
-
|
|
163
|
+
For corporate sponsorship or commercial support, please contact [Jan Molak](https://www.linkedin.com/in/janmolak/).
|
|
134
164
|
|
|
135
165
|
[](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.
|
|
3
|
+
"version": "3.37.1",
|
|
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.
|
|
54
|
+
"@serenity-js/core": "3.37.1",
|
|
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.
|
|
72
|
+
"@cucumber/cucumber": "12.4.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": "
|
|
82
|
+
"gitHead": "0af3eff400cdb5adc9d7b92e87b09820c93d77c9"
|
|
83
83
|
}
|