Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: release notes for langs v1.59 (#39958)
Dmitry Gozman0dfef7ac726a
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.mdindex c06b6a58b6..89a46e0f52 100644--- a/docs/src/api/class-page.md+++ b/docs/src/api/class-page.md@@ -3876,7 +3876,6 @@ Handler function to route the WebSocket.## property: Page.screencast* since: v1.59-* langs: js- type: <[Screencast]>[Screencast] object associated with this page.diff --git a/docs/src/api/class-screencast.md b/docs/src/api/class-screencast.mdindex 3c201b5f45..435dd5041c 100644--- a/docs/src/api/class-screencast.md+++ b/docs/src/api/class-screencast.md@@ -31,7 +31,7 @@ await page.screencast.stop();### option: Screencast.start.onFrame* since: v1.59-- `onFrame` <[function]\([Object]\): [Promise]>+- `onFrame` <[function]\([Object=ScreencastFrame]\): [Promise]>- `data` <[Buffer]> JPEG-encoded frame data.Callback that receives JPEG-encoded frame data.diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.mdindex 60b7717fd9..beed46b9e2 100644--- a/docs/src/release-notes-csharp.md+++ b/docs/src/release-notes-csharp.md@@ -6,6 +6,126 @@ toc_max_heading_level: 2import LiteYouTube from '@site/src/components/LiteYouTube';+## Version 1.59++### π¬ Screencast++New [`property: Page.screencast`] API provides a unified interface for capturing page content β both as video recordings and as real-time frame streams.++<img src="https://raw.githubusercontent.com/microsoft/playwright/main/docs/src/images/release-notes-1.59-screencast-demo.gif" alt="Demo" width="500" height="313" />++**Video recording** β record video with precise start/stop control, as an alternative to the [`option: Browser.newContext.recordVideoDir`] option:++```csharp+await page.Screencast.StartAsync(new() { Path = "video.webm" });+// ... perform actions ...+await page.Screencast.StopAsync();+```++**Real-time frame capture** β stream JPEG-encoded frames for custom processing like thumbnails, live previews, AI vision, and more:++```csharp+await page.Screencast.StartAsync(new() {+ OnFrame = frame => SendToVisionModel(frame.Data),+});+```++**Action annotations** β enable built-in visual annotations that highlight interacted elements and display action titles during recording:++```csharp+await page.Screencast.StartAsync(new() {+ Path = "video.webm",+ Annotate = new() { Position = "top-right" },+});+```++The `Annotate` option accepts `Position` (`"top-left"`, `"top"`, `"top-right"`, `"bottom-left"`, `"bottom"`, `"bottom-right"`), `Duration` (ms per annotation), and `FontSize` (px).++**Visual overlays** β add chapter titles and custom HTML overlays on top of the page for richer narration:++```csharp+await page.Screencast.ShowChapterAsync("Adding TODOs", new() {+ Description = "Type and press enter for each TODO",+ Duration = 1000,+});++await page.Screencast.ShowOverlayAsync("<div style=\"color: red\">Recording</div>");+```++**Agentic video receipts** β coding agents can produce video evidence of their work. After completing a task, an agent can record a walkthrough video with rich annotations for human review:++```csharp+await page.Screencast.StartAsync(new() {+ Path = "receipt.webm",+ Annotate = new() { Position = "top-right" },+});++await page.Screencast.ShowChapterAsync("Verifying checkout flow", new() {+ Description = "Added coupon code support per ticket #1234",+});++// Agent performs the verification steps...+await page.Locator("#coupon").FillAsync("SAVE20");+await page.Locator("#apply-coupon").ClickAsync();+await Expect(page.Locator(".discount")).ToContainTextAsync("20%");++await page.Screencast.ShowChapterAsync("Done", new() {+ Description = "Coupon applied, discount reflected in total",+});++await page.Screencast.StopAsync();+```++The resulting video serves as a receipt: chapter titles provide context, action annotations highlight each interaction, and the visual walkthrough is faster to review than text logs.++### π Snapshots and Locators++- Method [`method: Page.ariaSnapshot`] to capture the aria snapshot of the page β equivalent to `Page.Locator("body").AriaSnapshotAsync()`.+- Options `Depth` and `Mode` in [`method: Locator.ariaSnapshot`].+- Method [`method: Locator.normalize`] converts a locator to follow best practices like test ids and aria roles.+- Method [`method: Page.pickLocator`] enters an interactive mode where hovering over elements highlights them and shows the corresponding locator. Click an element to get its [Locator] back. Use [`method: Page.cancelPickLocator`] to cancel.++### New APIs++#### Screencast++- [`property: Page.screencast`] provides video recording, real-time frame streaming, and overlay management.+- Methods [`method: Screencast.start`] and [`method: Screencast.stop`] for recording and frame capture.+- Methods [`method: Screencast.showChapter`] and [`method: Screencast.showOverlay`] for visual annotations.+- Methods [`method: Screencast.showOverlays`] and [`method: Screencast.hideOverlays`] for overlay visibility control.++#### Storage, Console and Errors++- Method [`method: BrowserContext.setStorageState`] clears existing cookies, local storage, and IndexedDB for all origins and sets a new storage state β no need to create a new context.+- Methods [`method: Page.clearConsoleMessages`] and [`method: Page.clearPageErrors`] to clear stored messages and errors.+- Option `Filter` in [`method: Page.consoleMessages`] and [`method: Page.pageErrors`] controls which messages are returned.+- Method [`method: ConsoleMessage.timestamp`].++#### Miscellaneous++- [`property: BrowserContext.debugger`] provides programmatic control over the Playwright debugger.+- Method [`method: BrowserContext.isClosed`].+- Method [`method: Request.existingResponse`] returns the response without waiting.+- Method [`method: Response.httpVersion`] returns the HTTP version used by the response.+- Event [`event: CDPSession.close`] for CDP sessions.+- Option `Live` in [`method: Tracing.start`] for real-time trace updates.+- Option `ArtifactsDir` in [`method: BrowserType.launch`] to configure the artifacts directory.++### Breaking Changes β οΈ++- Removed macOS 14 support for WebKit. We recommend upgrading your macOS version, or keeping an older Playwright version.++### Browser Versions++- Chromium 147.0.7727.15+- Mozilla Firefox 148.0.2+- WebKit 26.0++This version was also tested against the following stable channels:++- Google Chrome 146+- Microsoft Edge 146+## Version 1.58### UI Mode and Trace Viewer Improvementsdiff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.mdindex 59f8db5c84..81c3c1f1a9 100644--- a/docs/src/release-notes-java.md+++ b/docs/src/release-notes-java.md@@ -6,6 +6,123 @@ toc_max_heading_level: 2import LiteYouTube from '@site/src/components/LiteYouTube';+## Version 1.59++### π¬ Screencast++New [`property: Page.screencast`] API provides a unified interface for capturing page content β both as video recordings and as real-time frame streams.++<img src="https://raw.githubusercontent.com/microsoft/playwright/main/docs/src/images/release-notes-1.59-screencast-demo.gif" alt="Demo" width="500" height="313" />++**Video recording** β record video with precise start/stop control, as an alternative to the [`option: Browser.newContext.recordVideoDir`] option:++```java+page.screencast().start(new Screencast.StartOptions().setPath(Paths.get("video.webm")));+// ... perform actions ...+page.screencast().stop();+```++**Real-time frame capture** β stream JPEG-encoded frames for custom processing like thumbnails, live previews, AI vision, and more:++```java+page.screencast().start(new Screencast.StartOptions()+ .setOnFrame(frame -> sendToVisionModel(frame.data)));+```++**Action annotations** β enable built-in visual annotations that highlight interacted elements and display action titles during recording:++```java+page.screencast().start(new Screencast.StartOptions()+ .setPath(Paths.get("video.webm"))+ .setAnnotate(new Screencast.Annotate().setPosition("top-right")));+```++The `annotate` option accepts `position` (`"top-left"`, `"top"`, `"top-right"`, `"bottom-left"`, `"bottom"`, `"bottom-right"`), `duration` (ms per annotation), and `fontSize` (px).++**Visual overlays** β add chapter titles and custom HTML overlays on top of the page for richer narration:++```java+page.screencast().showChapter("Adding TODOs",+ new Screencast.ShowChapterOptions()+ .setDescription("Type and press enter for each TODO")+ .setDuration(1000));++page.screencast().showOverlay("<div style=\"color: red\">Recording</div>");+```++**Agentic video receipts** β coding agents can produce video evidence of their work. After completing a task, an agent can record a walkthrough video with rich annotations for human review:++```java+page.screencast().start(new Screencast.StartOptions()+ .setPath(Paths.get("receipt.webm"))+ .setAnnotate(new Screencast.Annotate().setPosition("top-right")));++page.screencast().showChapter("Verifying checkout flow",+ new Screencast.ShowChapterOptions()+ .setDescription("Added coupon code support per ticket #1234"));++// Agent performs the verification steps...+page.locator("#coupon").fill("SAVE20");+page.locator("#apply-coupon").click();+assertThat(page.locator(".discount")).containsText("20%");++page.screencast().showChapter("Done",+ new Screencast.ShowChapterOptions()+ .setDescription("Coupon applied, discount reflected in total"));++page.screencast().stop();+```++The resulting video serves as a receipt: chapter titles provide context, action annotations highlight each interaction, and the visual walkthrough is faster to review than text logs.++### π Snapshots and Locators++- Method [`method: Page.ariaSnapshot`] to capture the aria snapshot of the page β equivalent to `page.locator("body").ariaSnapshot()`.+- Options `depth` and `mode` in [`method: Locator.ariaSnapshot`].+- Method [`method: Locator.normalize`] converts a locator to follow best practices like test ids and aria roles.+- Method [`method: Page.pickLocator`] enters an interactive mode where hovering over elements highlights them and shows the corresponding locator. Click an element to get its [Locator] back. Use [`method: Page.cancelPickLocator`] to cancel.++### New APIs++#### Screencast++- [`property: Page.screencast`] provides video recording, real-time frame streaming, and overlay management.+- Methods [`method: Screencast.start`] and [`method: Screencast.stop`] for recording and frame capture.+- Methods [`method: Screencast.showChapter`] and [`method: Screencast.showOverlay`] for visual annotations.+- Methods [`method: Screencast.showOverlays`] and [`method: Screencast.hideOverlays`] for overlay visibility control.++#### Storage, Console and Errors++- Method [`method: BrowserContext.setStorageState`] clears existing cookies, local storage, and IndexedDB for all origins and sets a new storage state β no need to create a new context.+- Methods [`method: Page.clearConsoleMessages`] and [`method: Page.clearPageErrors`] to clear stored messages and errors.+- Option `filter` in [`method: Page.consoleMessages`] and [`method: Page.pageErrors`] controls which messages are returned.+- Method [`method: ConsoleMessage.timestamp`].++#### Miscellaneous++- [`property: BrowserContext.debugger`] provides programmatic control over the Playwright debugger.+- Method [`method: BrowserContext.isClosed`].+- Method [`method: Request.existingResponse`] returns the response without waiting.+- Method [`method: Response.httpVersion`] returns the HTTP version used by the response.+- Event [`event: CDPSession.close`] for CDP sessions.+- Option `live` in [`method: Tracing.start`] for real-time trace updates.+- Option `artifactsDir` in [`method: BrowserType.launch`] to configure the artifacts directory.++### Breaking Changes β οΈ++- Removed macOS 14 support for WebKit. We recommend upgrading your macOS version, or keeping an older Playwright version.++### Browser Versions++- Chromium 147.0.7727.15+- Mozilla Firefox 148.0.2+- WebKit 26.0++This version was also tested against the following stable channels:++- Google Chrome 146+- Microsoft Edge 146+## Version 1.58### UI Mode and Trace Viewer Improvementsdiff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.mdindex 435911d424..083df54931 100644--- a/docs/src/release-notes-js.md+++ b/docs/src/release-notes-js.md@@ -197,14 +197,14 @@ await using page = await context.newPage();### Browser Versions-- Chromium 146.0.7680.31+- Chromium 147.0.7727.15- Mozilla Firefox 148.0.2- WebKit 26.0This version was also tested against the following stable channels:-- Google Chrome 145-- Microsoft Edge 145+- Google Chrome 146+- Microsoft Edge 146## Version 1.58diff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.mdindex 49aa5671fa..41745ad3c6 100644--- a/docs/src/release-notes-python.md+++ b/docs/src/release-notes-python.md@@ -6,6 +6,126 @@ toc_max_heading_level: 2import LiteYouTube from '@site/src/components/LiteYouTube';+## Version 1.59++### π¬ Screencast++New [`property: Page.screencast`] API provides a unified interface for capturing page content β both as video recordings and as real-time frame streams.++<img src="https://raw.githubusercontent.com/microsoft/playwright/main/docs/src/images/release-notes-1.59-screencast-demo.gif" alt="Demo" width="500" height="313" />++**Video recording** β record video with precise start/stop control, as an alternative to the [`option: Browser.newContext.recordVideoDir`] option:++```python+page.screencast.start(path="video.webm")+# ... perform actions ...+page.screencast.stop()+```++**Real-time frame capture** β stream JPEG-encoded frames for custom processing like thumbnails, live previews, AI vision, and more:++```python+page.screencast.start(+ on_frame=lambda frame: send_to_vision_model(frame["data"]),+)+```++**Action annotations** β enable built-in visual annotations that highlight interacted elements and display action titles during recording:++```python+page.screencast.start(+ path="video.webm",+ annotate={"position": "top-right"},+)+```++The `annotate` option accepts `position` (`'top-left'`, `'top'`, `'top-right'`, `'bottom-left'`, `'bottom'`, `'bottom-right'`), `duration` (ms per annotation), and `font_size` (px).++**Visual overlays** β add chapter titles and custom HTML overlays on top of the page for richer narration:++```python+page.screencast.show_chapter("Adding TODOs",+ description="Type and press enter for each TODO",+ duration=1000,+)++page.screencast.show_overlay('<div style="color: red">Recording</div>')+```++**Agentic video receipts** β coding agents can produce video evidence of their work. After completing a task, an agent can record a walkthrough video with rich annotations for human review:++```python+page.screencast.start(+ path="receipt.webm",+ annotate={"position": "top-right"},+)++page.screencast.show_chapter("Verifying checkout flow",+ description="Added coupon code support per ticket #1234",+)++# Agent performs the verification steps...+page.locator("#coupon").fill("SAVE20")+page.locator("#apply-coupon").click()+expect(page.locator(".discount")).to_contain_text("20%")++page.screencast.show_chapter("Done",+ description="Coupon applied, discount reflected in total",+)++page.screencast.stop()+```++The resulting video serves as a receipt: chapter titles provide context, action annotations highlight each interaction, and the visual walkthrough is faster to review than text logs.++### π Snapshots and Locators++- Method [`method: Page.ariaSnapshot`] to capture the aria snapshot of the page β equivalent to `page.locator('body').aria_snapshot()`.+- Options `depth` and `mode` in [`method: Locator.ariaSnapshot`].+- Method [`method: Locator.normalize`] converts a locator to follow best practices like test ids and aria roles.+- Method [`method: Page.pickLocator`] enters an interactive mode where hovering over elements highlights them and shows the corresponding locator. Click an element to get its [Locator] back. Use [`method: Page.cancelPickLocator`] to cancel.++### New APIs++#### Screencast++- [`property: Page.screencast`] provides video recording, real-time frame streaming, and overlay management.+- Methods [`method: Screencast.start`] and [`method: Screencast.stop`] for recording and frame capture.+- Methods [`method: Screencast.showChapter`] and [`method: Screencast.showOverlay`] for visual annotations.+- Methods [`method: Screencast.showOverlays`] and [`method: Screencast.hideOverlays`] for overlay visibility control.++#### Storage, Console and Errors++- Method [`method: BrowserContext.setStorageState`] clears existing cookies, local storage, and IndexedDB for all origins and sets a new storage state β no need to create a new context.+- Methods [`method: Page.clearConsoleMessages`] and [`method: Page.clearPageErrors`] to clear stored messages and errors.+- Option `filter` in [`method: Page.consoleMessages`] and [`method: Page.pageErrors`] controls which messages are returned.+- Method [`method: ConsoleMessage.timestamp`].++#### Miscellaneous++- [`property: BrowserContext.debugger`] provides programmatic control over the Playwright debugger.+- Method [`method: BrowserContext.isClosed`].+- Method [`method: Request.existingResponse`] returns the response without waiting.+- Method [`method: Response.httpVersion`] returns the HTTP version used by the response.+- Event [`event: CDPSession.close`] for CDP sessions.+- Option `live` in [`method: Tracing.start`] for real-time trace updates.+- Option `artifacts_dir` in [`method: BrowserType.launch`] to configure the artifacts directory.++### Breaking Changes β οΈ++- Removed macOS 14 support for WebKit. We recommend upgrading your macOS version, or keeping an older Playwright version.++### Browser Versions++- Chromium 147.0.7727.15+- Mozilla Firefox 148.0.2+- WebKit 26.0++This version was also tested against the following stable channels:++- Google Chrome 146+- Microsoft Edge 146+## Version 1.58### UI Mode and Trace Viewer Improvementsdiff --git a/utils/doclint/generateDotnetApi.js b/utils/doclint/generateDotnetApi.jsindex 532e0a6b35..426ddddb4d 100644--- a/utils/doclint/generateDotnetApi.js+++ b/utils/doclint/generateDotnetApi.js@@ -87,6 +87,7 @@ classNameMap.set('URL', 'string');classNameMap.set('RegExp', 'Regex');classNameMap.set('Readable', 'Stream');classNameMap.set('Disposable', 'IAsyncDisposable');+classNameMap.set('Promise', 'Task');/***