@serenity-js/playwright 3.36.2 → 3.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +90 -90
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.37.1](https://github.com/serenity-js/serenity-js/compare/v3.37.0...v3.37.1) (2025-12-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/playwright
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.37.0](https://github.com/serenity-js/serenity-js/compare/v3.36.2...v3.37.0) (2025-12-02)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @serenity-js/playwright
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.36.2](https://github.com/serenity-js/serenity-js/compare/v3.36.1...v3.36.2) (2025-11-26)
|
|
7
23
|
|
|
8
24
|
|
package/README.md
CHANGED
|
@@ -1,88 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
## Serenity/JS Playwright
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/%40serenity-js%2Fplaywright)
|
|
4
|
+
[](https://github.com/serenity-js/serenity-js/actions)
|
|
5
|
+
[](https://qlty.sh/gh/serenity-js/projects/serenity-js)
|
|
6
|
+
[](https://qlty.sh/gh/serenity-js/projects/serenity-js)
|
|
7
|
+
[](https://github.com/serenity-js/serenity-js/graphs/contributors)
|
|
8
|
+
[](https://snyk.io/test/npm/@serenity-js/playwright)
|
|
9
|
+
[](https://github.com/serenity-js/serenity-js)
|
|
2
10
|
|
|
3
11
|
[](https://www.linkedin.com/company/serenity-js)
|
|
4
12
|
[](https://www.youtube.com/@serenity-js)
|
|
5
13
|
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
6
14
|
[](https://github.com/sponsors/serenity-js)
|
|
7
15
|
|
|
8
|
-
[
|
|
9
|
-
of complex software systems faster, more collaborative and easier to scale.
|
|
10
|
-
|
|
11
|
-
⭐️ Get started with Serenity/JS!
|
|
12
|
-
- [Serenity/JS web testing tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario)
|
|
13
|
-
- [Serenity/JS + Playwright Test deep dive](https://serenity-js.org/handbook/test-runners/playwright-test/)
|
|
14
|
-
- [Serenity/JS Handbook](https://serenity-js.org/handbook)
|
|
15
|
-
- [API documentation](https://serenity-js.org/api/)
|
|
16
|
-
- [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/)
|
|
17
|
-
|
|
18
|
-
👋 Join the Serenity/JS Community!
|
|
19
|
-
- Meet other Serenity/JS developers and maintainers on the [Serenity/JS Community chat channel](https://matrix.to/#/#serenity-js:gitter.im),
|
|
20
|
-
- Find answers to your Serenity/JS questions on the [Serenity/JS Forum](https://github.com/orgs/serenity-js/discussions/categories/how-do-i),
|
|
21
|
-
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/community/contributing/),
|
|
22
|
-
- Support the project and gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks) by becoming a [Serenity/JS GitHub Sponsor](https://github.com/sponsors/serenity-js)!
|
|
23
|
-
|
|
24
|
-
## Serenity/JS Playwright
|
|
16
|
+
[`@serenity-js/playwright`](https://serenity-js.org/api/playwright/) brings full [Serenity reporting](https://serenity-js.org/handbook/reporting/) capabilities to [Playwright](https://playwright.dev/) and enables writing tests using the [Screenplay Pattern](https://serenity-js.org/handbook/design/screenplay-pattern/).
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
for [Playwright](https://playwright.dev/), that helps with testing web-based apps.
|
|
18
|
+
## Features
|
|
28
19
|
|
|
29
|
-
|
|
20
|
+
- Integrates Serenity/JS with Playwright providing standardised [Screenplay Web API](https://serenity-js.org/api/web/)
|
|
21
|
+
- Supports all [Serenity/JS reporting features](https://serenity-js.org/handbook/reporting/) and expands native Playwright Test reports
|
|
22
|
+
- TypeScript-first design with strong typing for safer and more predictable test code.
|
|
30
23
|
|
|
31
|
-
|
|
24
|
+
## Installation
|
|
32
25
|
|
|
33
26
|
```bash
|
|
34
27
|
npm install --save-dev @serenity-js/assertions @serenity-js/console-reporter @serenity-js/core @serenity-js/serenity-bdd @serenity-js/web @serenity-js/playwright
|
|
35
28
|
```
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
See the [Serenity/JS Installation Guide](https://serenity-js.org/handbook/installation/).
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
### Usage with Playwright Test
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { describe, it } from '@serenity-js/playwright-test'
|
|
38
|
+
import { Navigate, Page } from '@serenity-js/web'
|
|
39
|
+
import { Ensure, startsWith } from '@serenity-js/assertions'
|
|
40
|
+
|
|
41
|
+
describe('Website', () => {
|
|
42
|
+
|
|
43
|
+
it('should have a title', async ({ actor }) => {
|
|
44
|
+
|
|
45
|
+
await actor.attemptsTo(
|
|
46
|
+
Navigate.to('https://serenity-js.org/'),
|
|
47
|
+
Ensure.that(Page.current().title(), startsWith('Serenity/JS')),
|
|
48
|
+
)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
```
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
Explore the in-depth Serenity/JS and Playwright Test integration guide in the [Serenity/JS Handbook](https://serenity-js.org/handbook/test-runners/playwright-test/).
|
|
54
|
+
|
|
55
|
+
### Usage with Cucumber
|
|
42
56
|
|
|
43
57
|
Follow the [Serenity/JS configuration guide for Cucumber](https://serenity-js.org/handbook/test-runners/cucumber/)
|
|
44
|
-
and
|
|
58
|
+
and the [Serenity/JS Cucumber and Playwright Project Template](https://github.com/serenity-js/serenity-js-cucumber-playwright-template).
|
|
45
59
|
|
|
46
60
|
### Usage with Mocha
|
|
47
61
|
|
|
48
62
|
```typescript
|
|
49
|
-
import { Ensure,
|
|
50
|
-
import { actorCalled,
|
|
51
|
-
import { BrowseTheWebWithPlaywright
|
|
52
|
-
import {
|
|
63
|
+
import { Ensure, startsWith } from '@serenity-js/assertions'
|
|
64
|
+
import { actorCalled, Cast, configure, Duration } from '@serenity-js/core'
|
|
65
|
+
import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright'
|
|
66
|
+
import { Navigate, Page } from '@serenity-js/web'
|
|
53
67
|
|
|
54
68
|
import { describe, it, beforeAll, afterAll } from 'mocha'
|
|
55
69
|
import * as playwright from 'playwright'
|
|
56
70
|
|
|
57
|
-
|
|
58
|
-
class SerenityJSWebsite {
|
|
59
|
-
static header = () =>
|
|
60
|
-
PageElement.located(By.css('h1')) // selector to identify the interactable element
|
|
61
|
-
.describedAs('header') // description to be used in reports
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// example Actors class, confgures Serenity/JS actors to use Playwright
|
|
65
|
-
class Actors implements Cast {
|
|
66
|
-
constructor(
|
|
67
|
-
private readonly browser: playwright.Browser,
|
|
68
|
-
private readonly contextOptions: playwright.BrowserContextOptions,
|
|
69
|
-
private readonly extraContextOptions: ExtraBrowserContextOptions,
|
|
70
|
-
) {
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
prepare(actor: Actor): Actor {
|
|
74
|
-
return actor.whoCan(
|
|
75
|
-
BrowseTheWebWithPlaywright.using(
|
|
76
|
-
this.browser,
|
|
77
|
-
this.contextOptions,
|
|
78
|
-
this.extraContextOptions
|
|
79
|
-
),
|
|
80
|
-
// ... add other abilities as needed, like CallAnApi or TakeNotes
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
describe('Serenity/JS', () => {
|
|
71
|
+
describe('Website', () => {
|
|
86
72
|
|
|
87
73
|
let browser: playwright.Browser
|
|
88
74
|
|
|
@@ -97,11 +83,16 @@ describe('Serenity/JS', () => {
|
|
|
97
83
|
// Configure Serenity/JS providing your Actors
|
|
98
84
|
// and required "stage crew memebers" (a.k.a. reporting services)
|
|
99
85
|
configure({
|
|
100
|
-
actors:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
86
|
+
actors: Cast.where(actor => actor.whoCan(
|
|
87
|
+
BrowseTheWebWithPlaywright.using(
|
|
88
|
+
browser,
|
|
89
|
+
{ baseURL: `https://serenity-js.org` },
|
|
90
|
+
{
|
|
91
|
+
defaultNavigationTimeout: Duration.ofSeconds(2).inMilliseconds(),
|
|
92
|
+
defaultTimeout: Duration.ofMilliseconds(750).inMilliseconds(),
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
)),
|
|
105
96
|
crew: [
|
|
106
97
|
[ '@serenity-js/console-reporter', { theme: 'auto' } ],
|
|
107
98
|
[ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
|
|
@@ -114,17 +105,12 @@ describe('Serenity/JS', () => {
|
|
|
114
105
|
})
|
|
115
106
|
})
|
|
116
107
|
|
|
117
|
-
it('
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
.
|
|
122
|
-
|
|
123
|
-
Ensure.that(
|
|
124
|
-
Text.of(SerenityJSWebsite.header()),
|
|
125
|
-
equals('Next generation acceptance testing')
|
|
126
|
-
),
|
|
127
|
-
)
|
|
108
|
+
it('should have a title', async () => {
|
|
109
|
+
|
|
110
|
+
await actorCalled('William').attemptsTo(
|
|
111
|
+
Navigate.to('https://serenity-js.org'),
|
|
112
|
+
Ensure.that(Page.current().title(), startsWith('Serenity/JS')),
|
|
113
|
+
)
|
|
128
114
|
})
|
|
129
115
|
|
|
130
116
|
afterAll(async () => {
|
|
@@ -136,25 +122,39 @@ describe('Serenity/JS', () => {
|
|
|
136
122
|
})
|
|
137
123
|
```
|
|
138
124
|
|
|
139
|
-
|
|
140
|
-
- Add [`@serenity-js/mocha`](https://serenity-js.org/api/mocha/) adapter to produce the reports
|
|
141
|
-
- Learn about the [Screenplay Pattern](https://serenity-js.org/handbook/design/screenplay-pattern.html)
|
|
142
|
-
- Explore [`@serenity-js/web`](https://serenity-js.org/api/web) and [`@serenity-js/assertions`](https://serenity-js.org/api/assertions) APIs
|
|
125
|
+
## Documentation
|
|
143
126
|
|
|
144
|
-
|
|
127
|
+
- [API Reference](https://serenity-js.org/api/)
|
|
128
|
+
- [Screenplay Pattern Guide](https://serenity-js.org/handbook/design/screenplay-pattern/)
|
|
129
|
+
- [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/)
|
|
130
|
+
- [More examples and reference implementations](https://github.com/serenity-js/serenity-js/tree/main/examples)
|
|
131
|
+
- [Tutorial: First Web Scenario](https://serenity-js.org/handbook/tutorials/your-first-web-scenario/)
|
|
132
|
+
- [Tutorial: First API Scenario](https://serenity-js.org/handbook/tutorials/your-first-api-scenario/)
|
|
145
133
|
|
|
146
|
-
|
|
147
|
-
Follow [Serenity/JS on LinkedIn](https://www.linkedin.com/company/serenity-js),
|
|
148
|
-
subscribe to [Serenity/JS channel on YouTube](https://www.youtube.com/@serenity-js) and join the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im) to stay up to date!
|
|
149
|
-
Please also make sure to star ⭐️ [Serenity/JS on GitHub](https://github.com/serenity-js/serenity-js) to help others discover the framework!
|
|
134
|
+
## Contributing
|
|
150
135
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
136
|
+
Contributions of all kinds are welcome! Get started with the [Contributing Guide](https://serenity-js.org/community/contributing/).
|
|
137
|
+
|
|
138
|
+
## Community
|
|
139
|
+
|
|
140
|
+
- [Community Chat](https://matrix.to/#/#serenity-js:gitter.im)
|
|
141
|
+
- [Discussions Forum](https://github.com/orgs/serenity-js/discussions)
|
|
142
|
+
- Visit the [💡How to... ?](https://github.com/orgs/serenity-js/discussions/categories/how-to) section for answers to common questions
|
|
143
|
+
|
|
144
|
+
If you enjoy using Serenity/JS, make sure to star ⭐️ [Serenity/JS on GitHub](https://github.com/serenity-js/serenity-js) to help others discover the framework!
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
The Serenity/JS code base is licensed under the [Apache-2.0](https://opensource.org/license/apache-2-0) license,
|
|
149
|
+
while its documentation and the [Serenity/JS Handbook](https://serenity-js.org/handbook/) are licensed under the [Creative Commons BY-NC-SA 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/).
|
|
150
|
+
|
|
151
|
+
See the [Serenity/JS License](https://serenity-js.org/legal/license/).
|
|
152
|
+
|
|
153
|
+
## Support
|
|
155
154
|
|
|
156
|
-
|
|
155
|
+
Support ongoing development through [GitHub Sponsors](https://github.com/sponsors/serenity-js). Sponsors gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks)
|
|
156
|
+
and priority help in the [Discussions Forum](https://github.com/orgs/serenity-js/discussions).
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
For corporate sponsorship or commercial support, please contact [Jan Molak](https://www.linkedin.com/in/janmolak/).
|
|
159
159
|
|
|
160
160
|
[](https://github.com/sponsors/serenity-js)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/playwright",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.1",
|
|
4
4
|
"description": "Adapter that integrates @serenity-js/web with Playwright, enabling Serenity/JS reporting and using the Screenplay Pattern to write component and end-to-end test scenarios",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"node": "^20 || ^22 || ^24"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@serenity-js/core": "3.
|
|
61
|
-
"@serenity-js/web": "3.
|
|
60
|
+
"@serenity-js/core": "3.37.1",
|
|
61
|
+
"@serenity-js/web": "3.37.1",
|
|
62
62
|
"tiny-types": "1.24.3"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"ts-node": "10.9.2",
|
|
76
76
|
"typescript": "5.9.3"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "0af3eff400cdb5adc9d7b92e87b09820c93d77c9"
|
|
79
79
|
}
|