@serenity-js/playwright-test 3.0.0-rc.41 → 3.0.0-rc.43
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 +25 -0
- package/README.md +9 -14
- package/lib/api/SerenityFixtures.d.ts +5 -3
- package/lib/api/SerenityFixtures.d.ts.map +1 -1
- package/lib/api/SerenityOptions.d.ts +10 -8
- package/lib/api/SerenityOptions.d.ts.map +1 -1
- package/lib/api/test-api.js +1 -1
- package/lib/api/test-api.js.map +1 -1
- package/lib/reporter/SerenityReporterForPlaywrightTest.d.ts.map +1 -1
- package/lib/reporter/SerenityReporterForPlaywrightTest.js +15 -4
- package/lib/reporter/SerenityReporterForPlaywrightTest.js.map +1 -1
- package/package.json +8 -8
- package/src/api/SerenityFixtures.ts +5 -3
- package/src/api/SerenityOptions.ts +10 -8
- package/src/api/test-api.ts +2 -2
- package/src/reporter/SerenityReporterForPlaywrightTest.ts +18 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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.0.0-rc.43](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.42...v3.0.0-rc.43) (2023-03-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update dependency deepmerge to ^4.3.0 ([ac08d09](https://github.com/serenity-js/serenity-js/commit/ac08d091eb61a666c9b9c53209b59fe7157c06d9))
|
|
12
|
+
* **deps:** update playwright dependencies to ^1.31.2 ([ebac2ff](https://github.com/serenity-js/serenity-js/commit/ebac2ff37b7a922686daed0201d122f52b1d1040))
|
|
13
|
+
* **playwright-test:** ensure each new actor gets their own Playwright browser ([f4c527b](https://github.com/serenity-js/serenity-js/commit/f4c527b27446e32c31a230de3a4d29575ecc8c34)), closes [#1523](https://github.com/serenity-js/serenity-js/issues/1523)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# [3.0.0-rc.42](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.41...v3.0.0-rc.42) (2023-02-12)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **core:** event TestRunFinished now incidates the Outcome of the test suite ([a941056](https://github.com/serenity-js/serenity-js/commit/a9410566891e543101b935a80db9c7daea0c9944)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
|
|
25
|
+
* **playwright-test:** default to using file name as feature name when describe blocks are absent ([1295b04](https://github.com/serenity-js/serenity-js/commit/1295b04adcd12a9d7eaef795e1080bb1c5a9056d)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
# [3.0.0-rc.41](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.40...v3.0.0-rc.41) (2023-02-07)
|
|
7
32
|
|
|
8
33
|
|
package/README.md
CHANGED
|
@@ -2,23 +2,22 @@ _** This README is for Serenity/JS version 3.0-RC. Some links might not work yet
|
|
|
2
2
|
|
|
3
3
|
# Serenity/JS
|
|
4
4
|
|
|
5
|
+
[](https://www.linkedin.com/company/serenity-js)
|
|
6
|
+
[](https://www.youtube.com/@serenity-js)
|
|
7
|
+
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
8
|
+
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
9
|
+
|
|
5
10
|
[Serenity/JS](https://serenity-js.org) is a framework designed to make acceptance and regression testing
|
|
6
11
|
of modern full-stack applications faster, more collaborative and easier to scale.
|
|
7
12
|
|
|
8
13
|
Visit [serenity-js.org](https://serenity-js.org/) for the [latest tutorials](https://serenity-js.org/handbook/)
|
|
9
14
|
and [API docs](https://serenity-js.org/modules/), and follow [@SerenityJS](https://twitter.com/SerenityJS) and [@JanMolak](https://twitter.com/JanMolak) on Twitter for project updates.
|
|
10
15
|
|
|
11
|
-
[](https://twitter.com/@SerenityJS)
|
|
12
|
-
[](https://twitter.com/@JanMolak)
|
|
13
|
-
[](https://gitter.im/serenity-js/Lobby)
|
|
14
|
-
|
|
15
|
-
Subscribe to [Serenity/JS YouTube channel](https://www.youtube.com/channel/UC0RdeVPyjtJopVHvlLrXd1Q) to get notified when new demos and video tutorials are available.
|
|
16
|
-
|
|
17
16
|
### Learning Serenity/JS
|
|
18
17
|
|
|
19
18
|
To learn more about Serenity/JS, [follow the tutorial](https://serenity-js.org/handbook/thinking-in-serenity-js/index.html), [review the examples](https://github.com/serenity-js/serenity-js/tree/main/examples), and create your own test suite using the [Serenity/JS template projects](https://github.com/serenity-js).
|
|
20
19
|
|
|
21
|
-
If you have any questions, join us on [Serenity/JS Community Chat](https://
|
|
20
|
+
If you have any questions, join us on the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im).
|
|
22
21
|
|
|
23
22
|
## Serenity/JS Playwright Test
|
|
24
23
|
|
|
@@ -179,11 +178,11 @@ import { CallAnApi } from '@serenity-js/rest'
|
|
|
179
178
|
test.use({
|
|
180
179
|
actors: async ({ browser, baseURL }, use) => {
|
|
181
180
|
await use(
|
|
182
|
-
Cast.
|
|
181
|
+
Cast.where(actor => actor.whoCan(
|
|
183
182
|
BrowseTheWebWithPlaywright.using(browser),
|
|
184
183
|
TakeNotes.usingAnEmptyNotepad(),
|
|
185
184
|
CallAnApi.at(baseURL),
|
|
186
|
-
)
|
|
185
|
+
))
|
|
187
186
|
)
|
|
188
187
|
},
|
|
189
188
|
})
|
|
@@ -275,11 +274,7 @@ GitHub repository](https://github.com/serenity-js/serenity-js/tree/main/examples
|
|
|
275
274
|
|
|
276
275
|
## More coming soon!
|
|
277
276
|
|
|
278
|
-
New features, tutorials, and demos are coming soon, so follow us on
|
|
279
|
-
|
|
280
|
-
[](https://twitter.com/@SerenityJS)
|
|
281
|
-
[](https://twitter.com/@JanMolak)
|
|
282
|
-
[](https://gitter.im/serenity-js/Lobby)
|
|
277
|
+
New features, tutorials, and demos are coming soon, so follow us on [LinkedIn](https://www.linkedin.com/company/serenity-js) and join the [Serenity/JS Community Chat channel](https://matrix.to/#/#serenity-js:gitter.im) to stay up to date!
|
|
283
278
|
|
|
284
279
|
If you enjoy using Serenity/JS and would like to keep new features coming, become our [GitHub Sponsor](https://github.com/sponsors/serenity-js)
|
|
285
280
|
and donate as much or as little as you find appropriate.
|
|
@@ -71,9 +71,11 @@ export interface SerenityFixtures {
|
|
|
71
71
|
* test.use({
|
|
72
72
|
* defaultActorName: 'Serena',
|
|
73
73
|
* actors: ({ browser, contextOptions }, use) => {
|
|
74
|
-
* const cast = Cast.
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* const cast = Cast.where(actor =>
|
|
75
|
+
* actor.whoCan(
|
|
76
|
+
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
77
|
+
* TakeNotes.usingAnEmptyNotepad(),
|
|
78
|
+
* )
|
|
77
79
|
* )
|
|
78
80
|
*
|
|
79
81
|
* // Make sure to pass your custom cast to Playwright `use` callback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerenityFixtures.d.ts","sourceRoot":"","sources":["../../src/api/SerenityFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,gBAAgB;IAE7B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAE5C
|
|
1
|
+
{"version":3,"file":"SerenityFixtures.d.ts","sourceRoot":"","sources":["../../src/api/SerenityFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,gBAAgB;IAE7B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,MAAM,EAAE,IAAI,CAAC;IAEb;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC;IAErC;;;;;;;;;OASG;IACH,KAAK,EAAE,KAAK,CAAC;CAChB"}
|
|
@@ -45,10 +45,12 @@ import { PlaywrightOptions } from '@serenity-js/playwright';
|
|
|
45
45
|
* // Register a custom cast of Serenity/JS actors
|
|
46
46
|
* // if you don't want to use the default one
|
|
47
47
|
* actors: ({ browser, contextOptions, apiUrl }, use) => {
|
|
48
|
-
* const cast = Cast.
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
48
|
+
* const cast = Cast.where(actor =>
|
|
49
|
+
* actor.whoCan(
|
|
50
|
+
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
51
|
+
* TakeNotes.usingAnEmptyNotepad(),
|
|
52
|
+
* CallAnApi.at(apiUrl),
|
|
53
|
+
* )
|
|
52
54
|
* )
|
|
53
55
|
*
|
|
54
56
|
* use(cast)
|
|
@@ -119,11 +121,11 @@ export interface SerenityOptions {
|
|
|
119
121
|
* // as well as any other custom properties you define in the destructuring expression,
|
|
120
122
|
* // such as `apiUrl`.
|
|
121
123
|
* actors: ({ browser, contextOptions, apiUrl }, use) => {
|
|
122
|
-
* const cast = Cast.
|
|
124
|
+
* const cast = Cast.where(actor => actor.whoCan(
|
|
123
125
|
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
124
126
|
* TakeNotes.usingAnEmptyNotepad(),
|
|
125
127
|
* CallAnApi.at(apiUrl),
|
|
126
|
-
* )
|
|
128
|
+
* ))
|
|
127
129
|
*
|
|
128
130
|
* // Make sure to pass your custom cast to Playwright `use` callback
|
|
129
131
|
* use(cast)
|
|
@@ -234,10 +236,10 @@ export interface SerenityOptions {
|
|
|
234
236
|
* // Custom cast of actors receives `contextOptions` with the
|
|
235
237
|
* // additional Serenity/JS properties.
|
|
236
238
|
* actors: ({ browser, contextOptions }, use) => {
|
|
237
|
-
* const cast = Cast.
|
|
239
|
+
* const cast = Cast.where(actor => actor.whoCan(
|
|
238
240
|
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
239
241
|
* TakeNotes.usingAnEmptyNotepad(),
|
|
240
|
-
* )
|
|
242
|
+
* ))
|
|
241
243
|
*
|
|
242
244
|
* use(cast)
|
|
243
245
|
* },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerenityOptions.d.ts","sourceRoot":"","sources":["../../src/api/SerenityOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"SerenityOptions.d.ts","sourceRoot":"","sources":["../../src/api/SerenityOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,MAAM,WAAW,eAAe;IAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4DG;IACH,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,qBAAqB,GAAG,oBAAoB,CAAC,CAAA;IAEvE;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,IAAI,EAAE,KAAK,CAAC,gBAAgB,GAAG,eAAe,GAAG,sBAAsB,CAAC,CAAC;IAEzE;;;;;;;;OAQG;IACH,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC;IAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6DG;IACH,cAAc,EAAE,iBAAiB,CAAC;CACrC"}
|
package/lib/api/test-api.js
CHANGED
|
@@ -92,7 +92,7 @@ const reporter_1 = require("../reporter");
|
|
|
92
92
|
*/
|
|
93
93
|
exports.it = test_1.test.extend({
|
|
94
94
|
actors: [
|
|
95
|
-
({ browser, contextOptions }, use) => use(core_1.Cast.
|
|
95
|
+
({ browser, contextOptions }, use) => use(core_1.Cast.where(actor => actor.whoCan(playwright_1.BrowseTheWebWithPlaywright.using(browser, contextOptions), core_1.TakeNotes.usingAnEmptyNotepad()))),
|
|
96
96
|
{ option: true },
|
|
97
97
|
],
|
|
98
98
|
defaultActorName: [
|
package/lib/api/test-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-api.js","sourceRoot":"","sources":["../../src/api/test-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA0D;AAC1D,4CAA+G;AAC/G,yDAA0E;AAC1E,uDAAsE;AACtE,wDAAqF;AACrF,0CAAsE;AACtE,uCAAyB;AACzB,2CAAqE;AAErE,0CAA2H;AAK3H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACU,QAAA,EAAE,GAAqB,WAAI,CAAC,MAAM,CAAqD;IAEhG,MAAM,EAAE;QACJ,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,EAAE,CACjC,GAAG,CAAC,WAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"test-api.js","sourceRoot":"","sources":["../../src/api/test-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA0D;AAC1D,4CAA+G;AAC/G,yDAA0E;AAC1E,uDAAsE;AACtE,wDAAqF;AACrF,0CAAsE;AACtE,uCAAyB;AACzB,2CAAqE;AAErE,0CAA2H;AAK3H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACU,QAAA,EAAE,GAAqB,WAAI,CAAC,MAAM,CAAqD;IAEhG,MAAM,EAAE;QACJ,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,EAAE,CACjC,GAAG,CAAC,WAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAChC,uCAA0B,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,EACzD,gBAAS,CAAC,mBAAmB,EAAE,CAClC,CAAC,CAAC;QACP,EAAE,MAAM,EAAE,IAAI,EAAE;KACnB;IAED,gBAAgB,EAAE;QACd,QAAQ;QACR,EAAE,MAAM,EAAE,IAAI,EAAE;KACnB;IAED,UA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IAqBrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB5B,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,qBAAqB;IA8B7B,OAAO,CAAC,GAAG;IAIX,aAAa,IAAI,OAAO;CAG3B"}
|
|
@@ -112,13 +112,24 @@ class SerenityReporterForPlaywrightTest {
|
|
|
112
112
|
return new model_1.ExecutionSuccessful();
|
|
113
113
|
}
|
|
114
114
|
scenarioDetailsFrom(test) {
|
|
115
|
-
const [root_, browserName_,
|
|
116
|
-
|
|
115
|
+
const [root_, browserName_, fileName, describeOrItBlockTitle, ...nestedTitles] = test.titlePath();
|
|
116
|
+
const path = new io_1.Path(test.location.file);
|
|
117
|
+
const scenarioName = nestedTitles.join(' ').trim();
|
|
118
|
+
const featureName = scenarioName
|
|
119
|
+
? describeOrItBlockTitle
|
|
120
|
+
: fileName;
|
|
121
|
+
return new model_1.ScenarioDetails(new model_1.Name(scenarioName || describeOrItBlockTitle), new model_1.Category(featureName), new io_1.FileSystemLocation(path, test.location.line, test.location.column));
|
|
117
122
|
}
|
|
118
123
|
async onEnd() {
|
|
119
124
|
this.serenity.announce(new events_1.TestRunFinishes(this.serenity.currentTime()));
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
try {
|
|
126
|
+
await this.serenity.waitForNextCue();
|
|
127
|
+
this.serenity.announce(new events_1.TestRunFinished(new model_1.ExecutionSuccessful(), this.serenity.currentTime()));
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
this.serenity.announce(new events_1.TestRunFinished(new model_1.ExecutionFailedWithError(error), this.serenity.currentTime()));
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
122
133
|
}
|
|
123
134
|
// TODO emit a text artifact with stdout?
|
|
124
135
|
// reporter.onStdErr(chunk, test, result)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerenityReporterForPlaywrightTest.js","sourceRoot":"","sources":["../../src/reporter/SerenityReporterForPlaywrightTest.ts"],"names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B;QAEjC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,IAAI,qBAAqB,CAAC,cAAc,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC7F,IAAI,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,qBAAqB,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAErF,iCAAiC;QACjC,qCAAqC;QAErC,MAAM,QAAQ,GAAG,UAAU,OAAO,EAAE,CAAC;QACrC,IAAI,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YAChD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACxC;QAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QAEpB,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,cAAc,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;;AA1Bc,2BAAK,GAAG,IAAI,MAAM,CAC7B,sJAAsJ,EAAE,uCAAuC;AAC/L,GAAG,CACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/playwright-test",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.43",
|
|
4
4
|
"description": "Serenity/JS reporter and test APIs for Playwright Test",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"npm": "^6 || ^7 || ^8"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@playwright/test": "^1.
|
|
48
|
-
"@serenity-js/core": "3.0.0-rc.
|
|
49
|
-
"@serenity-js/playwright": "3.0.0-rc.
|
|
50
|
-
"@serenity-js/web": "3.0.0-rc.
|
|
51
|
-
"deepmerge": "^4.
|
|
47
|
+
"@playwright/test": "^1.31.2",
|
|
48
|
+
"@serenity-js/core": "3.0.0-rc.43",
|
|
49
|
+
"@serenity-js/playwright": "3.0.0-rc.43",
|
|
50
|
+
"@serenity-js/web": "3.0.0-rc.43",
|
|
51
|
+
"deepmerge": "^4.3.0",
|
|
52
52
|
"tiny-types": "^1.19.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"mocha": "^10.2.0",
|
|
59
59
|
"nyc": "15.1.0",
|
|
60
60
|
"ts-node": "^10.9.1",
|
|
61
|
-
"typescript": "^4.9.
|
|
61
|
+
"typescript": "^4.9.5"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "683d2fc1fd69444369b666d4318da95f8a5951fc"
|
|
64
64
|
}
|
|
@@ -72,9 +72,11 @@ export interface SerenityFixtures {
|
|
|
72
72
|
* test.use({
|
|
73
73
|
* defaultActorName: 'Serena',
|
|
74
74
|
* actors: ({ browser, contextOptions }, use) => {
|
|
75
|
-
* const cast = Cast.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
75
|
+
* const cast = Cast.where(actor =>
|
|
76
|
+
* actor.whoCan(
|
|
77
|
+
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
78
|
+
* TakeNotes.usingAnEmptyNotepad(),
|
|
79
|
+
* )
|
|
78
80
|
* )
|
|
79
81
|
*
|
|
80
82
|
* // Make sure to pass your custom cast to Playwright `use` callback
|
|
@@ -46,10 +46,12 @@ import { PlaywrightOptions } from '@serenity-js/playwright';
|
|
|
46
46
|
* // Register a custom cast of Serenity/JS actors
|
|
47
47
|
* // if you don't want to use the default one
|
|
48
48
|
* actors: ({ browser, contextOptions, apiUrl }, use) => {
|
|
49
|
-
* const cast = Cast.
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
49
|
+
* const cast = Cast.where(actor =>
|
|
50
|
+
* actor.whoCan(
|
|
51
|
+
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
52
|
+
* TakeNotes.usingAnEmptyNotepad(),
|
|
53
|
+
* CallAnApi.at(apiUrl),
|
|
54
|
+
* )
|
|
53
55
|
* )
|
|
54
56
|
*
|
|
55
57
|
* use(cast)
|
|
@@ -121,11 +123,11 @@ export interface SerenityOptions {
|
|
|
121
123
|
* // as well as any other custom properties you define in the destructuring expression,
|
|
122
124
|
* // such as `apiUrl`.
|
|
123
125
|
* actors: ({ browser, contextOptions, apiUrl }, use) => {
|
|
124
|
-
* const cast = Cast.
|
|
126
|
+
* const cast = Cast.where(actor => actor.whoCan(
|
|
125
127
|
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
126
128
|
* TakeNotes.usingAnEmptyNotepad(),
|
|
127
129
|
* CallAnApi.at(apiUrl),
|
|
128
|
-
* )
|
|
130
|
+
* ))
|
|
129
131
|
*
|
|
130
132
|
* // Make sure to pass your custom cast to Playwright `use` callback
|
|
131
133
|
* use(cast)
|
|
@@ -240,10 +242,10 @@ export interface SerenityOptions {
|
|
|
240
242
|
* // Custom cast of actors receives `contextOptions` with the
|
|
241
243
|
* // additional Serenity/JS properties.
|
|
242
244
|
* actors: ({ browser, contextOptions }, use) => {
|
|
243
|
-
* const cast = Cast.
|
|
245
|
+
* const cast = Cast.where(actor => actor.whoCan(
|
|
244
246
|
* BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
245
247
|
* TakeNotes.usingAnEmptyNotepad(),
|
|
246
|
-
* )
|
|
248
|
+
* ))
|
|
247
249
|
*
|
|
248
250
|
* use(cast)
|
|
249
251
|
* },
|
package/src/api/test-api.ts
CHANGED
|
@@ -73,10 +73,10 @@ export const it: SerenityTestType = base.extend<Omit<SerenityOptions, 'actors'>
|
|
|
73
73
|
|
|
74
74
|
actors: [
|
|
75
75
|
({ browser, contextOptions }, use) =>
|
|
76
|
-
use(Cast.
|
|
76
|
+
use(Cast.where(actor => actor.whoCan(
|
|
77
77
|
BrowseTheWebWithPlaywright.using(browser, contextOptions),
|
|
78
78
|
TakeNotes.usingAnEmptyNotepad(),
|
|
79
|
-
)),
|
|
79
|
+
))),
|
|
80
80
|
{ option: true },
|
|
81
81
|
],
|
|
82
82
|
|
|
@@ -191,13 +191,20 @@ export class SerenityReporterForPlaywrightTest implements Reporter {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
private scenarioDetailsFrom(test: TestCase) {
|
|
194
|
-
const [ root_, browserName_,
|
|
194
|
+
const [ root_, browserName_, fileName, describeOrItBlockTitle, ...nestedTitles] = test.titlePath();
|
|
195
|
+
|
|
196
|
+
const path = new Path(test.location.file);
|
|
197
|
+
const scenarioName = nestedTitles.join(' ').trim();
|
|
198
|
+
|
|
199
|
+
const featureName = scenarioName
|
|
200
|
+
? describeOrItBlockTitle
|
|
201
|
+
: fileName;
|
|
195
202
|
|
|
196
203
|
return new ScenarioDetails(
|
|
197
|
-
new Name(
|
|
204
|
+
new Name(scenarioName || describeOrItBlockTitle),
|
|
198
205
|
new Category(featureName),
|
|
199
206
|
new FileSystemLocation(
|
|
200
|
-
|
|
207
|
+
path,
|
|
201
208
|
test.location.line,
|
|
202
209
|
test.location.column,
|
|
203
210
|
),
|
|
@@ -207,9 +214,14 @@ export class SerenityReporterForPlaywrightTest implements Reporter {
|
|
|
207
214
|
async onEnd(): Promise<void> {
|
|
208
215
|
this.serenity.announce(new TestRunFinishes(this.serenity.currentTime()));
|
|
209
216
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
217
|
+
try {
|
|
218
|
+
await this.serenity.waitForNextCue();
|
|
219
|
+
this.serenity.announce(new TestRunFinished(new ExecutionSuccessful(), this.serenity.currentTime()));
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
this.serenity.announce(new TestRunFinished(new ExecutionFailedWithError(error), this.serenity.currentTime()));
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
213
225
|
}
|
|
214
226
|
|
|
215
227
|
// TODO emit a text artifact with stdout?
|