@serenity-js/serenity-bdd 3.14.1 → 3.15.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 (113) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +4 -302
  3. package/lib/cli/commands/run.d.ts +2 -1
  4. package/lib/cli/commands/run.d.ts.map +1 -1
  5. package/lib/cli/commands/run.js +6 -4
  6. package/lib/cli/commands/run.js.map +1 -1
  7. package/lib/cli/defaults.d.ts +2 -4
  8. package/lib/cli/defaults.d.ts.map +1 -1
  9. package/lib/cli/defaults.js +3 -5
  10. package/lib/cli/defaults.js.map +1 -1
  11. package/lib/index.d.ts +4 -2
  12. package/lib/index.d.ts.map +1 -1
  13. package/lib/index.js +2 -2
  14. package/lib/index.js.map +1 -1
  15. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.d.ts +35 -11
  16. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.d.ts.map +1 -1
  17. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.js +66 -11
  18. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.js.map +1 -1
  19. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporterConfig.d.ts +40 -0
  20. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporterConfig.d.ts.map +1 -0
  21. package/lib/stage/crew/serenity-bdd-reporter/{SerenityBDDJsonSchema.js → SerenityBDDReporterConfig.js} +1 -1
  22. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDReporterConfig.js.map +1 -0
  23. package/lib/stage/crew/serenity-bdd-reporter/SpecDirectory.d.ts +9 -0
  24. package/lib/stage/crew/serenity-bdd-reporter/SpecDirectory.d.ts.map +1 -0
  25. package/lib/stage/crew/serenity-bdd-reporter/SpecDirectory.js +29 -0
  26. package/lib/stage/crew/serenity-bdd-reporter/SpecDirectory.js.map +1 -0
  27. package/lib/stage/crew/serenity-bdd-reporter/index.d.ts +1 -0
  28. package/lib/stage/crew/serenity-bdd-reporter/index.d.ts.map +1 -1
  29. package/lib/stage/crew/serenity-bdd-reporter/index.js +1 -0
  30. package/lib/stage/crew/serenity-bdd-reporter/index.js.map +1 -1
  31. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessor.d.ts +5 -2
  32. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessor.d.ts.map +1 -1
  33. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessor.js +4 -0
  34. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessor.js.map +1 -1
  35. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessors.d.ts +2 -0
  36. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessors.d.ts.map +1 -1
  37. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessors.js +6 -2
  38. package/lib/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessors.js.map +1 -1
  39. package/lib/stage/crew/serenity-bdd-reporter/processors/LinkedTestStep.d.ts +2 -2
  40. package/lib/stage/crew/serenity-bdd-reporter/processors/LinkedTestStep.d.ts.map +1 -1
  41. package/lib/stage/crew/serenity-bdd-reporter/processors/SerenityBDDReportContext.d.ts +6 -3
  42. package/lib/stage/crew/serenity-bdd-reporter/processors/SerenityBDDReportContext.d.ts.map +1 -1
  43. package/lib/stage/crew/serenity-bdd-reporter/processors/SerenityBDDReportContext.js +4 -0
  44. package/lib/stage/crew/serenity-bdd-reporter/processors/SerenityBDDReportContext.js.map +1 -1
  45. package/lib/stage/crew/serenity-bdd-reporter/processors/mappers/errorReportFrom.d.ts +2 -2
  46. package/lib/stage/crew/serenity-bdd-reporter/processors/mappers/errorReportFrom.d.ts.map +1 -1
  47. package/lib/stage/crew/serenity-bdd-reporter/processors/mappers/outcomeReportFrom.d.ts +2 -2
  48. package/lib/stage/crew/serenity-bdd-reporter/processors/mappers/outcomeReportFrom.d.ts.map +1 -1
  49. package/lib/stage/crew/serenity-bdd-reporter/processors/mappers/outcomeReportFrom.js.map +1 -1
  50. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceEventQueueProcessor.d.ts +2 -2
  51. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceEventQueueProcessor.d.ts.map +1 -1
  52. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceEventQueueProcessor.js +1 -1
  53. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceEventQueueProcessor.js.map +1 -1
  54. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceReportContext.d.ts +2 -2
  55. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceReportContext.d.ts.map +1 -1
  56. package/lib/stage/crew/serenity-bdd-reporter/processors/scene-sequence/transformations/scenarioParametersOf.js.map +1 -1
  57. package/lib/stage/crew/serenity-bdd-reporter/processors/single-scene/SingleSceneEventQueueProcessor.d.ts +2 -2
  58. package/lib/stage/crew/serenity-bdd-reporter/processors/single-scene/SingleSceneEventQueueProcessor.d.ts.map +1 -1
  59. package/lib/stage/crew/serenity-bdd-reporter/processors/single-scene/SingleSceneEventQueueProcessor.js +1 -1
  60. package/lib/stage/crew/serenity-bdd-reporter/processors/single-scene/SingleSceneEventQueueProcessor.js.map +1 -1
  61. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/activityFinished.js +1 -1
  62. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/activityFinished.js.map +1 -1
  63. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/activityStarted.d.ts.map +1 -1
  64. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/activityStarted.js +7 -1
  65. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/activityStarted.js.map +1 -1
  66. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/archivedActivityRelatedArtifact.d.ts.map +1 -1
  67. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/archivedActivityRelatedArtifact.js +1 -0
  68. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/archivedActivityRelatedArtifact.js.map +1 -1
  69. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/executionFinishedAt.js +1 -1
  70. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/executionFinishedAt.js.map +1 -1
  71. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/executionStartedAt.js +1 -1
  72. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/executionStartedAt.js.map +1 -1
  73. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/scenarioDetailsOf.d.ts.map +1 -1
  74. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/scenarioDetailsOf.js +29 -10
  75. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/scenarioDetailsOf.js.map +1 -1
  76. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/tagOf.js.map +1 -1
  77. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/testRunnerCalled.js +1 -1
  78. package/lib/stage/crew/serenity-bdd-reporter/processors/transformations/testRunnerCalled.js.map +1 -1
  79. package/lib/stage/crew/serenity-bdd-reporter/serenity-bdd-report-schema.d.ts +151 -0
  80. package/lib/stage/crew/serenity-bdd-reporter/serenity-bdd-report-schema.d.ts.map +1 -0
  81. package/lib/stage/crew/serenity-bdd-reporter/serenity-bdd-report-schema.js +3 -0
  82. package/lib/stage/crew/serenity-bdd-reporter/serenity-bdd-report-schema.js.map +1 -0
  83. package/package.json +7 -7
  84. package/src/cli/commands/run.ts +9 -6
  85. package/src/cli/defaults.ts +3 -5
  86. package/src/index.ts +4 -3
  87. package/src/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.ts +80 -14
  88. package/src/stage/crew/serenity-bdd-reporter/SerenityBDDReporterConfig.ts +40 -0
  89. package/src/stage/crew/serenity-bdd-reporter/SpecDirectory.ts +28 -0
  90. package/src/stage/crew/serenity-bdd-reporter/index.ts +1 -0
  91. package/src/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessor.ts +6 -2
  92. package/src/stage/crew/serenity-bdd-reporter/processors/EventQueueProcessors.ts +14 -6
  93. package/src/stage/crew/serenity-bdd-reporter/processors/LinkedTestStep.ts +2 -2
  94. package/src/stage/crew/serenity-bdd-reporter/processors/SerenityBDDReportContext.ts +8 -4
  95. package/src/stage/crew/serenity-bdd-reporter/processors/mappers/errorReportFrom.ts +3 -3
  96. package/src/stage/crew/serenity-bdd-reporter/processors/mappers/outcomeReportFrom.ts +3 -3
  97. package/src/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceEventQueueProcessor.ts +3 -3
  98. package/src/stage/crew/serenity-bdd-reporter/processors/scene-sequence/SceneSequenceReportContext.ts +2 -2
  99. package/src/stage/crew/serenity-bdd-reporter/processors/scene-sequence/transformations/scenarioParametersOf.ts +4 -4
  100. package/src/stage/crew/serenity-bdd-reporter/processors/single-scene/SingleSceneEventQueueProcessor.ts +3 -3
  101. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/activityFinished.ts +1 -1
  102. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/activityStarted.ts +9 -2
  103. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/archivedActivityRelatedArtifact.ts +1 -0
  104. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/executionFinishedAt.ts +1 -1
  105. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/executionStartedAt.ts +1 -1
  106. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/scenarioDetailsOf.ts +34 -10
  107. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/tagOf.ts +3 -3
  108. package/src/stage/crew/serenity-bdd-reporter/processors/transformations/testRunnerCalled.ts +2 -2
  109. package/src/stage/crew/serenity-bdd-reporter/serenity-bdd-report-schema.ts +165 -0
  110. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDJsonSchema.d.ts +0 -115
  111. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDJsonSchema.d.ts.map +0 -1
  112. package/lib/stage/crew/serenity-bdd-reporter/SerenityBDDJsonSchema.js.map +0 -1
  113. package/src/stage/crew/serenity-bdd-reporter/SerenityBDDJsonSchema.ts +0 -134
package/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
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.15.0](https://github.com/serenity-js/serenity-js/compare/v3.14.2...v3.15.0) (2024-01-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **serenity-bdd:** upgraded Serenity BDD CLI to 4.0.43 ([e1d22e9](https://github.com/serenity-js/serenity-js/commit/e1d22e92e120c7b6205ffe63dc22ebba5844e7ba)), closes [#1147](https://github.com/serenity-js/serenity-js/issues/1147)
12
+
13
+
14
+ ### Features
15
+
16
+ * **serenity-bdd:** auto-detect requirements hierarchy root directory ([e2011b0](https://github.com/serenity-js/serenity-js/commit/e2011b0b95565d67e8ee785f3e197f827703a934)), closes [#1147](https://github.com/serenity-js/serenity-js/issues/1147)
17
+ * **serenity-bdd:** support for Serenity BDD 4 ([c15c366](https://github.com/serenity-js/serenity-js/commit/c15c3660f957c21c367f8f27218a05d3fbca78de)), closes [#1147](https://github.com/serenity-js/serenity-js/issues/1147)
18
+ * **serenity-bdd:** support for Serenity BDD 4 ([0760417](https://github.com/serenity-js/serenity-js/commit/0760417e2fa3e9fbfc78cd9965052531625bf45e))
19
+ * **serenity-bdd:** support for Serenity BDD CLI v4.0.40 ([271068e](https://github.com/serenity-js/serenity-js/commit/271068e7ff64659138c5662cd3b8ae93bc7a7438)), closes [#1147](https://github.com/serenity-js/serenity-js/issues/1147)
20
+ * **serenity-bdd:** support for Serenity BDD v4 CLI ([6988248](https://github.com/serenity-js/serenity-js/commit/69882485ce28bb18e502b3f49740a4f82aedaa1d)), closes [#1147](https://github.com/serenity-js/serenity-js/issues/1147) [#2042](https://github.com/serenity-js/serenity-js/issues/2042)
21
+
22
+
23
+
24
+
25
+
26
+ ## [3.14.2](https://github.com/serenity-js/serenity-js/compare/v3.14.1...v3.14.2) (2023-12-12)
27
+
28
+ **Note:** Version bump only for package @serenity-js/serenity-bdd
29
+
30
+
31
+
32
+
33
+
6
34
  ## [3.14.1](https://github.com/serenity-js/serenity-js/compare/v3.14.0...v3.14.1) (2023-12-10)
7
35
 
8
36
 
package/README.md CHANGED
@@ -12,7 +12,7 @@ of complex software systems faster, more collaborative and easier to scale.
12
12
  - [Serenity/JS web testing tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario)
13
13
  - [Serenity/JS Handbook](https://serenity-js.org/handbook) and [Getting Started guides](https://serenity-js.org/handbook/getting-started/)
14
14
  - [API documentation](https://serenity-js.org/api/core)
15
- - [Serenity/JS Project Templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates)
15
+ - [Serenity/JS Project Templates on GitHub](https://serenity-js.org/handbook/getting-started/project-templates/)
16
16
 
17
17
  👋 Join the Serenity/JS Community!
18
18
  - Meet other Serenity/JS developers and maintainers on the [Serenity/JS Community chat channel](https://matrix.to/#/#serenity-js:gitter.im),
@@ -24,307 +24,9 @@ of complex software systems faster, more collaborative and easier to scale.
24
24
 
25
25
  [`@serenity-js/serenity-bdd`](https://serenity-js.org/api/serenity-bdd/) module integrates Serenity/JS and the Serenity BDD reporting CLI.
26
26
 
27
- This integration enables your Serenity/JS tests to produce interim JSON reports, which the Serenity BDD reporting CLI
28
- can then turn into world-class, illustrated test reports and living documentation. Learn more about [Serenity/JS reporting](https://serenity-js.org/handbook/reporting/index.html).
29
-
30
- ### Installation
31
-
32
- To install this module, run the following command in your computer terminal:
33
-
34
- ```sh
35
- npm install --save-dev @serenity-js/core @serenity-js/serenity-bdd
36
- ```
37
-
38
- To learn more about Serenity/JS and how to use it on your project, follow the [Serenity/JS Getting Started guide](https://serenity-js.org/handbook/getting-started/).
39
-
40
- ### SerenityBDDReporter
41
-
42
- To allow Serenity/JS to produce Serenity BDD-standard JSON reports, assign the `SerenityBDDReporter` to the `Stage`
43
- and configure the `ArtifactArchiver` to store the reports at the location where Serenity BDD expects to find them.
44
-
45
- This can be done:
46
- - via `playwright.config.ts`, if you're using Serenity/JS with [Playwright Test](https://serenity-js.org/api/playwright-test)
47
- - via `wdio.conf.ts`, if you're using Serenity/JS with [WebdriverIO](https://serenity-js.org/api/playwright-test)
48
- - via `protractor.conf.js`, if you're using Serenity/JS with [Protractor](https://serenity-js.org/api/protractor)
49
- - or programmatically.
50
-
51
- #### Usage with Playwright Test
52
-
53
- Learn more about using [Serenity/JS with Playwright Test](https://serenity-js.org/api/playwright-test).
54
-
55
- ```typescript
56
- // playwright.config.ts
57
- import type { PlaywrightTestConfig } from '@serenity-js/playwright-test'
58
-
59
- const config: PlaywrightTestConfig = {
60
- reporter: [
61
- [ '@serenity-js/playwright-test', {
62
- crew: [
63
- '@serenity-js/serenity-bdd',
64
- [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
65
- ]
66
- }]
67
- ],
68
-
69
- // Other configuration omitted for brevity
70
- // For details, see https://playwright.dev/docs/test-configuration
71
- }
72
-
73
- export default config
74
- ```
75
-
76
- #### Usage with WebdriverIO
77
-
78
- Learn more about using [Serenity/JS with WebdriverIO](https://serenity-js.org/api/webdriverio).
79
-
80
- ```typescript
81
- // wdio.conf.ts
82
-
83
- import { WebdriverIOConfig } from '@serenity-js/webdriverio'
84
-
85
- export const config: WebdriverIOConfig = {
86
-
87
- framework: '@serenity-js/webdriverio',
88
-
89
- serenity: {
90
- crew: [
91
- '@serenity-js/serenity-bdd',
92
- [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
93
- ]
94
- },
95
-
96
- // Other configuration omitted for brevity
97
- // For details, see https://webdriver.io/docs/options
98
- }
99
- ```
100
-
101
- #### Usage with Protractor
102
-
103
- Learn more about using [Serenity/JS with Protractor](https://serenity-js.org/api/protractor).
104
-
105
- ```javascript
106
- // protractor.conf.js
107
-
108
- exports.config = {
109
-
110
- framework: 'custom',
111
- frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
112
-
113
- serenity: {
114
- crew: [
115
- '@serenity-js/serenity-bdd',
116
- [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
117
- ]
118
- },
119
-
120
- // ...
121
- }
122
- ```
123
-
124
- #### Programmatic configuration
125
-
126
- Learn more about [configuring Serenity/JS programmatically](https://serenity-js.org/api/core/class/SerenityConfig).
127
-
128
- ```typescript
129
- import { ArtifactArchiver, configure } from '@serenity-js/core'
130
- import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
131
-
132
- configure({
133
- crew: [
134
- ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
135
- new SerenityBDDReporter()
136
- ],
137
- })
138
- ```
139
-
140
- ### Serenity BDD Living Documentation
141
-
142
- To turn the Serenity BDD-standard JSON reports produced by the `SerenityBDDReporter` into Serenity BDD test reports,
143
- you need the [Serenity BDD reporting CLI](https://github.com/serenity-bdd/serenity-cli).
144
-
145
- The Serenity BDD reporting CLI is a Java program, distributed as an executable `.jar` file and [available on Bintray](https://bintray.com/serenity/maven/serenity-cli).
146
-
147
- This module ships with a `serenity-bdd` CLI wrapper that makes downloading and running the Serenity BDD reporting CLI easy.
148
-
149
- To learn more about the usage of the `serenity-bdd` wrapper, run:
150
-
151
- ```console
152
- npx serenity-bdd --help
153
- ```
154
-
155
- #### Configuring Serenity BDD reporting CLI
156
-
157
- To configure the [Serenity BDD reporting CLI](https://github.com/serenity-bdd/serenity-cli), place a file called `serenity.properties`
158
- in your project root directory.
159
-
160
- For example:
161
-
162
- ```
163
- # serenity.properties
164
- serenity.project.name=My awesome project
165
- ```
166
-
167
- Please note that the reporting CLI considers only those properties that are related to producing test reports.
168
- Learn more about configuring [`serenity.properties`](https://serenity-bdd.github.io/docs/reference/serenity-properties).
169
-
170
- #### Downloading the Serenity BDD reporting CLI
171
-
172
- To download the Serenity BDD reporting CLI or to update it, use the update command:
173
-
174
- ```console
175
- npx serenity-bdd update
176
- ```
177
-
178
- You can also tell it to download the Serenity BDD reporting CLI jar from your company's artifact repository if you can't use the official Bintray one:
179
-
180
- ```
181
- npx serenity-bdd update --repository https://artifactory.example.org/
182
- ```
183
-
184
- To learn more about the `update` command, run:
185
-
186
- ```
187
- npx serenity-bdd --help update
188
- ```
189
-
190
- Please note that the `update` command will try to download the `.jar` only if you don't have it cached already, or when the one you have is not up to date. Otherwise, no outbound network calls are made.
191
-
192
- ##### Downloading through a proxy
193
-
194
- The `update` command will pick up your proxy configuration automatically from your [NPM config](https://docs.npmjs.com/cli/v6/commands/npm-config), [`.npmrc` file](https://docs.npmjs.com/cli/v6/configuring-npm/npmrc), or environment variables.
195
-
196
- Please note that you only need to use one of those configuration mechanisms.
197
-
198
- ###### Use NPM config (Linux, macOS, Windows)
199
-
200
- To use NPM-level configuration, run the following commands in your terminal:
201
-
202
- ```console
203
- npm config set proxy http://[user:pwd]@domain.tld:port
204
- npm config set https-proxy http://[user:pwd]@domain.tld:port
205
- ```
206
-
207
- If your proxy requires a certificate file, you can provide a path to it as follows:
208
-
209
- ```console
210
- npm config set cafile /path/to/root-ca.pem
211
- ```
212
-
213
- The above can also be accomplished by placing an [`.npmrc` file](https://docs.npmjs.com/cli/v6/configuring-npm/npmrc) with following contents in your home directory or your project root:
214
-
215
- ```bash
216
- # ~/.npmrc
217
- proxy = http://[user:pwd]@domain.tld:port
218
- https-proxy = http://[user:pwd]@domain.tld:port
219
-
220
- cafile = /path/to/root-ca.pem # optional
221
- noproxy = localhost,mycompany.com # optional
222
- ```
223
-
224
- ###### Environment variables on Linux or macOS
225
-
226
- To set your proxy on Linux or macOS, run the following commands in your terminal:
227
-
228
- ```console
229
- export HTTP_PROXY=http://[user:pwd]@domain.tld:port
230
- export HTTPS_PROXY=http://[user:pwd]@domain.tld:port
231
- ```
232
-
233
- If needed, you can also set a `NO_PROXY` variable to a comma-separated list of domains that don't require a proxy, for example:
234
-
235
- ```console
236
- export NO_PROXY=localhost,mycompany.com
237
- ```
238
-
239
- Please note that you can add the above commands to your shell's `~/.profile`, so that they're executed whenever you open a new terminal.
240
-
241
- ###### Environment variables on Windows
242
-
243
- To configure a proxy on Windows, run the following commands in Command Prompt:
244
-
245
- ```console
246
- set HTTP_PROXY=http://[user:pwd]@domain.tld:port
247
- set HTTPS_PROXY=http://[user:pwd]@domain.tld:port
248
- ```
249
-
250
- If you're using Powershell, run the following commands instead:
251
-
252
- ```console
253
- $env:HTTP_PROXY = http://[user:pwd]@domain.tld:port
254
- $env:HTTPS_PROXY = http://[user:pwd]@domain.tld:port
255
- ```
256
-
257
- ##### Use a specific User-Agent
258
-
259
- If your artifact registry requires you to use a specific user agent, you can configure it using NPM config:
260
-
261
- ```console
262
- npm config set user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"
263
- ```
264
-
265
- ##### Ignore SSL checks
266
-
267
- You can instruct the `update` command to ignore any SSL certificate errors by providing an `--ignoreSSL` flag when running the command:
268
-
269
- ```console
270
- npx serenity-bdd update --ignoreSSL
271
- ```
272
-
273
- You can also disable certificate checks at the NPM config level by running:
274
-
275
- ```console
276
- npm config set strict-ssl false
277
- ```
278
-
279
- Alternative, you can accomplish the same with an `.npmrc` file:
280
-
281
- ```bash
282
- # ~/.npmrc
283
- npm_config_strict-ssl = false
284
- ```
285
-
286
- #### Producing the Serenity BDD test report
287
-
288
- To produce the Serenity BDD test report and living documentation using default settings, run:
289
-
290
- ```
291
- npx serenity-bdd run
292
- ```
293
-
294
- To learn more about the `run` command and how to change the default settings, run:
295
-
296
- ```
297
- npx serenity-bdd --help run
298
- ```
299
-
300
- ### Using NPM scripts
301
-
302
- [Serenity BDD reports](https://serenity-js.org/handbook/reporting/serenity-bdd-reporter) are generated by [Serenity BDD CLI](https://github.com/serenity-bdd/serenity-core/tree/main/serenity-cli),
303
- a Java program downloaded and managed by the [`@serenity-js/serenity-bdd`](https://serenity-js.org/api/serenity-bdd) module.
304
-
305
- In general, to produce Serenity BDD reports, your test suite must:
306
- - download the Serenity BDD CLI, by calling `serenity-bdd update`
307
- - produce intermediate Serenity BDD `.json` reports, by registering [`SerenityBDDReporter`](https://serenity-js.org/api/serenity-bdd/class/SerenityBDDReporter)
308
- - invoke the Serenity BDD CLI when you want to produce the report, by calling `serenity-bdd run`
309
-
310
- The pattern used by all the [Serenity/JS Project Templates](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates) relies
311
- on using:
312
- - an NPM [`postinstall`](https://docs.npmjs.com/cli/v9/using-npm/scripts#life-cycle-operation-order) script to download the Serenity BDD CLI
313
- - [`npm-failsafe`](https://www.npmjs.com/package/npm-failsafe) to run the reporting process even if the test suite itself has failed (which is precisely when you need test reports the most...).
314
- - [`rimraf`](https://www.npmjs.com/package/rimraf) as a convenience method to remove any test reports left over from the previous run
315
-
316
- ```json title="package.json"
317
- {
318
- "scripts": {
319
- "postinstall": "serenity-bdd update",
320
- "clean": "rimraf target",
321
- "test": "failsafe clean test:execute test:report",
322
- "test:execute": "cucumber-js",
323
- "test:report": "serenity-bdd run --features ./features ",
324
- }
325
- }
326
- ```
327
- Note that in the above code sample, you should configure `test:execute` to invoke [your test runner of choice](https://serenity-js.org/handbook/test-runners/).
27
+ Learn more about [Serenity/JS reporting with Serenity BDD](https://serenity-js.org/handbook/reporting/serenity-bdd-reporter/):
28
+ - [Installation, configuration and usage](https://serenity-js.org/handbook/reporting/serenity-bdd-reporter/#installation-and-usage)
29
+ - [Best practices](https://serenity-js.org/handbook/reporting/serenity-bdd-reporter/#serenity-bdd-best-practices)
328
30
 
329
31
  ## 📣 Stay up to date
330
32
 
@@ -1,3 +1,4 @@
1
+ import { Path } from '@serenity-js/core/lib/io';
1
2
  import type { Argv } from '../Argv';
2
3
  declare const _default: {
3
4
  command: string;
@@ -12,7 +13,7 @@ declare const _default: {
12
13
  describe: string;
13
14
  };
14
15
  features: {
15
- default: string;
16
+ default: Path;
16
17
  describe: string;
17
18
  };
18
19
  artifact: {
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/run.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA0DV,IAAI,KAAG,QAAQ,IAAI,CAAC;;AAhD9C,kBAmFE"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/run.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA4DV,IAAI,KAAG,QAAQ,IAAI,CAAC;;AAhD9C,kBAmFE"}
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  const core_1 = require("@serenity-js/core");
26
26
  const io_1 = require("@serenity-js/core/lib/io");
27
27
  const path = __importStar(require("path")); // eslint-disable-line unicorn/import-style
28
+ const SpecDirectory_1 = require("../../stage/crew/serenity-bdd-reporter/SpecDirectory");
28
29
  const defaults_1 = require("../defaults");
29
30
  const io_2 = require("../io");
30
31
  const model_1 = require("../model");
@@ -32,6 +33,7 @@ const Printer_1 = require("../Printer");
32
33
  const screenplay_1 = require("../screenplay");
33
34
  const stage_1 = require("../stage");
34
35
  const yargs = require('yargs'); // eslint-disable-line @typescript-eslint/no-var-requires
36
+ const cwd = new io_1.Path(process.cwd());
35
37
  module.exports = {
36
38
  command: 'run',
37
39
  desc: 'Invokes the Serenity BDD CLI jar to produce a Serenity BDD HTML report from the Serenity/JS JSON reports',
@@ -45,8 +47,8 @@ module.exports = {
45
47
  describe: 'A relative path to the directory where the Serenity BDD report should be produced',
46
48
  },
47
49
  features: {
48
- default: defaults_1.defaults.featuresDir,
49
- describe: 'A relative path to the directory containing the Cucumber.js feature files',
50
+ default: cwd.relative(new SpecDirectory_1.SpecDirectory(new io_1.FileSystem(cwd)).guessLocation()),
51
+ describe: 'A relative path to the requirements hierarchy root directory, such as "./features" or "./spec"',
50
52
  },
51
53
  artifact: {
52
54
  default: defaults_1.defaults.artifact,
@@ -66,7 +68,7 @@ module.exports = {
66
68
  describe: `Base URL of your JIRA server`,
67
69
  },
68
70
  project: {
69
- default: path.basename(process.cwd()),
71
+ default: cwd.basename(),
70
72
  describe: `Project name to appear in the Serenity reports`,
71
73
  },
72
74
  shortFilenames: {
@@ -83,7 +85,7 @@ module.exports = {
83
85
  handler: async (argv) => {
84
86
  const printer = new Printer_1.Printer(process.stdout, process.stderr), artifactGAV = model_1.GAV.fromString(argv.artifact), pathToArtifact = new io_1.Path(argv.cacheDir).join(artifactGAV.toPath()), moduleRoot = path.resolve(__dirname, '../../../');
85
87
  (0, core_1.configure)({
86
- actors: new stage_1.RunCommandActors(new io_1.Path(process.cwd())),
88
+ actors: new stage_1.RunCommandActors(cwd),
87
89
  crew: [
88
90
  new stage_1.NotificationReporter(printer),
89
91
  new stage_1.ProgressReporter(printer),
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/cli/commands/run.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA2D;AAC3D,iDAAgD;AAChD,2CAA6B,CAAG,2CAA2C;AAG3E,0CAAuC;AACvC,8BAAoC;AACpC,oCAA+B;AAC/B,wCAAqC;AACrC,8CAA0F;AAC1F,oCAAoF;AAEpF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,yDAAyD;AAEzF,iBAAS;IACL,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,0GAA0G;IAChH,OAAO,EAAE;QACL,QAAQ,EAAE;YACN,OAAO,EAAI,mBAAQ,CAAC,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AW,EAAC,KAAK,CAAC,CAAC,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;SAChC;IACL,CAAC;CACJ,CAAC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
- * @desc
3
- * Default configuration to be used when invoking the serenity-bdd command line interface.
4
- * See the source code to find out more about the values being used.
2
+ * Default configuration to be used when invoking the serenity-bdd command line interface.
3
+ * See the source code to find out more about the values being used.
5
4
  *
6
5
  * @typedef {Object} defaults
7
6
  * @property {string} artifact The GAV identifier of the artifact to download from the artifact repository
@@ -20,7 +19,6 @@ export declare const defaults: {
20
19
  cacheDir: string;
21
20
  sourceDir: string;
22
21
  reportDir: string;
23
- featuresDir: string;
24
22
  log: string;
25
23
  };
26
24
  //# sourceMappingURL=defaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/cli/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ;;;;;;;;CAQpB,CAAC"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/cli/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC"}
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaults = void 0;
4
4
  /**
5
- * @desc
6
- * Default configuration to be used when invoking the serenity-bdd command line interface.
7
- * See the source code to find out more about the values being used.
5
+ * Default configuration to be used when invoking the serenity-bdd command line interface.
6
+ * See the source code to find out more about the values being used.
8
7
  *
9
8
  * @typedef {Object} defaults
10
9
  * @property {string} artifact The GAV identifier of the artifact to download from the artifact repository
@@ -18,12 +17,11 @@ exports.defaults = void 0;
18
17
  * @public
19
18
  */
20
19
  exports.defaults = {
21
- artifact: 'net.serenity-bdd:serenity-cli:jar:3.1.0',
20
+ artifact: 'net.serenity-bdd:serenity-cli:jar:4.0.43',
22
21
  repository: 'https://repo1.maven.org/maven2/',
23
22
  cacheDir: 'node_modules/@serenity-js/serenity-bdd/cache',
24
23
  sourceDir: 'target/site/serenity',
25
24
  reportDir: 'target/site/serenity',
26
- featuresDir: 'features',
27
25
  log: 'warn',
28
26
  };
29
27
  //# sourceMappingURL=defaults.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/cli/defaults.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACU,QAAA,QAAQ,GAAG;IACpB,QAAQ,EAAK,yCAAyC;IACtD,UAAU,EAAG,iCAAiC;IAC9C,QAAQ,EAAK,8CAA8C;IAC3D,SAAS,EAAI,sBAAsB;IACnC,SAAS,EAAI,sBAAsB;IACnC,WAAW,EAAE,UAAU;IACvB,GAAG,EAAU,MAAM;CACtB,CAAC"}
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/cli/defaults.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACU,QAAA,QAAQ,GAAG;IACpB,QAAQ,EAAK,0CAA0C;IACvD,UAAU,EAAG,iCAAiC;IAC9C,QAAQ,EAAK,8CAA8C;IAC3D,SAAS,EAAI,sBAAsB;IACnC,SAAS,EAAI,sBAAsB;IACnC,GAAG,EAAU,MAAM;CACtB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import type { StageCrewMember } from '@serenity-js/core';
1
+ import type { StageCrewMemberBuilder } from '@serenity-js/core';
2
+ import type { SerenityBDDReporterConfig } from './stage';
3
+ import { SerenityBDDReporter } from './stage';
2
4
  export * from './stage';
3
- export default function create(): StageCrewMember;
5
+ export default function create(config?: SerenityBDDReporterConfig): StageCrewMemberBuilder<SerenityBDDReporter>;
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,cAAc,SAAS,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,MAAM,IAAI,eAAe,CAEhD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,cAAc,SAAS,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAM,GAAE,yBAA8B,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAElH"}
package/lib/index.js CHANGED
@@ -16,8 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const stage_1 = require("./stage");
18
18
  __exportStar(require("./stage"), exports);
19
- function create() {
20
- return new stage_1.SerenityBDDReporter();
19
+ function create(config = {}) {
20
+ return stage_1.SerenityBDDReporter.fromJSON(config);
21
21
  }
22
22
  exports.default = create;
23
23
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,mCAA8C;AAE9C,0CAAwB;AAExB,SAAwB,MAAM;IAC1B,OAAO,IAAI,2BAAmB,EAAE,CAAC;AACrC,CAAC;AAFD,yBAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,mCAA8C;AAE9C,0CAAwB;AAExB,SAAwB,MAAM,CAAC,SAAoC,EAAE;IACjE,OAAO,2BAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAFD,yBAEC"}
@@ -1,5 +1,7 @@
1
- import type { Stage, StageCrewMember } from '@serenity-js/core';
1
+ import type { Stage, StageCrewMember, StageCrewMemberBuilder } from '@serenity-js/core';
2
2
  import type { DomainEvent } from '@serenity-js/core/lib/events';
3
+ import { Path } from '@serenity-js/core/lib/io';
4
+ import type { SerenityBDDReporterConfig } from './SerenityBDDReporterConfig';
3
5
  /**
4
6
  * A {@apilink StageCrewMember} that produces [Serenity BDD](http://serenity-bdd.info/)-standard JSON reports
5
7
  * to be parsed by [Serenity BDD CLI Reporter](https://github.com/serenity-bdd/serenity-cli)
@@ -13,8 +15,12 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
13
15
  *
14
16
  * configure({
15
17
  * crew: [
16
- * ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
17
- * new SerenityBDDReporter()
18
+ * ArtifactArchiver.fromJSON({
19
+ * outputDirectory: './target/site/serenity'
20
+ * }),
21
+ * SerenityBDDReporter.fromJSON({
22
+ * specDirectory: './features' // optional configuration
23
+ * })
18
24
  * ],
19
25
  * })
20
26
  * ```
@@ -45,8 +51,6 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
45
51
  *
46
52
  * ```ts
47
53
  * // wdio.conf.ts
48
- * import { ArtifactArchiver } from '@serenity-js/core';
49
- * import { SerenityBDDReporter } from '@serenity-js/serenity-bdd';
50
54
  * import { WebdriverIOConfig } from '@serenity-js/webdriverio';
51
55
  *
52
56
  * export const config: WebdriverIOConfig = {
@@ -68,10 +72,6 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
68
72
  *
69
73
  * ```js
70
74
  * // protractor.conf.js
71
- * const
72
- * { ArtifactArchiver } = require('@serenity-js/core'),
73
- * { SerenityBDDReporter } = require('@serenity-js/serenity-bdd')
74
- *
75
75
  * exports.config = {
76
76
  * framework: 'custom',
77
77
  * frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
@@ -88,16 +88,40 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
88
88
  * }
89
89
  * ```
90
90
  *
91
+ * ## Configuring Serenity BDD Reporter
92
+ *
93
+ * To override Serenity BDD Reporter default configuration, provide a {@link SerenityBDDReporterConfig} as the second element of the {@link SerenityConfig.crew} array
94
+ * using your test runner-specific configuration mechanism.
95
+ *
96
+ * For example, to change the default location
97
+ * of the [requirements hierarchy root directory](https://serenity-bdd.github.io/docs/reporting/living_documentation#the-requirements-hierarchy),
98
+ * specify the `specDirectory` property:
99
+ *
100
+ * ```js
101
+ * crew: [
102
+ * [ '@serenity-js/serenity-bdd', { specDirectory: './features' } ],
103
+ * // ...
104
+ * ],
105
+ * ```
106
+ *
107
+ * ### Learn more:
108
+ * - [Serenity BDD Reporter integration documentation](/handbook/reporting/serenity-bdd-reporter/)
109
+ * - [Serenity/JS examples on GitHub](https://github.com/serenity-js/serenity-js/tree/main/examples)
110
+ *
91
111
  * @group Stage
92
112
  */
93
113
  export declare class SerenityBDDReporter implements StageCrewMember {
114
+ private readonly specDirectory;
94
115
  private stage?;
95
116
  private readonly eventQueues;
96
117
  private readonly processors;
118
+ static fromJSON(config: SerenityBDDReporterConfig): StageCrewMemberBuilder<SerenityBDDReporter>;
97
119
  /**
98
- * @param [stage=undefined] stage
120
+ * @param {Path} specDirectory
121
+ * @param {Stage} [stage]
122
+ * The stage this {@apilink StageCrewMember} should be assigned to
99
123
  */
100
- constructor(stage?: Stage);
124
+ constructor(specDirectory: Path, stage?: Stage);
101
125
  /**
102
126
  * @inheritDoc
103
127
  */
@@ -1 +1 @@
1
- {"version":3,"file":"SerenityBDDReporter.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAM/D;;;;;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