@serenity-js/playwright-test 3.32.0 → 3.32.2
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 +19 -0
- package/lib/api/PlaywrightTestConfig.d.ts +5 -4
- package/lib/api/PlaywrightTestConfig.d.ts.map +1 -1
- package/lib/api/serenity-fixtures.d.ts +25 -31
- package/lib/api/serenity-fixtures.d.ts.map +1 -1
- package/lib/reporter/SerenityReporterForPlaywrightTest.d.ts +4 -2
- package/lib/reporter/SerenityReporterForPlaywrightTest.d.ts.map +1 -1
- package/lib/reporter/SerenityReporterForPlaywrightTest.js.map +1 -1
- package/package.json +6 -6
- package/src/api/PlaywrightTestConfig.ts +5 -4
- package/src/api/serenity-fixtures.ts +25 -31
- package/src/reporter/SerenityReporterForPlaywrightTest.ts +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.32.2](https://github.com/serenity-js/serenity-js/compare/v3.32.1...v3.32.2) (2025-06-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/playwright-test
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.32.1](https://github.com/serenity-js/serenity-js/compare/v3.32.0...v3.32.1) (2025-06-20)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **playwright-test:** added SerenityFixtures and SerenityWorkerFixtures to API docs ([887a7cf](https://github.com/serenity-js/serenity-js/commit/887a7cfb2d5505cd566cc26defdf6d1aaa145e40))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [3.32.0](https://github.com/serenity-js/serenity-js/compare/v3.31.17...v3.32.0) (2025-06-20)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -2,7 +2,8 @@ import type { PlaywrightTestConfig as BasePlaywrightTestConfig } from '@playwrig
|
|
|
2
2
|
import type { SerenityFixtures, SerenityWorkerFixtures } from './serenity-fixtures';
|
|
3
3
|
/**
|
|
4
4
|
* Convenience alias for [PlaywrightTestConfig](https://playwright.dev/docs/test-configuration) object
|
|
5
|
-
* that includes [`
|
|
5
|
+
* that includes [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/) and
|
|
6
|
+
* [`SerenityWorkerFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/) and allows for any other custom options when needed.
|
|
6
7
|
*
|
|
7
8
|
* #### Example
|
|
8
9
|
* Configuring Playwright Test using the standard `PlaywrightTestConfig` from `@playwright/test`:
|
|
@@ -10,9 +11,9 @@ import type { SerenityFixtures, SerenityWorkerFixtures } from './serenity-fixtur
|
|
|
10
11
|
* ```typescript
|
|
11
12
|
* // playwright.config.ts
|
|
12
13
|
* import type { PlaywrightTestConfig } from '@playwright/test'
|
|
13
|
-
* import type {
|
|
14
|
+
* import type { SerenityFixtures, SerenityWorkerFixtures } from '@serenity-js/playwright-test'
|
|
14
15
|
*
|
|
15
|
-
* const config: PlaywrightTestConfig<
|
|
16
|
+
* const config: PlaywrightTestConfig<SerenityFixtures & MyCustomOptions, SerenityWorkerFixtures> = {
|
|
16
17
|
* // ...
|
|
17
18
|
* }
|
|
18
19
|
*
|
|
@@ -32,8 +33,8 @@ import type { SerenityFixtures, SerenityWorkerFixtures } from './serenity-fixtur
|
|
|
32
33
|
* ```
|
|
33
34
|
*
|
|
34
35
|
* #### Learn more
|
|
35
|
-
* - [`SerenityOptions`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/)
|
|
36
36
|
* - [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
37
|
+
* - [`SerenityWorkerFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/)
|
|
37
38
|
* - [`SerenityReporterForPlaywrightTestConfig`](https://serenity-js.org/api/playwright-test/interface/SerenityReporterForPlaywrightTestConfig/)
|
|
38
39
|
* - [Playwright Test configuration](https://playwright.dev/docs/test-configuration)
|
|
39
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightTestConfig.d.ts","sourceRoot":"","sources":["../../src/api/PlaywrightTestConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEpF
|
|
1
|
+
{"version":3,"file":"PlaywrightTestConfig.d.ts","sourceRoot":"","sources":["../../src/api/PlaywrightTestConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,oBAAoB,CAAC,QAAQ,GAAG,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,wBAAwB,CAAC,gBAAgB,GAAG,QAAQ,EAAE,sBAAsB,GAAG,UAAU,CAAC,CAAC"}
|
|
@@ -230,7 +230,7 @@ export interface SerenityFixtures {
|
|
|
230
230
|
/**
|
|
231
231
|
* A cast of Serenity/JS actors to be used instead of the default cast
|
|
232
232
|
* when instantiating [`actor`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actor)
|
|
233
|
-
* and invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/
|
|
233
|
+
* and invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/#actorCalled).
|
|
234
234
|
*
|
|
235
235
|
* :::info Did you know?
|
|
236
236
|
* When you use `@serenity-js/playwright-test` [test APIs](https://serenity-js.org/api/playwright-test/function/it/), Serenity/JS already provides a default cast of actors for you.
|
|
@@ -298,50 +298,45 @@ export interface SerenityFixtures {
|
|
|
298
298
|
/**
|
|
299
299
|
* Default [`actor`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actor) injected into a [test scenario](https://serenity-js.org/api/playwright-test/function/it/).
|
|
300
300
|
*
|
|
301
|
-
* Using `actor` fixture is equivalent to invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/
|
|
301
|
+
* Using `actor` fixture is equivalent to invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/#actorCalled)
|
|
302
|
+
* with [`defaultActorName`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#defaultActorName).
|
|
302
303
|
*
|
|
303
304
|
* #### Learn more
|
|
304
|
-
* - [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/
|
|
305
|
-
* - [`
|
|
305
|
+
* - [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/#actorCalled)
|
|
306
|
+
* - [`defaultActorName`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#defaultActorName)
|
|
306
307
|
* - Declaring a Serenity/JS [test scenario](https://serenity-js.org/api/playwright-test/function/it/)
|
|
307
308
|
*/
|
|
308
309
|
actor: Actor;
|
|
309
310
|
}
|
|
310
311
|
/**
|
|
311
|
-
* Serenity/JS-specific [Playwright Test fixtures](https://playwright.dev/docs/test-fixtures)
|
|
312
|
+
* Serenity/JS-specific worker-scope [Playwright Test fixtures](https://playwright.dev/docs/test-fixtures)
|
|
312
313
|
* injected into your [test scenarios](https://serenity-js.org/api/playwright-test/function/it/).
|
|
313
314
|
*
|
|
314
315
|
* ## Example test scenario
|
|
315
316
|
*
|
|
316
317
|
* ```typescript
|
|
317
318
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
318
|
-
* import { describe, it
|
|
319
|
-
* import {
|
|
320
|
-
*
|
|
321
|
-
* describe(`Recording items`, () => {
|
|
322
|
-
*
|
|
323
|
-
* test.use({
|
|
324
|
-
* defaultActorName: 'Serena',
|
|
325
|
-
* crew: [
|
|
326
|
-
* Photographer.whoWill(TakePhotosOfFailures),
|
|
327
|
-
* ],
|
|
328
|
-
* })
|
|
329
|
-
*
|
|
330
|
-
* describe(`Todo List App`, () => {
|
|
319
|
+
* import { beforeAll, describe, it } from '@serenity-js/playwright-test'
|
|
320
|
+
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
|
|
331
321
|
*
|
|
332
|
-
*
|
|
333
|
-
* await actor.attemptsTo(
|
|
334
|
-
* startWithAnEmptyList(),
|
|
322
|
+
* describe('GitHub', () => {
|
|
335
323
|
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
324
|
+
* beforeAll('Ensure system is ready to test', async ({ actorCalled }) => {
|
|
325
|
+
* await actorCalled('Stagehand')
|
|
326
|
+
* .whoCan(CallAnApi.at('https://www.githubstatus.com/api/v2/'))
|
|
327
|
+
* .attemptsTo(
|
|
328
|
+
* Send.a(GetRequest.to('status.json')),
|
|
329
|
+
* Ensure.that(
|
|
330
|
+
* LastResponse.status(),
|
|
331
|
+
* equals(200)
|
|
332
|
+
* ),
|
|
333
|
+
* Ensure.that(
|
|
334
|
+
* LastResponse.body().status.description,
|
|
335
|
+
* equals('All Systems Operational')
|
|
336
|
+
* ),
|
|
337
|
+
* );
|
|
338
|
+
* });
|
|
339
|
+
* });
|
|
345
340
|
* ```
|
|
346
341
|
*
|
|
347
342
|
* ## Learn more
|
|
@@ -367,7 +362,6 @@ export interface SerenityWorkerFixtures {
|
|
|
367
362
|
*
|
|
368
363
|
* #### Learn more
|
|
369
364
|
* - Declaring a Serenity/JS [test scenario](https://serenity-js.org/api/playwright-test/function/it/)
|
|
370
|
-
* - [`SerenityOptions.actors`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/#actors)
|
|
371
365
|
* - [`SerenityFixtures.actors`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actors)
|
|
372
366
|
*
|
|
373
367
|
* @param name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serenity-fixtures.d.ts","sourceRoot":"","sources":["../../src/api/serenity-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,sBAAsB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoGG;AACH,MAAM,WAAW,gBAAgB;IAE7B;;;;;;;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;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,GAAG,QAAQ,CAAC;IAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6DG;IACH,mBAAmB,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;GAiCG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAE5C;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC;CACxC"}
|
|
@@ -5,7 +5,9 @@ import type { OutputStream } from '@serenity-js/core/lib/adapter';
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration object accepted by `@serenity-js/playwright-test` reporter.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* For usage examples, see:
|
|
9
|
+
* - [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
10
|
+
* - [`SerenityWorkerFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
9
11
|
*/
|
|
10
12
|
export interface SerenityReporterForPlaywrightTestConfig {
|
|
11
13
|
/**
|
|
@@ -14,7 +16,7 @@ export interface SerenityReporterForPlaywrightTestConfig {
|
|
|
14
16
|
* Note that the `crew` can also be configured using [class descriptions](https://serenity-js.org/api/core/#ClassDescription).
|
|
15
17
|
*
|
|
16
18
|
* #### Learn more
|
|
17
|
-
* - [`
|
|
19
|
+
* - [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
18
20
|
* - [`SerenityConfig.crew`](https://serenity-js.org/api/core/class/SerenityConfig/#crew)
|
|
19
21
|
*/
|
|
20
22
|
crew?: Array<StageCrewMember | StageCrewMemberBuilder | ClassDescription>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerenityReporterForPlaywrightTest.d.ts","sourceRoot":"","sources":["../../src/reporter/SerenityReporterForPlaywrightTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,k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,CAA4B;IAE5D;;OAEG;gBACS,MAAM,EAAE,uCAAuC;IAW3D,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAO/C,OAAO,CAAC,kBAAkB;IAY1B,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAcrD,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAuBnD,OAAO,CAAC,yBAAyB;IAkBjC,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAMzB,KAAK,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA2ClD,aAAa,IAAI,OAAO;CAG3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerenityReporterForPlaywrightTest.js","sourceRoot":"","sources":["../../src/reporter/SerenityReporterForPlaywrightTest.ts"],"names":[],"mappings":";;;AAGA,4CAAyE;AAEzE,yDAA+F;AAC/F,uDAA6F;AAE7F,mEAAgE;AAChE,mEAAgE;AAChE,iFAA8E;
|
|
1
|
+
{"version":3,"file":"SerenityReporterForPlaywrightTest.js","sourceRoot":"","sources":["../../src/reporter/SerenityReporterForPlaywrightTest.ts"],"names":[],"mappings":";;;AAGA,4CAAyE;AAEzE,yDAA+F;AAC/F,uDAA6F;AAE7F,mEAAgE;AAChE,mEAAgE;AAChE,iFAA8E;AAkC9E;;;;GAIG;AACH,MAAa,iCAAiC;IACzB,WAAW,GAAG,IAAI,6CAAqB,EAAE,CAAC;IAE1C,cAAc,CAA+B;IAC7C,QAAQ,CAAW;IAC5B,cAAc,CAAS;IAEd,WAAW,GAA0B,IAAI,6CAAqB,EAAE,CAAC;IACjE,eAAe,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE5D;;OAEG;IACH,YAAY,MAA+C;QACvD,IAAI,CAAC,cAAc,GAAG,IAAI,2DAA4B,EAAE,CAAC;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wBAAe,CACf,IAAI,gCAAwB,CAAC,KAAK,CAAC,EACnC,OAAO,CACV,CACJ,CAAC;YAEF,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;IAED,wCAAwC;IACxC,yCAAyC;IACzC,yCAAyC;IAEzC,aAAa;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAtJD,8EAsJC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/playwright-test",
|
|
3
|
-
"version": "3.32.
|
|
3
|
+
"version": "3.32.2",
|
|
4
4
|
"description": "Serenity/JS test runner adapter for Playwright Test, combining Playwright's developer experience with the advanced reporting and automation capabilities of Serenity/JS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"node": "^18.12 || ^20 || ^22"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@serenity-js/core": "3.32.
|
|
63
|
-
"@serenity-js/playwright": "3.32.
|
|
64
|
-
"@serenity-js/rest": "3.32.
|
|
65
|
-
"@serenity-js/web": "3.32.
|
|
62
|
+
"@serenity-js/core": "3.32.2",
|
|
63
|
+
"@serenity-js/playwright": "3.32.2",
|
|
64
|
+
"@serenity-js/rest": "3.32.2",
|
|
65
|
+
"@serenity-js/web": "3.32.2",
|
|
66
66
|
"deepmerge": "4.3.1",
|
|
67
67
|
"tiny-types": "1.23.0"
|
|
68
68
|
},
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"ts-node": "10.9.2",
|
|
81
81
|
"typescript": "5.8.3"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "bbc73b54836964b5b0981484e761c209a3dd0682"
|
|
84
84
|
}
|
|
@@ -4,7 +4,8 @@ import type { SerenityFixtures, SerenityWorkerFixtures } from './serenity-fixtur
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Convenience alias for [PlaywrightTestConfig](https://playwright.dev/docs/test-configuration) object
|
|
7
|
-
* that includes [`
|
|
7
|
+
* that includes [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/) and
|
|
8
|
+
* [`SerenityWorkerFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/) and allows for any other custom options when needed.
|
|
8
9
|
*
|
|
9
10
|
* #### Example
|
|
10
11
|
* Configuring Playwright Test using the standard `PlaywrightTestConfig` from `@playwright/test`:
|
|
@@ -12,9 +13,9 @@ import type { SerenityFixtures, SerenityWorkerFixtures } from './serenity-fixtur
|
|
|
12
13
|
* ```typescript
|
|
13
14
|
* // playwright.config.ts
|
|
14
15
|
* import type { PlaywrightTestConfig } from '@playwright/test'
|
|
15
|
-
* import type {
|
|
16
|
+
* import type { SerenityFixtures, SerenityWorkerFixtures } from '@serenity-js/playwright-test'
|
|
16
17
|
*
|
|
17
|
-
* const config: PlaywrightTestConfig<
|
|
18
|
+
* const config: PlaywrightTestConfig<SerenityFixtures & MyCustomOptions, SerenityWorkerFixtures> = {
|
|
18
19
|
* // ...
|
|
19
20
|
* }
|
|
20
21
|
*
|
|
@@ -34,8 +35,8 @@ import type { SerenityFixtures, SerenityWorkerFixtures } from './serenity-fixtur
|
|
|
34
35
|
* ```
|
|
35
36
|
*
|
|
36
37
|
* #### Learn more
|
|
37
|
-
* - [`SerenityOptions`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/)
|
|
38
38
|
* - [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
39
|
+
* - [`SerenityWorkerFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/)
|
|
39
40
|
* - [`SerenityReporterForPlaywrightTestConfig`](https://serenity-js.org/api/playwright-test/interface/SerenityReporterForPlaywrightTestConfig/)
|
|
40
41
|
* - [Playwright Test configuration](https://playwright.dev/docs/test-configuration)
|
|
41
42
|
*/
|
|
@@ -244,7 +244,7 @@ export interface SerenityFixtures {
|
|
|
244
244
|
/**
|
|
245
245
|
* A cast of Serenity/JS actors to be used instead of the default cast
|
|
246
246
|
* when instantiating [`actor`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actor)
|
|
247
|
-
* and invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/
|
|
247
|
+
* and invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/#actorCalled).
|
|
248
248
|
*
|
|
249
249
|
* :::info Did you know?
|
|
250
250
|
* When you use `@serenity-js/playwright-test` [test APIs](https://serenity-js.org/api/playwright-test/function/it/), Serenity/JS already provides a default cast of actors for you.
|
|
@@ -313,51 +313,46 @@ export interface SerenityFixtures {
|
|
|
313
313
|
/**
|
|
314
314
|
* Default [`actor`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actor) injected into a [test scenario](https://serenity-js.org/api/playwright-test/function/it/).
|
|
315
315
|
*
|
|
316
|
-
* Using `actor` fixture is equivalent to invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/
|
|
316
|
+
* Using `actor` fixture is equivalent to invoking [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/#actorCalled)
|
|
317
|
+
* with [`defaultActorName`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#defaultActorName).
|
|
317
318
|
*
|
|
318
319
|
* #### Learn more
|
|
319
|
-
* - [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/
|
|
320
|
-
* - [`
|
|
320
|
+
* - [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityWorkerFixtures/#actorCalled)
|
|
321
|
+
* - [`defaultActorName`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#defaultActorName)
|
|
321
322
|
* - Declaring a Serenity/JS [test scenario](https://serenity-js.org/api/playwright-test/function/it/)
|
|
322
323
|
*/
|
|
323
324
|
actor: Actor;
|
|
324
325
|
}
|
|
325
326
|
|
|
326
327
|
/**
|
|
327
|
-
* Serenity/JS-specific [Playwright Test fixtures](https://playwright.dev/docs/test-fixtures)
|
|
328
|
+
* Serenity/JS-specific worker-scope [Playwright Test fixtures](https://playwright.dev/docs/test-fixtures)
|
|
328
329
|
* injected into your [test scenarios](https://serenity-js.org/api/playwright-test/function/it/).
|
|
329
330
|
*
|
|
330
331
|
* ## Example test scenario
|
|
331
332
|
*
|
|
332
333
|
* ```typescript
|
|
333
334
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
334
|
-
* import { describe, it
|
|
335
|
-
* import {
|
|
336
|
-
*
|
|
337
|
-
* describe(`Recording items`, () => {
|
|
338
|
-
*
|
|
339
|
-
* test.use({
|
|
340
|
-
* defaultActorName: 'Serena',
|
|
341
|
-
* crew: [
|
|
342
|
-
* Photographer.whoWill(TakePhotosOfFailures),
|
|
343
|
-
* ],
|
|
344
|
-
* })
|
|
345
|
-
*
|
|
346
|
-
* describe(`Todo List App`, () => {
|
|
335
|
+
* import { beforeAll, describe, it } from '@serenity-js/playwright-test'
|
|
336
|
+
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
|
|
347
337
|
*
|
|
348
|
-
*
|
|
349
|
-
* await actor.attemptsTo(
|
|
350
|
-
* startWithAnEmptyList(),
|
|
338
|
+
* describe('GitHub', () => {
|
|
351
339
|
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
340
|
+
* beforeAll('Ensure system is ready to test', async ({ actorCalled }) => {
|
|
341
|
+
* await actorCalled('Stagehand')
|
|
342
|
+
* .whoCan(CallAnApi.at('https://www.githubstatus.com/api/v2/'))
|
|
343
|
+
* .attemptsTo(
|
|
344
|
+
* Send.a(GetRequest.to('status.json')),
|
|
345
|
+
* Ensure.that(
|
|
346
|
+
* LastResponse.status(),
|
|
347
|
+
* equals(200)
|
|
348
|
+
* ),
|
|
349
|
+
* Ensure.that(
|
|
350
|
+
* LastResponse.body().status.description,
|
|
351
|
+
* equals('All Systems Operational')
|
|
352
|
+
* ),
|
|
353
|
+
* );
|
|
354
|
+
* });
|
|
355
|
+
* });
|
|
361
356
|
* ```
|
|
362
357
|
*
|
|
363
358
|
* ## Learn more
|
|
@@ -382,7 +377,6 @@ export interface SerenityWorkerFixtures {
|
|
|
382
377
|
*
|
|
383
378
|
* #### Learn more
|
|
384
379
|
* - Declaring a Serenity/JS [test scenario](https://serenity-js.org/api/playwright-test/function/it/)
|
|
385
|
-
* - [`SerenityOptions.actors`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/#actors)
|
|
386
380
|
* - [`SerenityFixtures.actors`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actors)
|
|
387
381
|
*
|
|
388
382
|
* @param name
|
|
@@ -15,7 +15,9 @@ type HookType = 'beforeAll' | 'afterAll' | 'beforeEach' | 'afterEach';
|
|
|
15
15
|
/**
|
|
16
16
|
* Configuration object accepted by `@serenity-js/playwright-test` reporter.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* For usage examples, see:
|
|
19
|
+
* - [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
20
|
+
* - [`SerenityWorkerFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
19
21
|
*/
|
|
20
22
|
export interface SerenityReporterForPlaywrightTestConfig {
|
|
21
23
|
/**
|
|
@@ -24,7 +26,7 @@ export interface SerenityReporterForPlaywrightTestConfig {
|
|
|
24
26
|
* Note that the `crew` can also be configured using [class descriptions](https://serenity-js.org/api/core/#ClassDescription).
|
|
25
27
|
*
|
|
26
28
|
* #### Learn more
|
|
27
|
-
* - [`
|
|
29
|
+
* - [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
28
30
|
* - [`SerenityConfig.crew`](https://serenity-js.org/api/core/class/SerenityConfig/#crew)
|
|
29
31
|
*/
|
|
30
32
|
crew?: Array<StageCrewMember | StageCrewMemberBuilder | ClassDescription>;
|