@serenity-js/playwright-test 3.4.2 → 3.6.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.
- package/CHANGELOG.md +28 -0
- package/README.md +68 -3
- package/lib/api/DescribeFunction.d.ts +235 -0
- package/lib/api/DescribeFunction.d.ts.map +1 -0
- package/lib/api/DescribeFunction.js +3 -0
- package/lib/api/DescribeFunction.js.map +1 -0
- package/lib/api/PerformActivitiesAsPlaywrightSteps.d.ts +3 -2
- package/lib/api/PerformActivitiesAsPlaywrightSteps.d.ts.map +1 -1
- package/lib/api/PerformActivitiesAsPlaywrightSteps.js.map +1 -1
- package/lib/api/PlaywrightTestConfig.d.ts +1 -1
- package/lib/api/PlaywrightTestConfig.d.ts.map +1 -1
- package/lib/api/SerenityFixtures.d.ts +1 -1
- package/lib/api/SerenityFixtures.d.ts.map +1 -1
- package/lib/api/SerenityOptions.d.ts +4 -4
- package/lib/api/SerenityOptions.d.ts.map +1 -1
- package/lib/api/SuiteFunction.d.ts +51 -0
- package/lib/api/SuiteFunction.d.ts.map +1 -0
- package/lib/api/SuiteFunction.js +3 -0
- package/lib/api/SuiteFunction.js.map +1 -0
- package/lib/api/index.d.ts +2 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +2 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/test-api.d.ts +245 -70
- package/lib/api/test-api.d.ts.map +1 -1
- package/lib/api/test-api.js +268 -105
- package/lib/api/test-api.js.map +1 -1
- package/lib/reporter/DomainEventBuffer.d.ts +2 -2
- package/lib/reporter/DomainEventBuffer.d.ts.map +1 -1
- package/lib/reporter/PlaywrightStepReporter.d.ts +3 -3
- package/lib/reporter/PlaywrightStepReporter.d.ts.map +1 -1
- package/lib/reporter/PlaywrightStepReporter.js.map +1 -1
- package/lib/reporter/SerenityReporterForPlaywrightTest.d.ts +2 -2
- package/lib/reporter/SerenityReporterForPlaywrightTest.d.ts.map +1 -1
- package/lib/reporter/SerenityReporterForPlaywrightTest.js.map +1 -1
- package/package.json +7 -7
- package/src/api/DescribeFunction.ts +233 -0
- package/src/api/PerformActivitiesAsPlaywrightSteps.ts +3 -2
- package/src/api/PlaywrightTestConfig.ts +1 -1
- package/src/api/SerenityFixtures.ts +1 -1
- package/src/api/SerenityOptions.ts +4 -4
- package/src/api/SuiteFunction.ts +52 -0
- package/src/api/index.ts +2 -1
- package/src/api/test-api.ts +343 -126
- package/src/reporter/DomainEventBuffer.ts +2 -2
- package/src/reporter/PlaywrightStepReporter.ts +4 -4
- package/src/reporter/SerenityReporterForPlaywrightTest.ts +11 -7
- package/lib/api/SerenityTestType.d.ts +0 -5
- package/lib/api/SerenityTestType.d.ts.map +0 -1
- package/lib/api/SerenityTestType.js +0 -4
- package/lib/api/SerenityTestType.js.map +0 -1
- package/src/api/SerenityTestType.ts +0 -12
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.6.0](https://github.com/serenity-js/serenity-js/compare/v3.5.0...v3.6.0) (2023-07-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update dependency tiny-types to ^1.20.0 ([6d7bf43](https://github.com/serenity-js/serenity-js/commit/6d7bf43c6135968bc90869cb8f9782ed70ca8dd9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **playwright-test:** enable BrowseTheWebWithPlaywright to reuse an existing page instance ([5c2deb1](https://github.com/serenity-js/serenity-js/commit/5c2deb1853f27884fcdaccccc0b1b108c0a8489b)), closes [#1784](https://github.com/serenity-js/serenity-js/issues/1784)
|
|
17
|
+
* **playwright-test:** introducing Component Testing with Serenity/JS and Playwright Test ([7b3c6c8](https://github.com/serenity-js/serenity-js/commit/7b3c6c83d5caa48b4362dee0f30a154f00cb46e2)), closes [#1784](https://github.com/serenity-js/serenity-js/issues/1784)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# [3.5.0](https://github.com/serenity-js/serenity-js/compare/v3.4.2...v3.5.0) (2023-07-02)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **core:** code clean-up: use type-only TypeScript imports where possible ([aa49150](https://github.com/serenity-js/serenity-js/commit/aa49150ca7f367363bb6fcc5e054da8bd820825e))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [3.4.2](https://github.com/serenity-js/serenity-js/compare/v3.4.1...v3.4.2) (2023-06-30)
|
|
7
35
|
|
|
8
36
|
|
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ describe('Serenity Screenplay with Playwright', () => {
|
|
|
82
82
|
|
|
83
83
|
### Serenity/JS Screenplay Pattern Actors
|
|
84
84
|
|
|
85
|
-
Serenity/JS test fixtures simplify how you instantiate and use Serenity/JS Screenplay Pattern Actors.
|
|
85
|
+
Serenity/JS test fixtures simplify how you instantiate and use [Serenity/JS Screenplay Pattern Actors](https://serenity-js.org/api/core/class/Actor/).
|
|
86
86
|
|
|
87
87
|
#### Single-actor scenarios
|
|
88
88
|
|
|
@@ -123,7 +123,7 @@ describe('Serenity Screenplay with Playwright', () => {
|
|
|
123
123
|
For multi-actor scenarios where you need each actor to use a separate browser, use the `actorCalled` fixture.
|
|
124
124
|
You can also use this pattern to override the default actor name on a per-scenario basis:
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
```typescript
|
|
127
127
|
// example.spec.ts
|
|
128
128
|
|
|
129
129
|
import { describe, it, test } from '@serenity-js/playwright-test' // import fixtures
|
|
@@ -155,7 +155,7 @@ describe('Serenity Screenplay with Playwright', () => {
|
|
|
155
155
|
})
|
|
156
156
|
})
|
|
157
157
|
})
|
|
158
|
-
|
|
158
|
+
```
|
|
159
159
|
|
|
160
160
|
#### Customising Actors
|
|
161
161
|
|
|
@@ -225,6 +225,71 @@ test.use({
|
|
|
225
225
|
})
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
+
### UI Component Testing
|
|
229
|
+
|
|
230
|
+
You can use Serenity/JS and Playwright Test to write UI component tests and **reuse your test code** between component and end-to-end test suites.
|
|
231
|
+
|
|
232
|
+
To get started with component testing:
|
|
233
|
+
- Follow the [Playwright Test Component Testing tutorial](https://playwright.dev/docs/test-components) to configure your component test suite,
|
|
234
|
+
- Use Serenity/JS test fixtures instead of the default ones.
|
|
235
|
+
|
|
236
|
+
```diff
|
|
237
|
+
// src/App.spec.tsx
|
|
238
|
+
- import { test, expect } from '@playwright/experimental-ct-react'
|
|
239
|
+
+ import { test as componentTest } from '@playwright/experimental-ct-react'
|
|
240
|
+
+ import { useBase } from '@serenity-js/playwright-test'
|
|
241
|
+
|
|
242
|
+
+ const { test, expect } = useBase(componentTest)
|
|
243
|
+
|
|
244
|
+
import App from './App';
|
|
245
|
+
|
|
246
|
+
test.use({ viewport: { width: 500, height: 500 } });
|
|
247
|
+
|
|
248
|
+
test('should work', async ({ mount }) => {
|
|
249
|
+
const component = await mount(<App />);
|
|
250
|
+
await expect(component).toContainText('Learn React');
|
|
251
|
+
});
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### Using Serenity/JS Screenplay Pattern Actors for Component Testing
|
|
255
|
+
|
|
256
|
+
Serenity/JS [`useBase(test)`](https://serenity-js.org/api/playwright-test/function/useBase/) creates
|
|
257
|
+
a test API that gives you access to all the [`SerenityFixtures`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/)
|
|
258
|
+
you could access in any other regular end-to-end test.
|
|
259
|
+
|
|
260
|
+
This capability allows you to use [Serenity/JS Actors](https://serenity-js.org/api/core/class/Actor/) and design
|
|
261
|
+
and experiment with your [Screenplay Pattern Tasks](https://serenity-js.org/api/core/class/Task/)
|
|
262
|
+
before incorporating them in your high-level acceptance and end-to-end tests.
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
import { test as componentTest } from '@playwright/experimental-ct-react'
|
|
266
|
+
import { Ensure, contain } from '@serenity-js/assertions'
|
|
267
|
+
import { useBase } from '@serenity-js/playwright-test'
|
|
268
|
+
import { Enter, PageElement, CssClasses } from '@serenity-js/web'
|
|
269
|
+
|
|
270
|
+
import EmailInput from './EmailInput';
|
|
271
|
+
|
|
272
|
+
const { it, describe } = useBase(componentTest).useFixtures<{ emailAddress: string }>({
|
|
273
|
+
emailAddress: ({ actor }, use) => {
|
|
274
|
+
use(`${ actor.name }@example.org`)
|
|
275
|
+
}
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
describe('EmailInput', () => {
|
|
279
|
+
|
|
280
|
+
it('allows valid email addresses', async ({ actor, mount, emailAddress }) => {
|
|
281
|
+
const nativeComponent = await mount(<EmailInput/>);
|
|
282
|
+
|
|
283
|
+
const component = PageElement.from(nativeComponent);
|
|
284
|
+
|
|
285
|
+
await actor.attemptsTo(
|
|
286
|
+
Enter.theValue(emailAddress).into(component),
|
|
287
|
+
Ensure.that(CssClasses.of(component), contain('valid')),
|
|
288
|
+
)
|
|
289
|
+
})
|
|
290
|
+
})
|
|
291
|
+
```
|
|
292
|
+
|
|
228
293
|
### Serenity Reports
|
|
229
294
|
|
|
230
295
|
To use Serenity/JS reporting capabilities, register the `@serenity-js/playwright-test` reporter in your
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import type { SuiteFunction } from './SuiteFunction';
|
|
2
|
+
export type DescribeFunction = SuiteFunction & {
|
|
3
|
+
/**
|
|
4
|
+
* Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
|
|
5
|
+
* else.
|
|
6
|
+
*
|
|
7
|
+
* **Usage**
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* test.describe.only('focused group', () => {
|
|
11
|
+
* test('in the focused group', async ({ page }) => {
|
|
12
|
+
* // This test will run
|
|
13
|
+
* });
|
|
14
|
+
* });
|
|
15
|
+
* test('not in the focused group', async ({ page }) => {
|
|
16
|
+
* // This test will not run
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param title Group title.
|
|
21
|
+
* @param callback A callback that is run immediately when calling
|
|
22
|
+
* [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests
|
|
23
|
+
* added in this callback will belong to the group.
|
|
24
|
+
*/
|
|
25
|
+
only: SuiteFunction;
|
|
26
|
+
/**
|
|
27
|
+
* Declares a skipped test group, similarly to
|
|
28
|
+
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in the skipped
|
|
29
|
+
* group are never run.
|
|
30
|
+
*
|
|
31
|
+
* **Usage**
|
|
32
|
+
*
|
|
33
|
+
* ```js
|
|
34
|
+
* test.describe.skip('skipped group', () => {
|
|
35
|
+
* test('example', async ({ page }) => {
|
|
36
|
+
* // This test will not run
|
|
37
|
+
* });
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param title Group title.
|
|
42
|
+
* @param callback A callback that is run immediately when calling
|
|
43
|
+
* [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests
|
|
44
|
+
* added in this callback will belong to the group, and will not be run.
|
|
45
|
+
*/
|
|
46
|
+
skip: SuiteFunction;
|
|
47
|
+
/**
|
|
48
|
+
* Declares a test group similarly to
|
|
49
|
+
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in this group
|
|
50
|
+
* are marked as "fixme" and will not be executed.
|
|
51
|
+
*
|
|
52
|
+
* **Usage**
|
|
53
|
+
*
|
|
54
|
+
* ```js
|
|
55
|
+
* test.describe.fixme('broken tests', () => {
|
|
56
|
+
* test('example', async ({ page }) => {
|
|
57
|
+
* // This test will not run
|
|
58
|
+
* });
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param title Group title.
|
|
63
|
+
* @param callback A callback that is run immediately when calling
|
|
64
|
+
* [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests
|
|
65
|
+
* added in this callback will belong to the group, and will not be run.
|
|
66
|
+
*/
|
|
67
|
+
fixme: SuiteFunction;
|
|
68
|
+
/**
|
|
69
|
+
* **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
|
|
70
|
+
* the preferred way of configuring the execution mode.
|
|
71
|
+
*
|
|
72
|
+
* Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
|
|
73
|
+
* skipped. All tests in a group are retried together.
|
|
74
|
+
*
|
|
75
|
+
* **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
|
|
76
|
+
* independently.
|
|
77
|
+
*
|
|
78
|
+
* **Usage**
|
|
79
|
+
*
|
|
80
|
+
* ```js
|
|
81
|
+
* test.describe.serial('group', () => {
|
|
82
|
+
* test('runs first', async ({ page }) => {});
|
|
83
|
+
* test('runs second', async ({ page }) => {});
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @param title Group title.
|
|
88
|
+
* @param callback A callback that is run immediately when calling
|
|
89
|
+
* [test.describe.serial(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial). Any tests
|
|
90
|
+
* added in this callback will belong to the group.
|
|
91
|
+
*/
|
|
92
|
+
serial: SuiteFunction & {
|
|
93
|
+
/**
|
|
94
|
+
* **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
|
|
95
|
+
* the preferred way of configuring the execution mode.
|
|
96
|
+
*
|
|
97
|
+
* Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
|
|
98
|
+
* tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
|
|
99
|
+
* them will be run but nothing else.
|
|
100
|
+
*
|
|
101
|
+
* **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
|
|
102
|
+
* independently.
|
|
103
|
+
*
|
|
104
|
+
* **Usage**
|
|
105
|
+
*
|
|
106
|
+
* ```js
|
|
107
|
+
* test.describe.serial.only('group', () => {
|
|
108
|
+
* test('runs first', async ({ page }) => {
|
|
109
|
+
* });
|
|
110
|
+
* test('runs second', async ({ page }) => {
|
|
111
|
+
* });
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param title Group title.
|
|
116
|
+
* @param callback A callback that is run immediately when calling
|
|
117
|
+
* [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
|
|
118
|
+
* Any tests added in this callback will belong to the group.
|
|
119
|
+
*/
|
|
120
|
+
only: SuiteFunction;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
|
|
124
|
+
* the preferred way of configuring the execution mode.
|
|
125
|
+
*
|
|
126
|
+
* Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
|
|
127
|
+
* another, but using
|
|
128
|
+
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel) allows
|
|
129
|
+
* them to run in parallel.
|
|
130
|
+
*
|
|
131
|
+
* **Usage**
|
|
132
|
+
*
|
|
133
|
+
* ```js
|
|
134
|
+
* test.describe.parallel('group', () => {
|
|
135
|
+
* test('runs in parallel 1', async ({ page }) => {});
|
|
136
|
+
* test('runs in parallel 2', async ({ page }) => {});
|
|
137
|
+
* });
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
|
|
141
|
+
* the parallel tests executes all relevant hooks.
|
|
142
|
+
* @param title Group title.
|
|
143
|
+
* @param callback A callback that is run immediately when calling
|
|
144
|
+
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any
|
|
145
|
+
* tests added in this callback will belong to the group.
|
|
146
|
+
*/
|
|
147
|
+
parallel: SuiteFunction & {
|
|
148
|
+
/**
|
|
149
|
+
* **NOTE** See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
|
|
150
|
+
* the preferred way of configuring the execution mode.
|
|
151
|
+
*
|
|
152
|
+
* Declares a focused group of tests that could be run in parallel. This is similar to
|
|
153
|
+
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel), but
|
|
154
|
+
* focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
|
|
155
|
+
*
|
|
156
|
+
* **Usage**
|
|
157
|
+
*
|
|
158
|
+
* ```js
|
|
159
|
+
* test.describe.parallel.only('group', () => {
|
|
160
|
+
* test('runs in parallel 1', async ({ page }) => {});
|
|
161
|
+
* test('runs in parallel 2', async ({ page }) => {});
|
|
162
|
+
* });
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @param title Group title.
|
|
166
|
+
* @param callback A callback that is run immediately when calling
|
|
167
|
+
* [test.describe.parallel.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
|
|
168
|
+
* Any tests added in this callback will belong to the group.
|
|
169
|
+
*/
|
|
170
|
+
only: SuiteFunction;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Configures the enclosing scope. Can be executed either on the top level or inside a describe. Configuration applies
|
|
174
|
+
* to the entire scope, regardless of whether it run before or after the test declaration.
|
|
175
|
+
*
|
|
176
|
+
* Learn more about the execution modes [here](https://playwright.dev/docs/test-parallel).
|
|
177
|
+
*
|
|
178
|
+
* **Usage**
|
|
179
|
+
* - Running tests in parallel.
|
|
180
|
+
*
|
|
181
|
+
* ```js
|
|
182
|
+
* // Run all the tests in the file concurrently using parallel workers.
|
|
183
|
+
* test.describe.configure({ mode: 'parallel' });
|
|
184
|
+
* test('runs in parallel 1', async ({ page }) => {});
|
|
185
|
+
* test('runs in parallel 2', async ({ page }) => {});
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* - Running tests serially, retrying from the start.
|
|
189
|
+
*
|
|
190
|
+
* **NOTE** Running serially is not recommended. It is usually better to make your tests isolated, so they can be
|
|
191
|
+
* run independently.
|
|
192
|
+
*
|
|
193
|
+
* ```js
|
|
194
|
+
* // Annotate tests as inter-dependent.
|
|
195
|
+
* test.describe.configure({ mode: 'serial' });
|
|
196
|
+
* test('runs first', async ({ page }) => {});
|
|
197
|
+
* test('runs second', async ({ page }) => {});
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* - Configuring retries and timeout for each test.
|
|
201
|
+
*
|
|
202
|
+
* ```js
|
|
203
|
+
* // Each test in the file will be retried twice and have a timeout of 20 seconds.
|
|
204
|
+
* test.describe.configure({ retries: 2, timeout: 20_000 });
|
|
205
|
+
* test('runs first', async ({ page }) => {});
|
|
206
|
+
* test('runs second', async ({ page }) => {});
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* - Run multiple describes in parallel, but tests inside each describe in order.
|
|
210
|
+
*
|
|
211
|
+
* ```js
|
|
212
|
+
* test.describe.configure({ mode: 'parallel' });
|
|
213
|
+
*
|
|
214
|
+
* test.describe('A, runs in parallel with B', () => {
|
|
215
|
+
* test.describe.configure({ mode: 'default' });
|
|
216
|
+
* test('in order A1', async ({ page }) => {});
|
|
217
|
+
* test('in order A2', async ({ page }) => {});
|
|
218
|
+
* });
|
|
219
|
+
*
|
|
220
|
+
* test.describe('B, runs in parallel with A', () => {
|
|
221
|
+
* test.describe.configure({ mode: 'default' });
|
|
222
|
+
* test('in order B1', async ({ page }) => {});
|
|
223
|
+
* test('in order B2', async ({ page }) => {});
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @param options
|
|
228
|
+
*/
|
|
229
|
+
configure: (options: {
|
|
230
|
+
mode?: 'default' | 'parallel' | 'serial';
|
|
231
|
+
retries?: number;
|
|
232
|
+
timeout?: number;
|
|
233
|
+
}) => void;
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=DescribeFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescribeFunction.d.ts","sourceRoot":"","sources":["../../src/api/DescribeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC3C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,EAAE,aAAa,GAAG;QACpB;;;;;;;;;;;;;;;;;;;;;;;;;;WA0BG;QACH,IAAI,EAAE,aAAa,CAAC;KACvB,CAAC;IACF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,QAAQ,EAAE,aAAa,GAAG;QACtB;;;;;;;;;;;;;;;;;;;;;WAqBG;QACH,IAAI,EAAE,aAAa,CAAC;KACvB,CAAC;IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClH,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescribeFunction.js","sourceRoot":"","sources":["../../src/api/DescribeFunction.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { test as base } from '@playwright/test';
|
|
2
|
-
import { Activity,
|
|
3
|
-
import {
|
|
2
|
+
import type { Activity, PerformsActivities } from '@serenity-js/core';
|
|
3
|
+
import { PerformActivities } from '@serenity-js/core';
|
|
4
|
+
import type { EmitsDomainEvents } from '@serenity-js/core/lib/events';
|
|
4
5
|
export declare class PerformActivitiesAsPlaywrightSteps extends PerformActivities {
|
|
5
6
|
private readonly test;
|
|
6
7
|
constructor(actor: PerformsActivities & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerformActivitiesAsPlaywrightSteps.d.ts","sourceRoot":"","sources":["../../src/api/PerformActivitiesAsPlaywrightSteps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"PerformActivitiesAsPlaywrightSteps.d.ts","sourceRoot":"","sources":["../../src/api/PerformActivitiesAsPlaywrightSteps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAkB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,qBAAa,kCAAmC,SAAQ,iBAAiB;IAKjE,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFrB,KAAK,EAAE,kBAAkB,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAC5C,KAAK,EAAE,iBAAiB,EACP,IAAI,EAAE,OAAO,IAAI;IAKvB,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBzD,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,UAAU;CAQrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerformActivitiesAsPlaywrightSteps.js","sourceRoot":"","sources":["../../src/api/PerformActivitiesAsPlaywrightSteps.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"PerformActivitiesAsPlaywrightSteps.js","sourceRoot":"","sources":["../../src/api/PerformActivitiesAsPlaywrightSteps.ts"],"names":[],"mappings":";;;AAEA,4CAAsE;AAEtE,oDAA6D;AAE7D,MAAa,kCAAmC,SAAQ,wBAAiB;IAErE,YACI,KAA4C,EAC5C,KAAwB,EACP,IAAiB;QAElC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAFH,SAAI,GAAJ,IAAI,CAAa;IAGtC,CAAC;IAEQ,KAAK,CAAC,OAAO,CAAC,QAAkB;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAElC,2DAA2D;QAC3D,MAAM,SAAS,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAoG,CAAC;QAE7J,OAAO,SAAS,CAAC;YACb,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC5B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YACnC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;SACtC,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YACb,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACN,CAAC;IAEO,YAAY,CAAC,QAAkB;QACnC,IAAI,QAAQ,YAAY,kBAAW,EAAE;YACjC,OAAO,IAAA,6BAAmB,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;gBACvD,GAAG,CAAC,KAAK,CAAC,GAAG,IAAA,QAAC,EAAA,GAAI,QAAQ,CAAC,KAAK,CAAE,EAAE,CAAC;gBACrC,OAAO,GAAG,CAAC;YACf,CAAC,EAAE,EAAE,CAAC,CAAC;SACV;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAEO,UAAU,CAAC,QAAkB;QACjC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,qBAAqB,EAAE,CAAC;QAC/D,OAAO;YACH,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK;YACtC,IAAI,EAAE,qBAAqB,CAAC,IAAI;YAChC,MAAM,EAAE,qBAAqB,CAAC,MAAM;SACvC,CAAC;IACN,CAAC;CACJ;AA5CD,gFA4CC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PlaywrightTestConfig as BasePlaywrightTestConfig } from '@playwright/test';
|
|
2
|
-
import { SerenityOptions } from './SerenityOptions';
|
|
2
|
+
import type { SerenityOptions } from './SerenityOptions';
|
|
3
3
|
/**
|
|
4
4
|
* Convenience alias for [PlaywrightTestConfig](https://playwright.dev/docs/test-configuration) object
|
|
5
5
|
* that includes {@apilink SerenityOptions} and allows for any other custom options when needed.
|
|
@@ -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,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
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,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,MAAM,oBAAoB,CAAC,QAAQ,GAAG,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,wBAAwB,CAAC,eAAe,GAAG,QAAQ,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Actor, Cast, Serenity } from '@serenity-js/core';
|
|
1
|
+
import type { Actor, Cast, Serenity } from '@serenity-js/core';
|
|
2
2
|
/**
|
|
3
3
|
* Serenity/JS-specific [Playwright Test fixtures](https://playwright.dev/docs/test-fixtures)
|
|
4
4
|
* injected into your {@apilink it|test scenarios}.
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"SerenityFixtures.d.ts","sourceRoot":"","sources":["../../src/api/SerenityFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PlaywrightTestOptions, PlaywrightWorkerArgs, TestFixture } from '@playwright/test';
|
|
2
|
-
import { Cast, ClassDescription, Duration, StageCrewMember, StageCrewMemberBuilder } from '@serenity-js/core';
|
|
3
|
-
import { PlaywrightOptions } from '@serenity-js/playwright';
|
|
1
|
+
import type { PlaywrightTestOptions, PlaywrightWorkerArgs, TestFixture } from '@playwright/test';
|
|
2
|
+
import type { Cast, ClassDescription, Duration, StageCrewMember, StageCrewMemberBuilder } from '@serenity-js/core';
|
|
3
|
+
import type { PlaywrightOptions } from '@serenity-js/playwright';
|
|
4
4
|
/**
|
|
5
5
|
* Configuration object accepted by `@serenity-js/playwright-test`.
|
|
6
6
|
*
|
|
@@ -43,7 +43,7 @@ import { PlaywrightOptions } from '@serenity-js/playwright';
|
|
|
43
43
|
* ],
|
|
44
44
|
*
|
|
45
45
|
* // Register a custom cast of Serenity/JS actors
|
|
46
|
-
* // if you don't want to use the default
|
|
46
|
+
* // if you don't want to use the default ones
|
|
47
47
|
* actors: ({ browser, contextOptions, apiUrl }, use) => {
|
|
48
48
|
* const cast = Cast.where(actor =>
|
|
49
49
|
* actor.whoCan(
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"SerenityOptions.d.ts","sourceRoot":"","sources":["../../src/api/SerenityOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6DG;IACH,cAAc,EAAE,iBAAiB,CAAC;CACrC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface SuiteFunction {
|
|
2
|
+
/**
|
|
3
|
+
* Declares a group of tests.
|
|
4
|
+
*
|
|
5
|
+
* **Usage**
|
|
6
|
+
*
|
|
7
|
+
* ```js
|
|
8
|
+
* test.describe('two tests', () => {
|
|
9
|
+
* test('one', async ({ page }) => {
|
|
10
|
+
* // ...
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
* test('two', async ({ page }) => {
|
|
14
|
+
* // ...
|
|
15
|
+
* });
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param title Group title.
|
|
20
|
+
* @param callback A callback that is run immediately when calling
|
|
21
|
+
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
|
|
22
|
+
* this callback will belong to the group.
|
|
23
|
+
*/
|
|
24
|
+
(title: string, callback: () => void): void;
|
|
25
|
+
/**
|
|
26
|
+
* Declares an anonymous group of tests. This is convenient to give a group of tests a common option with
|
|
27
|
+
* [test.use(options)](https://playwright.dev/docs/api/class-test#test-use).
|
|
28
|
+
*
|
|
29
|
+
* **Usage**
|
|
30
|
+
*
|
|
31
|
+
* ```js
|
|
32
|
+
* test.describe(() => {
|
|
33
|
+
* test.use({ colorScheme: 'dark' });
|
|
34
|
+
*
|
|
35
|
+
* test('one', async ({ page }) => {
|
|
36
|
+
* // ...
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* test('two', async ({ page }) => {
|
|
40
|
+
* // ...
|
|
41
|
+
* });
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param callback A callback that is run immediately when calling
|
|
46
|
+
* [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this
|
|
47
|
+
* callback will belong to the group.
|
|
48
|
+
*/
|
|
49
|
+
(callback: () => void): void;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=SuiteFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiteFunction.d.ts","sourceRoot":"","sources":["../../src/api/SuiteFunction.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC5C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiteFunction.js","sourceRoot":"","sources":["../../src/api/SuiteFunction.ts"],"names":[],"mappings":""}
|
package/lib/api/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export * from './DescribeFunction';
|
|
1
2
|
export * from './PlaywrightTestConfig';
|
|
2
3
|
export * from './SerenityFixtures';
|
|
3
4
|
export * from './SerenityOptions';
|
|
4
|
-
export * from './
|
|
5
|
+
export * from './SuiteFunction';
|
|
5
6
|
export * from './test-api';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|
package/lib/api/index.js
CHANGED
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DescribeFunction"), exports);
|
|
17
18
|
__exportStar(require("./PlaywrightTestConfig"), exports);
|
|
18
19
|
__exportStar(require("./SerenityFixtures"), exports);
|
|
19
20
|
__exportStar(require("./SerenityOptions"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./SuiteFunction"), exports);
|
|
21
22
|
__exportStar(require("./test-api"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/lib/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,qDAAmC;AACnC,oDAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,yDAAuC;AACvC,qDAAmC;AACnC,oDAAkC;AAClC,kDAAgC;AAChC,6CAA2B"}
|