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
docs: 1.60 release notes for Java, Python and C# (#40785)
Yury Semikhatsky7397f8e92341
diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.mdindex 52a786b29f..f24cd9eaaa 100644--- a/docs/src/release-notes-csharp.md+++ b/docs/src/release-notes-csharp.md@@ -6,6 +6,87 @@ toc_max_heading_level: 2import LiteYouTube from '@site/src/components/LiteYouTube';+## Version 1.60++### π HAR recording on Tracing++[`method: Tracing.startHar`] / [`method: Tracing.stopHar`] expose HAR recording as a first-class tracing API, with the same `Content`, `Mode` and `UrlFilter` options as `RecordHar`:++```csharp+await context.Tracing.StartHarAsync("trace.har");+var page = await context.NewPageAsync();+await page.GotoAsync("https://playwright.dev");+await context.Tracing.StopHarAsync();+```++### πͺ Drop API++New [`method: Locator.drop`] simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches `dragenter`, `dragover`, and `drop` with a synthetic [DataTransfer] in the page context β works cross-browser and is great for testing upload zones:++```csharp+await page.Locator("#dropzone").DropAsync(new() {+ Files = new FilePayload() {+ Name = "note.txt",+ MimeType = "text/plain",+ Buffer = Encoding.UTF8.GetBytes("hello"),+ },+});++await page.Locator("#dropzone").DropAsync(new() {+ Data = new Dictionary<string, string> {+ ["text/plain"] = "hello world",+ ["text/uri-list"] = "https://example.com",+ },+});+```++### π― Aria snapshots++- [`method: PageAssertions.toMatchAriaSnapshot`] now works on a [Page], in addition to a [Locator] β equivalent to asserting against `Page.Locator("body")`.+- New `Boxes` option on [`method: Locator.ariaSnapshot`] / [`method: Page.ariaSnapshot`] appends each element's bounding box as `[box=x,y,width,height]`, useful for AI consumption.++### New APIs++#### Browser, Context and Page++- Event [`event: Browser.context`] β fired when a new context is created on the browser.+- [BrowserContext] now mirrors lifecycle events from its pages: [`event: BrowserContext.download`], [`event: BrowserContext.frameAttached`], [`event: BrowserContext.frameDetached`], [`event: BrowserContext.frameNavigated`], [`event: BrowserContext.pageClose`], [`event: BrowserContext.pageLoad`].++#### Locators and Assertions++- New option `Description` in [`method: Page.getByRole`] / [`method: Locator.getByRole`] / [`method: Frame.getByRole`] / [`method: FrameLocator.getByRole`] for matching the [accessible description](https://www.w3.org/TR/wai-aria-1.2/#dfn-accessible-description).+- New option `Pseudo` in [`method: LocatorAssertions.toHaveCSS`] reads computed styles from `::before` or `::after`.+- New option `Style` in [`method: Locator.highlight`] applies extra inline CSS to the highlight overlay, plus new [`method: Page.hideHighlight`] to clear all highlights.++#### Network++- [`method: WebSocketRoute.protocols`] returns the WebSocket subprotocols requested by the page.+- New option `NoDefaults` in [`method: BrowserType.connectOverCDP`] disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.++#### Errors++- New [`method: WebError.location`] mirrors [`method: ConsoleMessage.location`].++### π οΈ Other improvements++- Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.++### Breaking Changes β οΈ++- Removed long-deprecated `Handle` option on `BrowserContext.ExposeBindingAsync` and `Page.ExposeBindingAsync`.++### Browser Versions++- Chromium 148.0.7778.96+- Mozilla Firefox 150.0.2+- WebKit 26.4++This version was also tested against the following stable channels:++- Google Chrome 147+- Microsoft Edge 147++## Version 1.59### π¬ Screencastdiff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.mdindex c2e9ee1e24..70497e4a72 100644--- a/docs/src/release-notes-java.md+++ b/docs/src/release-notes-java.md@@ -6,6 +6,80 @@ toc_max_heading_level: 2import LiteYouTube from '@site/src/components/LiteYouTube';+## Version 1.60++### π HAR recording on Tracing++[`method: Tracing.startHar`] / [`method: Tracing.stopHar`] expose HAR recording as a first-class tracing API, with the same `content`, `mode` and `urlFilter` options as `recordHar`:++```java+context.tracing().startHar(Paths.get("trace.har"));+Page page = context.newPage();+page.navigate("https://playwright.dev");+context.tracing().stopHar();+```++### πͺ Drop API++New [`method: Locator.drop`] simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches `dragenter`, `dragover`, and `drop` with a synthetic [DataTransfer] in the page context β works cross-browser and is great for testing upload zones:++```java+page.locator("#dropzone").drop(new Locator.DropPayload()+ .setFiles(new FilePayload("note.txt", "text/plain", "hello".getBytes(StandardCharsets.UTF_8))));++page.locator("#dropzone").drop(new Locator.DropPayload()+ .setData(Map.of(+ "text/plain", "hello world",+ "text/uri-list", "https://example.com")));+```++### π― Aria snapshots++- [`method: PageAssertions.toMatchAriaSnapshot`] now works on a [Page], in addition to a [Locator] β equivalent to asserting against `page.locator("body")`.+- New `boxes` option on [`method: Locator.ariaSnapshot`] / [`method: Page.ariaSnapshot`] appends each element's bounding box as `[box=x,y,width,height]`, useful for AI consumption.++### New APIs++#### Browser, Context and Page++- Event [`event: Browser.context`] β fired when a new context is created on the browser.+- [BrowserContext] now mirrors lifecycle events from its pages: [`event: BrowserContext.download`], [`event: BrowserContext.frameAttached`], [`event: BrowserContext.frameDetached`], [`event: BrowserContext.frameNavigated`], [`event: BrowserContext.pageClose`], [`event: BrowserContext.pageLoad`].++#### Locators and Assertions++- New option `description` in [`method: Page.getByRole`] / [`method: Locator.getByRole`] / [`method: Frame.getByRole`] / [`method: FrameLocator.getByRole`] for matching the [accessible description](https://www.w3.org/TR/wai-aria-1.2/#dfn-accessible-description).+- New option `pseudo` in [`method: LocatorAssertions.toHaveCSS`] reads computed styles from `::before` or `::after`.+- New option `style` in [`method: Locator.highlight`] applies extra inline CSS to the highlight overlay, plus new [`method: Page.hideHighlight`] to clear all highlights.++#### Network++- [`method: WebSocketRoute.protocols`] returns the WebSocket subprotocols requested by the page.+- New option `noDefaults` in [`method: BrowserType.connectOverCDP`] disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.++#### Errors++- New [`method: WebError.location`] mirrors [`method: ConsoleMessage.location`].++### π οΈ Other improvements++- Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.++### Breaking Changes β οΈ++- Removed long-deprecated `handle` option on `BrowserContext.exposeBinding` and `Page.exposeBinding`.++### Browser Versions++- Chromium 148.0.7778.96+- Mozilla Firefox 150.0.2+- WebKit 26.4++This version was also tested against the following stable channels:++- Google Chrome 147+- Microsoft Edge 147++## Version 1.59### π¬ Screencastdiff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.mdindex ea012876c7..91dd0a1fed 100644--- a/docs/src/release-notes-python.md+++ b/docs/src/release-notes-python.md@@ -6,6 +6,84 @@ toc_max_heading_level: 2import LiteYouTube from '@site/src/components/LiteYouTube';+## Version 1.60++### π HAR recording on Tracing++[`method: Tracing.startHar`] / [`method: Tracing.stopHar`] expose HAR recording as a first-class tracing API, with the same `content`, `mode` and `url_filter` options as `record_har`:++```python+context.tracing.start_har("trace.har")+page = context.new_page()+page.goto("https://playwright.dev")+context.tracing.stop_har()+```++### πͺ Drop API++New [`method: Locator.drop`] simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches `dragenter`, `dragover`, and `drop` with a synthetic [DataTransfer] in the page context β works cross-browser and is great for testing upload zones:++```python+page.locator("#dropzone").drop(+ files={"name": "note.txt", "mime_type": "text/plain", "buffer": b"hello"},+)++page.locator("#dropzone").drop(+ data={+ "text/plain": "hello world",+ "text/uri-list": "https://example.com",+ },+)+```++### π― Aria snapshots++- [`method: PageAssertions.toMatchAriaSnapshot`] now works on a [Page], in addition to a [Locator] β equivalent to asserting against `page.locator("body")`.+- New `boxes` option on [`method: Locator.ariaSnapshot`] / [`method: Page.ariaSnapshot`] appends each element's bounding box as `[box=x,y,width,height]`, useful for AI consumption.++### New APIs++#### Browser, Context and Page++- Event [`event: Browser.context`] β fired when a new context is created on the browser.+- [BrowserContext] now mirrors lifecycle events from its pages: [`event: BrowserContext.download`], [`event: BrowserContext.frameAttached`], [`event: BrowserContext.frameDetached`], [`event: BrowserContext.frameNavigated`], [`event: BrowserContext.pageClose`], [`event: BrowserContext.pageLoad`].++#### Locators and Assertions++- New option `description` in [`method: Page.getByRole`] / [`method: Locator.getByRole`] / [`method: Frame.getByRole`] / [`method: FrameLocator.getByRole`] for matching the [accessible description](https://www.w3.org/TR/wai-aria-1.2/#dfn-accessible-description).+- New option `pseudo` in [`method: LocatorAssertions.toHaveCSS`] reads computed styles from `::before` or `::after`.+- New option `style` in [`method: Locator.highlight`] applies extra inline CSS to the highlight overlay, plus new [`method: Page.hideHighlight`] to clear all highlights.++#### Network++- [`method: WebSocketRoute.protocols`] returns the WebSocket subprotocols requested by the page.+- New option `no_defaults` in [`method: BrowserType.connectOverCDP`] disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.++#### Errors++- New [`method: WebError.location`] mirrors [`method: ConsoleMessage.location`].+- [`method: ConsoleMessage.location`] now exposes `line` / `column` properties (`line_number` / `column_number` are deprecated).++### π οΈ Other improvements++- Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.++### Breaking Changes β οΈ++- Removed long-deprecated `handle` option on `BrowserContext.expose_binding` and `Page.expose_binding`.++### Browser Versions++- Chromium 148.0.7778.96+- Mozilla Firefox 150.0.2+- WebKit 26.4++This version was also tested against the following stable channels:++- Google Chrome 147+- Microsoft Edge 147++## Version 1.59### π¬ Screencast