@serenity-js/playwright 3.36.1 → 3.37.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 (3) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +91 -91
  3. package/package.json +6 -6
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.37.0](https://github.com/serenity-js/serenity-js/compare/v3.36.2...v3.37.0) (2025-12-02)
7
+
8
+ **Note:** Version bump only for package @serenity-js/playwright
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.36.2](https://github.com/serenity-js/serenity-js/compare/v3.36.1...v3.36.2) (2025-11-26)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **deps:** update playwright dependencies to v1.57.0 ([800445e](https://github.com/serenity-js/serenity-js/commit/800445eca508112ab2dd9fd1f1101113c6091fe3))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [3.36.1](https://github.com/serenity-js/serenity-js/compare/v3.36.0...v3.36.1) (2025-11-16)
7
26
 
8
27
 
package/README.md CHANGED
@@ -1,88 +1,74 @@
1
- # Serenity/JS
1
+ ## Serenity/JS Playwright
2
+
3
+ [![NPM Version](https://badge.fury.io/js/%40serenity-js%2Fplaywright.svg)](https://badge.fury.io/js/%40serenity-js%2Fplaywright)
4
+ [![Build Status](https://github.com/serenity-js/serenity-js/actions/workflows/main.yaml/badge.svg?branch=main)](https://github.com/serenity-js/serenity-js/actions)
5
+ [![Maintainability](https://qlty.sh/gh/serenity-js/projects/serenity-js/maintainability.svg)](https://qlty.sh/gh/serenity-js/projects/serenity-js)
6
+ [![Code Coverage](https://qlty.sh/gh/serenity-js/projects/serenity-js/coverage.svg)](https://qlty.sh/gh/serenity-js/projects/serenity-js)
7
+ [![Contributors](https://img.shields.io/github/contributors/serenity-js/serenity-js.svg)](https://github.com/serenity-js/serenity-js/graphs/contributors)
8
+ [![Known Vulnerabilities](https://snyk.io/test/npm/@serenity-js/playwright/badge.svg)](https://snyk.io/test/npm/@serenity-js/playwright)
9
+ [![GitHub stars](https://img.shields.io/github/stars/serenity-js/serenity-js?style=flat)](https://github.com/serenity-js/serenity-js)
2
10
 
3
11
  [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
4
12
  [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
5
13
  [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
6
14
  [![Support Serenity/JS on GitHub](https://img.shields.io/badge/Support-@serenity--js-703EC8?logo=github)](https://github.com/sponsors/serenity-js)
7
15
 
8
- [Serenity/JS](https://serenity-js.org) is an innovative open-source framework designed to make acceptance and regression testing
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
- [`@serenity-js/playwright`](https://serenity-js.org/api/playwright/) module is a [Screenplay Pattern](https://serenity-js.org/handbook/design/screenplay-pattern/)-style adapter
27
- for [Playwright](https://playwright.dev/), that helps with testing web-based apps.
18
+ ## Features
28
19
 
29
- ### Installation
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
- To install this module, run the following command in your [Playwright project directory](https://playwright.dev/docs/intro):
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
- ## Usage with `@playwright/test`
30
+ See the [Serenity/JS Installation Guide](https://serenity-js.org/handbook/installation/).
31
+
32
+ ## Quick Start
38
33
 
39
- Follow the [Using Serenity/JS with Playwright Test guide](https://serenity-js.org/handbook/test-runners/playwright-test/)
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
- ## Usage with Cucumber
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 review the [Serenity/JS Cucumber and Playwright Project Template](https://github.com/serenity-js/serenity-js-cucumber-playwright-template).
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, equals } from '@serenity-js/assertions'
50
- import { actorCalled, Actor, Cast, configure, Duration } from '@serenity-js/core'
51
- import { BrowseTheWebWithPlaywright, ExtraBrowserContextOptions } from '@serenity-js/playwright'
52
- import { By, Navigate, PageElement, TakePhotosOfFailures, Text } from '@serenity-js/web'
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
- // example Lean Page Object describing a widget we interact with in the test
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: new Actors(browser, {
101
- baseURL: `https://serenity-js.org`,
102
- defaultNavigationTimeout: Duration.ofSeconds(2).inMilliseconds(),
103
- defaultTimeout: Duration.ofMilliseconds(750).inMilliseconds(),
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('supports Playwright', async () => {
118
- // actorCalled(name) instantiates or retrieves an existing actor identified by name
119
- // Actors class configures the actors to use Playwright
120
- await actorCalled('William')
121
- .attemptsTo(
122
- Navigate.to('https://serenity-js.org'),
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
- Next steps:
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
- ## 📣 Stay up to date
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
- New features, tutorials, and demos are coming soon!
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
- [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
152
- [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
153
- [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
154
- [![GitHub stars](https://img.shields.io/github/stars/serenity-js/serenity-js?label=Serenity%2FJS&logo=github&style=badge)](https://github.com/serenity-js/serenity-js)
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
- ## 💛 Support Serenity/JS
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
- If you appreciate all the effort that goes into making sophisticated tools easy to work with, please support our work and become a Serenity/JS GitHub Sponsor today!
158
+ For corporate sponsorship or commercial support, please contact [Jan Molak](https://www.linkedin.com/in/janmolak/).
159
159
 
160
- [![GitHub Sponsors](https://img.shields.io/badge/Support%20@serenity%2FJS-703EC8?style=for-the-badge&logo=github&logoColor=white)](https://github.com/sponsors/serenity-js)
160
+ [![GitHub Sponsors](https://img.shields.io/badge/Support%20@serenity%2FJS-703EC8?style=for-the-badge&logo=github&logoColor=white)](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.36.1",
3
+ "version": "3.37.0",
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,12 +57,12 @@
57
57
  "node": "^20 || ^22 || ^24"
58
58
  },
59
59
  "dependencies": {
60
- "@serenity-js/core": "3.36.1",
61
- "@serenity-js/web": "3.36.1",
60
+ "@serenity-js/core": "3.37.0",
61
+ "@serenity-js/web": "3.37.0",
62
62
  "tiny-types": "1.24.3"
63
63
  },
64
64
  "peerDependencies": {
65
- "playwright-core": "~1.56.1"
65
+ "playwright-core": "~1.57.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@integration/testing-tools": "3.0.0",
@@ -71,9 +71,9 @@
71
71
  "c8": "10.1.3",
72
72
  "mocha": "11.7.5",
73
73
  "mocha-multi": "1.1.7",
74
- "playwright-core": "1.56.1",
74
+ "playwright-core": "1.57.0",
75
75
  "ts-node": "10.9.2",
76
76
  "typescript": "5.9.3"
77
77
  },
78
- "gitHead": "d13abbfcd6255c6f9466394d4efa1e808907a71f"
78
+ "gitHead": "dae146cd99a04f09b5926fb9d3205af562fa2927"
79
79
  }