You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Update versions to 5.2.4 and modernize Screenplay Playwright examples
Update dependency versions across documentation pages (Serenity 5.2.4,
JUnit 6.0.3, Cucumber 7.34.2, Playwright 1.58.0). Update the Screenplay
Playwright reference to recommend @UsePlaywright + withPage(page) as the
primary approach, with manual lifecycle management as an alternative.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/screenplay/screenplay-playwright.md
+66-12Lines changed: 66 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,12 +32,41 @@ Add the following dependency to your project:
32
32
33
33
### The BrowseTheWebWithPlaywright Ability
34
34
35
-
To use Playwright with Screenplay, actors need the `BrowseTheWebWithPlaywright` ability:
35
+
To use Playwright with Screenplay, actors need the `BrowseTheWebWithPlaywright` ability. The recommended approach is to use Playwright's `@UsePlaywright` annotation, which manages the browser lifecycle automatically:
The `withPage(Page)` factory method wraps a `@UsePlaywright`-managed page. Screenplay reuses the existing browser — no duplicate browser instance is created. On teardown, Screenplay only unregisters the page; it does **not** close the Page, BrowserContext, Browser, or Playwright instance.
60
+
61
+
:::tip `@SerenityPlaywright` shorthand
62
+
You can use the `@SerenityPlaywright` meta-annotation as a shorthand for both `@ExtendWith(SerenityJUnit5Extension.class)` and `@ExtendWith(SerenityPlaywrightExtension.class)`.
63
+
:::
64
+
65
+
#### Alternative: Manual Lifecycle Management
66
+
67
+
If you need full control over the browser lifecycle, you can manage it manually:
0 commit comments