diff --git a/development/CLI_VERSION b/development/CLI_VERSION
index 5a5c7211..9cbd34da 100644
--- a/development/CLI_VERSION
+++ b/development/CLI_VERSION
@@ -1 +1 @@
-1.50.0
+1.50.1
diff --git a/development/api.json b/development/api.json
index c1e0e0e0..9ee104bc 100644
--- a/development/api.json
+++ b/development/api.json
@@ -28743,7 +28743,14 @@
"members": [
{
"kind": "method",
- "langs": {},
+ "langs": {
+ "only": [
+ "js"
+ ],
+ "aliases": {},
+ "types": {},
+ "overrides": {}
+ },
"since": "v1.8",
"name": "connect",
"type": {
@@ -28753,11 +28760,21 @@
"spec": [
{
"type": "text",
- "text": "This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x)."
+ "text": "This method attaches Playwright to an existing browser instance created via [`method: BrowserType.launchServer`]."
+ },
+ {
+ "type": "note",
+ "noteType": "note",
+ "children": [
+ {
+ "type": "text",
+ "text": "The major and minor version of the Playwright instance that connects needs to match the version of Playwright that launches the browser (1.2.3 → is compatible with 1.2.x)."
+ }
+ ]
}
],
"required": true,
- "comment": "This method attaches Playwright to an existing browser instance. When connecting to another browser launched via\n`BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is\ncompatible with 1.2.x).",
+ "comment": "This method attaches Playwright to an existing browser instance created via [`method: BrowserType.launchServer`].\n\n**NOTE** The major and minor version of the Playwright instance that connects needs to match the version of\nPlaywright that launches the browser (1.2.3 → is compatible with 1.2.x).\n",
"async": true,
"alias": "connect",
"overloadIndex": 0,
@@ -28774,11 +28791,11 @@
"spec": [
{
"type": "text",
- "text": "A browser websocket endpoint to connect to."
+ "text": "A Playwright browser websocket endpoint to connect to. You obtain this endpoint via [`method: BrowserServer.wsEndpoint`]."
}
],
"required": true,
- "comment": "A browser websocket endpoint to connect to.",
+ "comment": "A Playwright browser websocket endpoint to connect to. You obtain this endpoint via\n[`method: BrowserServer.wsEndpoint`].",
"async": false,
"alias": "wsEndpoint",
"overloadIndex": 0
@@ -28959,6 +28976,47 @@
}
]
},
+ {
+ "kind": "method",
+ "langs": {
+ "only": [
+ "python",
+ "csharp",
+ "java"
+ ],
+ "aliases": {},
+ "types": {},
+ "overrides": {}
+ },
+ "since": "v1.8",
+ "name": "connect",
+ "type": {
+ "name": "Browser",
+ "expression": "[Browser]"
+ },
+ "spec": [
+ {
+ "type": "text",
+ "text": "This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js."
+ },
+ {
+ "type": "note",
+ "noteType": "note",
+ "children": [
+ {
+ "type": "text",
+ "text": "The major and minor version of the Playwright instance that connects needs to match the version of Playwright that launches the browser (1.2.3 → is compatible with 1.2.x)."
+ }
+ ]
+ }
+ ],
+ "required": true,
+ "comment": "This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.\n\n**NOTE** The major and minor version of the Playwright instance that connects needs to match the version of\nPlaywright that launches the browser (1.2.3 → is compatible with 1.2.x).\n",
+ "async": true,
+ "alias": "connect",
+ "overloadIndex": 0,
+ "args": []
+ },
{
"kind": "method",
"langs": {},
@@ -28987,6 +29045,16 @@
}
]
},
+ {
+ "type": "note",
+ "noteType": "note",
+ "children": [
+ {
+ "type": "text",
+ "text": "This connection is significantly lower fidelity than the Playwright protocol connection via [`method: BrowserType.connect`]. If you are experiencing issues or attempting to use advanced functionality, you probably want to use [`method: BrowserType.connect`]."
+ }
+ ]
+ },
{
"type": "text",
"text": "**Usage**"
@@ -29038,7 +29106,7 @@
}
],
"required": true,
- "comment": "This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol.\n\nThe default browser context is accessible via [`method: Browser.contexts`].\n\n**NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.\n\n**Usage**\n\n```js\nconst browser = await playwright.chromium.connectOverCDP('http://localhost:9222');\nconst defaultContext = browser.contexts()[0];\nconst page = defaultContext.pages()[0];\n```\n\n```java\nBrowser browser = playwright.chromium().connectOverCDP(\"http://localhost:9222\");\nBrowserContext defaultContext = browser.contexts().get(0);\nPage page = defaultContext.pages().get(0);\n```\n\n```py\nbrowser = await playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```py\nbrowser = playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```csharp\nvar browser = await playwright.Chromium.ConnectOverCDPAsync(\"http://localhost:9222\");\nvar defaultContext = browser.Contexts[0];\nvar page = defaultContext.Pages[0];\n```\n",
+ "comment": "This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol.\n\nThe default browser context is accessible via [`method: Browser.contexts`].\n\n**NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.\n\n**NOTE** This connection is significantly lower fidelity than the Playwright protocol connection via\n[`method: BrowserType.connect`]. If you are experiencing issues or attempting to use advanced functionality, you\nprobably want to use [`method: BrowserType.connect`].\n\n**Usage**\n\n```js\nconst browser = await playwright.chromium.connectOverCDP('http://localhost:9222');\nconst defaultContext = browser.contexts()[0];\nconst page = defaultContext.pages()[0];\n```\n\n```java\nBrowser browser = playwright.chromium().connectOverCDP(\"http://localhost:9222\");\nBrowserContext defaultContext = browser.contexts().get(0);\nPage page = defaultContext.pages().get(0);\n```\n\n```py\nbrowser = await playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```py\nbrowser = playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```csharp\nvar browser = await playwright.Chromium.ConnectOverCDPAsync(\"http://localhost:9222\");\nvar defaultContext = browser.Contexts[0];\nvar page = defaultContext.Pages[0];\n```\n",
"async": true,
"alias": "connectOverCDP",
"overloadIndex": 0,
@@ -63835,7 +63903,7 @@
"spec": [
{
"type": "text",
- "text": "Captures the aria snapshot of the given element.↵Read more about [aria snapshots](../aria-snapshots.md) and [`method: LocatorAssertions.toMatchAriaSnapshot#1`] for the corresponding assertion."
+ "text": "Captures the aria snapshot of the given element.↵Read more about [aria snapshots](../aria-snapshots.md) and [`method: LocatorAssertions.toMatchAriaSnapshot`] for the corresponding assertion."
},
{
"type": "text",
@@ -63930,7 +63998,7 @@
}
],
"required": true,
- "comment": "Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.md) and\n[`method: LocatorAssertions.toMatchAriaSnapshot#1`] for the corresponding assertion.\n\n**Usage**\n\n```js\nawait page.getByRole('link').ariaSnapshot();\n```\n\n```java\npage.getByRole(AriaRole.LINK).ariaSnapshot();\n```\n\n```py\nawait page.get_by_role(\"link\").aria_snapshot()\n```\n\n```py\npage.get_by_role(\"link\").aria_snapshot()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Link).AriaSnapshotAsync();\n```\n\n**Details**\n\nThis method captures the aria snapshot of the given element. The snapshot is a string that represents the state of\nthe element and its children. The snapshot can be used to assert the state of the element in the test, or to\ncompare it to state in the future.\n\nThe ARIA snapshot is represented using [YAML](https://yaml.org/spec/1.2.2/) markup language:\n- The keys of the objects are the roles and optional accessible names of the elements.\n- The values are either text content or an array of child elements.\n- Generic static text can be represented with the `text` key.\n\nBelow is the HTML markup and the respective ARIA snapshot:\n\n```html\n
\n - Home
\n - About
\n\n```\n\n```yml\n- list \"Links\":\n - listitem:\n - link \"Home\"\n - listitem:\n - link \"About\"\n```\n",
+ "comment": "Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.md) and\n[`method: LocatorAssertions.toMatchAriaSnapshot`] for the corresponding assertion.\n\n**Usage**\n\n```js\nawait page.getByRole('link').ariaSnapshot();\n```\n\n```java\npage.getByRole(AriaRole.LINK).ariaSnapshot();\n```\n\n```py\nawait page.get_by_role(\"link\").aria_snapshot()\n```\n\n```py\npage.get_by_role(\"link\").aria_snapshot()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Link).AriaSnapshotAsync();\n```\n\n**Details**\n\nThis method captures the aria snapshot of the given element. The snapshot is a string that represents the state of\nthe element and its children. The snapshot can be used to assert the state of the element in the test, or to\ncompare it to state in the future.\n\nThe ARIA snapshot is represented using [YAML](https://yaml.org/spec/1.2.2/) markup language:\n- The keys of the objects are the roles and optional accessible names of the elements.\n- The values are either text content or an array of child elements.\n- Generic static text can be represented with the `text` key.\n\nBelow is the HTML markup and the respective ARIA snapshot:\n\n```html\n\n - Home
\n - About
\n\n```\n\n```yml\n- list \"Links\":\n - listitem:\n - link \"Home\"\n - listitem:\n - link \"About\"\n```\n",
"async": true,
"alias": "ariaSnapshot",
"overloadIndex": 0,
@@ -76544,6 +76612,131 @@
}
]
},
+ {
+ "kind": "method",
+ "langs": {
+ "only": [
+ "python"
+ ],
+ "aliases": {},
+ "types": {},
+ "overrides": {}
+ },
+ "since": "v1.50",
+ "name": "NotToHaveAccessibleErrorMessage",
+ "type": {
+ "name": "void"
+ },
+ "spec": [
+ {
+ "type": "text",
+ "text": "The opposite of [`method: LocatorAssertions.toHaveAccessibleErrorMessage`]."
+ }
+ ],
+ "required": true,
+ "comment": "The opposite of [`method: LocatorAssertions.toHaveAccessibleErrorMessage`].",
+ "async": true,
+ "alias": "NotToHaveAccessibleErrorMessage",
+ "overloadIndex": 0,
+ "args": [
+ {
+ "kind": "property",
+ "langs": {},
+ "since": "v1.50",
+ "name": "errorMessage",
+ "type": {
+ "name": "",
+ "union": [
+ {
+ "name": "string"
+ },
+ {
+ "name": "RegExp"
+ }
+ ],
+ "expression": "[string]|[RegExp]"
+ },
+ "spec": [
+ {
+ "type": "text",
+ "text": "Expected accessible error message."
+ }
+ ],
+ "required": true,
+ "comment": "Expected accessible error message.",
+ "async": false,
+ "alias": "errorMessage",
+ "overloadIndex": 0
+ },
+ {
+ "kind": "property",
+ "langs": {},
+ "since": "v1.50",
+ "name": "options",
+ "type": {
+ "name": "Object",
+ "properties": [
+ {
+ "kind": "property",
+ "langs": {},
+ "since": "v1.50",
+ "name": "ignoreCase",
+ "type": {
+ "name": "boolean",
+ "expression": "[boolean]"
+ },
+ "spec": [
+ {
+ "type": "text",
+ "text": "Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."
+ }
+ ],
+ "required": false,
+ "comment": "Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.",
+ "async": false,
+ "alias": "ignoreCase",
+ "overloadIndex": 0
+ },
+ {
+ "kind": "property",
+ "langs": {
+ "only": [
+ "java",
+ "python",
+ "csharp"
+ ],
+ "aliases": {},
+ "types": {},
+ "overrides": {}
+ },
+ "since": "v1.50",
+ "name": "timeout",
+ "type": {
+ "name": "float",
+ "expression": "[float]"
+ },
+ "spec": [
+ {
+ "type": "text",
+ "text": "Time to retry the assertion for in milliseconds. Defaults to `5000`."
+ }
+ ],
+ "required": false,
+ "comment": "Time to retry the assertion for in milliseconds. Defaults to `5000`.",
+ "async": false,
+ "alias": "timeout",
+ "overloadIndex": 0
+ }
+ ]
+ },
+ "required": false,
+ "comment": "",
+ "async": false,
+ "alias": "options",
+ "overloadIndex": 0
+ }
+ ]
+ },
{
"kind": "method",
"langs": {
@@ -78195,11 +78388,11 @@
"spec": [
{
"type": "text",
- "text": "The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot#1`]."
+ "text": "The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot`]."
}
],
"required": true,
- "comment": "The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot#1`].",
+ "comment": "The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot`].",
"async": true,
"alias": "NotToMatchAriaSnapshot",
"overloadIndex": 0,
@@ -84753,7 +84946,7 @@
"overrides": {}
},
"since": "v1.49",
- "name": "toMatchAriaSnapshot#1",
+ "name": "toMatchAriaSnapshot",
"type": {
"name": "void"
},
@@ -84940,6 +85133,10 @@
"type": "text",
"text": "Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.md)."
},
+ {
+ "type": "text",
+ "text": "Snapshot is stored in a separate `.yml` file in a location configured by `expect.toMatchAriaSnapshot.pathTemplate` and/or `snapshotPathTemplate` properties in the configuration file."
+ },
{
"type": "text",
"text": "**Usage**"
@@ -84948,42 +85145,13 @@
"type": "code",
"lines": [
"await expect(page.locator('body')).toMatchAriaSnapshot();",
- "await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'snapshot' });",
- "await expect(page.locator('body')).toMatchAriaSnapshot({ path: '/path/to/snapshot.yml' });"
+ "await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.yml' });"
],
"codeLang": "js"
- },
- {
- "type": "code",
- "lines": [
- "await expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml')"
- ],
- "codeLang": "python async"
- },
- {
- "type": "code",
- "lines": [
- "expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml')"
- ],
- "codeLang": "python sync"
- },
- {
- "type": "code",
- "lines": [
- "await Expect(page.Locator(\"body\")).ToMatchAriaSnapshotAsync(new { Path = \"/path/to/snapshot.yml\" });"
- ],
- "codeLang": "csharp"
- },
- {
- "type": "code",
- "lines": [
- "assertThat(page.locator(\"body\")).matchesAriaSnapshot(new LocatorAssertions.MatchesAriaSnapshotOptions().setPath(\"/path/to/snapshot.yml\"));"
- ],
- "codeLang": "java"
}
],
"required": true,
- "comment": "Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.md).\n\n**Usage**\n\n```js\nawait expect(page.locator('body')).toMatchAriaSnapshot();\nawait expect(page.locator('body')).toMatchAriaSnapshot({ name: 'snapshot' });\nawait expect(page.locator('body')).toMatchAriaSnapshot({ path: '/path/to/snapshot.yml' });\n```\n\n```py\nawait expect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml')\n```\n\n```py\nexpect(page.locator('body')).to_match_aria_snapshot(path='/path/to/snapshot.yml')\n```\n\n```csharp\nawait Expect(page.Locator(\"body\")).ToMatchAriaSnapshotAsync(new { Path = \"/path/to/snapshot.yml\" });\n```\n\n```java\nassertThat(page.locator(\"body\")).matchesAriaSnapshot(new LocatorAssertions.MatchesAriaSnapshotOptions().setPath(\"/path/to/snapshot.yml\"));\n```\n",
+ "comment": "Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.md).\n\nSnapshot is stored in a separate `.yml` file in a location configured by `expect.toMatchAriaSnapshot.pathTemplate`\nand/or `snapshotPathTemplate` properties in the configuration file.\n\n**Usage**\n\n```js\nawait expect(page.locator('body')).toMatchAriaSnapshot();\nawait expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.yml' });\n```\n",
"async": true,
"alias": "toMatchAriaSnapshot",
"overloadIndex": 1,
@@ -85015,11 +85183,11 @@
"spec": [
{
"type": "text",
- "text": "Name of the snapshot to store in the snapshot (screenshot) folder corresponding to this test.↵Generates sequential names if not specified."
+ "text": "Name of the snapshot to store in the snapshot folder corresponding to this test.↵Generates sequential names if not specified."
}
],
"required": false,
- "comment": "Name of the snapshot to store in the snapshot (screenshot) folder corresponding to this test. Generates sequential\nnames if not specified.",
+ "comment": "Name of the snapshot to store in the snapshot folder corresponding to this test. Generates sequential names if not\nspecified.",
"async": false,
"alias": "name",
"overloadIndex": 0
diff --git a/development/unimplemented_examples.md b/development/unimplemented_examples.md
index c0f4aa58..b61efd15 100644
--- a/development/unimplemented_examples.md
+++ b/development/unimplemented_examples.md
@@ -26,3 +26,14 @@ expect(locator).to_have_class(re.compile(r"(^|\\s)selected(\\s|$)"))
expect(locator).to_have_class("middle selected row")
```
+
+### example_7e42f38bd7c5b69b7f22390f6afa0f53aa155d74ad6a72b080fa2910013dc22c (LocatorAssertions#to_match_aria_snapshot)
+
+```
+page.goto("https://demo.playwright.dev/todomvc/")
+expect(page.locator('body')).to_match_aria_snapshot('''
+ - heading "todos"
+ - textbox "What needs to be done?"
+''')
+
+```
diff --git a/documentation/docs/api/browser_type.md b/documentation/docs/api/browser_type.md
index fb948184..c05a15c1 100644
--- a/documentation/docs/api/browser_type.md
+++ b/documentation/docs/api/browser_type.md
@@ -37,6 +37,8 @@ The default browser context is accessible via [Browser#contexts](./browser#conte
**NOTE**: Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
+**NOTE**: This connection is significantly lower fidelity than the Playwright protocol connection via [BrowserType#connect](./browser_type#connect). If you are experiencing issues or attempting to use advanced functionality, you probably want to use [BrowserType#connect](./browser_type#connect).
+
**Usage**
```ruby
diff --git a/documentation/docs/api/locator.md b/documentation/docs/api/locator.md
index bfddd2df..b089abcc 100644
--- a/documentation/docs/api/locator.md
+++ b/documentation/docs/api/locator.md
@@ -92,7 +92,7 @@ def aria_snapshot(timeout: nil)
Captures the aria snapshot of the given element.
-Read more about [aria snapshots](https://playwright.dev/python/docs/aria-snapshots) and [LocatorAssertions#to_match_aria_snapshot#1](./locator_assertions#to_match_aria_snapshot#1) for the corresponding assertion.
+Read more about [aria snapshots](https://playwright.dev/python/docs/aria-snapshots) and [LocatorAssertions#to_match_aria_snapshot](./locator_assertions#to_match_aria_snapshot) for the corresponding assertion.
**Usage**
diff --git a/documentation/docs/api/locator_assertions.md b/documentation/docs/api/locator_assertions.md
index 7ed74c50..ef1b4f8e 100644
--- a/documentation/docs/api/locator_assertions.md
+++ b/documentation/docs/api/locator_assertions.md
@@ -134,6 +134,15 @@ expect(locator).not_to have_accessible_description(name, ignoreCase: nil, timeou
The opposite of [LocatorAssertions#to_have_accessible_description](./locator_assertions#to_have_accessible_description).
+## not_to_have_accessible_error_message
+
+```ruby
+expect(locator).not_to have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil)
+```
+
+
+The opposite of [LocatorAssertions#to_have_accessible_error_message](./locator_assertions#to_have_accessible_error_message).
+
## not_to_have_accessible_name
```ruby
@@ -745,3 +754,23 @@ locator = page.locator("id=favorite-colors")
locator.select_option(["R", "G"])
expect(locator).to have_values([/R/, /G/])
```
+
+## to_match_aria_snapshot
+
+```ruby
+expect(locator).to match_aria_snapshot(expected, timeout: nil)
+```
+
+
+Asserts that the target element matches the given [accessibility snapshot](https://playwright.dev/python/docs/aria-snapshots).
+
+**Usage**
+
+```python title="example_7e42f38bd7c5b69b7f22390f6afa0f53aa155d74ad6a72b080fa2910013dc22c.py"
+page.goto("https://demo.playwright.dev/todomvc/")
+expect(page.locator('body')).to_match_aria_snapshot('''
+ - heading "todos"
+ - textbox "What needs to be done?"
+''')
+
+```
diff --git a/documentation/docs/include/api_coverage.md b/documentation/docs/include/api_coverage.md
index dfd2d946..2f7d21ab 100644
--- a/documentation/docs/include/api_coverage.md
+++ b/documentation/docs/include/api_coverage.md
@@ -565,6 +565,7 @@
* not_to_be_visible
* not_to_contain_text
* not_to_have_accessible_description
+* not_to_have_accessible_error_message
* not_to_have_accessible_name
* not_to_have_attribute
* not_to_have_class
@@ -601,7 +602,7 @@
* to_have_text
* to_have_value
* to_have_values
-* ~~to_match_aria_snapshot#1~~
+* to_match_aria_snapshot
## PageAssertions
diff --git a/lib/playwright/locator_assertions_impl.rb b/lib/playwright/locator_assertions_impl.rb
index b92a8f85..d2e32148 100644
--- a/lib/playwright/locator_assertions_impl.rb
+++ b/lib/playwright/locator_assertions_impl.rb
@@ -188,6 +188,7 @@ def to_have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil
"Locator expected to have accessible error message"
)
end
+ _define_negation :to_have_accessible_error_message
def to_have_attribute(name, value, ignoreCase: nil, timeout: nil)
expected_text = to_expected_text_values([value], ignore_case: ignoreCase)
diff --git a/lib/playwright/version.rb b/lib/playwright/version.rb
index c7fab3ba..f8ca77d2 100644
--- a/lib/playwright/version.rb
+++ b/lib/playwright/version.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Playwright
- VERSION = '1.49.0'
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.49.0'
+ VERSION = '1.50.0'
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.50.1'
end