From 46f14129a3a9c4c111cd935b81900b7a9e2f8992 Mon Sep 17 00:00:00 2001 From: YusukeIwaki Date: Thu, 30 Jan 2025 00:40:07 +0900 Subject: [PATCH 01/16] Update playwright driver to 1.50.0 --- development/CLI_VERSION | 2 +- development/api.json | 1291 ++++++++++++----- development/unimplemented_examples.md | 42 + documentation/docs/api/browser.md | 2 +- documentation/docs/api/clock.md | 11 + .../docs/api/experimental/android_device.md | 2 +- documentation/docs/api/locator.md | 29 +- documentation/docs/api/locator_assertions.md | 37 +- documentation/docs/api/page.md | 2 - documentation/docs/include/api_coverage.md | 4 +- 10 files changed, 1026 insertions(+), 396 deletions(-) diff --git a/development/CLI_VERSION b/development/CLI_VERSION index 7f3a46a8..5a5c7211 100644 --- a/development/CLI_VERSION +++ b/development/CLI_VERSION @@ -1 +1 @@ -1.49.0 +1.50.0 diff --git a/development/api.json b/development/api.json index 993e4550..c1e0e0e0 100644 --- a/development/api.json +++ b/development/api.json @@ -2425,27 +2425,6 @@ "alias": "colorScheme", "overloadIndex": 0 }, - { - "kind": "property", - "langs": {}, - "since": "v1.9", - "name": "command", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional package name to launch instead of default Chrome for Android." - } - ], - "required": false, - "comment": "Optional package name to launch instead of default Chrome for Android.", - "async": false, - "alias": "command", - "overloadIndex": 0 - }, { "kind": "property", "langs": {}, @@ -2985,6 +2964,27 @@ "alias": "permissions", "overloadIndex": 0 }, + { + "kind": "property", + "langs": {}, + "since": "v1.9", + "name": "pkg", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional package name to launch instead of default Chrome for Android." + } + ], + "required": false, + "comment": "Optional package name to launch instead of default Chrome for Android.", + "async": false, + "alias": "pkg", + "overloadIndex": 0 + }, { "kind": "property", "langs": {}, @@ -16751,7 +16751,7 @@ "children": [ { "type": "text", - "text": "This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`] on any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling [`method: Browser.close`]." + "text": "This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call [`method: BrowserContext.close`] on any `BrowserContext` instances you explicitly created earlier using [`method: Browser.newContext`] **before** calling [`method: Browser.close`]." } ] }, @@ -16761,7 +16761,7 @@ } ], "required": true, - "comment": "In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if\nany were opened).\n\nIn case this browser is connected to, clears all created contexts belonging to this browser and disconnects from\nthe browser server.\n\n**NOTE** This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`]\non any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling\n[`method: Browser.close`].\n\nThe `Browser` object itself is considered to be disposed and cannot be used anymore.", + "comment": "In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if\nany were opened).\n\nIn case this browser is connected to, clears all created contexts belonging to this browser and disconnects from\nthe browser server.\n\n**NOTE** This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close\nevents, call [`method: BrowserContext.close`] on any `BrowserContext` instances you explicitly created earlier\nusing [`method: Browser.newContext`] **before** calling [`method: Browser.close`].\n\nThe `Browser` object itself is considered to be disposed and cannot be used anymore.", "async": true, "alias": "close", "overloadIndex": 0, @@ -25185,16 +25185,25 @@ "spec": [ { "type": "text", - "text": "A permission or an array of permissions to grant. Permissions can be one of the following values:" + "text": "A list of permissions to grant." }, { - "type": "li", - "text": "`'accelerometer'`", - "liType": "bullet" + "type": "note", + "noteType": "danger", + "children": [ + { + "type": "text", + "text": "Supported permissions differ between browsers, and even between different versions of the same browser. Any permission may stop working after an update." + } + ] + }, + { + "type": "text", + "text": "Here are some permissions that may be supported by some browsers:" }, { "type": "li", - "text": "`'accessibility-events'`", + "text": "`'accelerometer'`", "liType": "bullet" }, { @@ -25269,7 +25278,7 @@ } ], "required": true, - "comment": "A permission or an array of permissions to grant. Permissions can be one of the following values:\n- `'accelerometer'`\n- `'accessibility-events'`\n- `'ambient-light-sensor'`\n- `'background-sync'`\n- `'camera'`\n- `'clipboard-read'`\n- `'clipboard-write'`\n- `'geolocation'`\n- `'gyroscope'`\n- `'magnetometer'`\n- `'microphone'`\n- `'midi-sysex'` (system-exclusive midi)\n- `'midi'`\n- `'notifications'`\n- `'payment-handler'`\n- `'storage-access'`", + "comment": "A list of permissions to grant.\n\n**NOTE** Supported permissions differ between browsers, and even between different versions of the same browser.\nAny permission may stop working after an update.\n\nHere are some permissions that may be supported by some browsers:\n- `'accelerometer'`\n- `'ambient-light-sensor'`\n- `'background-sync'`\n- `'camera'`\n- `'clipboard-read'`\n- `'clipboard-write'`\n- `'geolocation'`\n- `'gyroscope'`\n- `'magnetometer'`\n- `'microphone'`\n- `'midi-sysex'` (system-exclusive midi)\n- `'midi'`\n- `'notifications'`\n- `'payment-handler'`\n- `'storage-access'`", "async": false, "alias": "permissions", "overloadIndex": 0 @@ -26583,11 +26592,11 @@ "spec": [ { "type": "text", - "text": "Maximum time in milliseconds" + "text": "Maximum time in milliseconds. Pass `0` to disable timeout." } ], "required": true, - "comment": "Maximum time in milliseconds", + "comment": "Maximum time in milliseconds. Pass `0` to disable timeout.", "async": false, "alias": "timeout", "overloadIndex": 0 @@ -29372,11 +29381,19 @@ "spec": [ { "type": "text", - "text": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." + "text": "Browser distribution channel." + }, + { + "type": "text", + "text": "Use \"chromium\" to [opt in to new headless mode](../browsers.md#chromium-new-headless-mode)." + }, + { + "type": "text", + "text": "Use \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", or \"msedge-canary\" to use branded [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." } ], "required": false, - "comment": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", + "comment": "Browser distribution channel.\n\nUse \"chromium\" to [opt in to new headless mode](../browsers.md#chromium-new-headless-mode).\n\nUse \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", or\n\"msedge-canary\" to use branded [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", "async": false, "alias": "channel", "overloadIndex": 0 @@ -30213,11 +30230,19 @@ "spec": [ { "type": "text", - "text": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." + "text": "Browser distribution channel." + }, + { + "type": "text", + "text": "Use \"chromium\" to [opt in to new headless mode](../browsers.md#chromium-new-headless-mode)." + }, + { + "type": "text", + "text": "Use \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", or \"msedge-canary\" to use branded [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." } ], "required": false, - "comment": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", + "comment": "Browser distribution channel.\n\nUse \"chromium\" to [opt in to new headless mode](../browsers.md#chromium-new-headless-mode).\n\nUse \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", or\n\"msedge-canary\" to use branded [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", "async": false, "alias": "channel", "overloadIndex": 0 @@ -32982,11 +33007,19 @@ "spec": [ { "type": "text", - "text": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." + "text": "Browser distribution channel." + }, + { + "type": "text", + "text": "Use \"chromium\" to [opt in to new headless mode](../browsers.md#chromium-new-headless-mode)." + }, + { + "type": "text", + "text": "Use \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", or \"msedge-canary\" to use branded [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." } ], "required": false, - "comment": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", + "comment": "Browser distribution channel.\n\nUse \"chromium\" to [opt in to new headless mode](../browsers.md#chromium-new-headless-mode).\n\nUse \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", or\n\"msedge-canary\" to use branded [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", "async": false, "alias": "channel", "overloadIndex": 0 @@ -34692,223 +34725,61 @@ "await page.Clock.PauseAtAsync(\"2020-02-02\");" ], "codeLang": "csharp" - } - ], - "required": true, - "comment": "Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers are fired\nunless [`method: Clock.runFor`], [`method: Clock.fastForward`], [`method: Clock.pauseAt`] or\n[`method: Clock.resume`] is called.\n\nOnly fires due timers at most once. This is equivalent to user closing the laptop lid for a while and reopening it\nat the specified time and pausing.\n\n**Usage**\n\n```js\nawait page.clock.pauseAt(new Date('2020-02-02'));\nawait page.clock.pauseAt('2020-02-02');\n```\n\n```py\nawait page.clock.pause_at(datetime.datetime(2020, 2, 2))\nawait page.clock.pause_at(\"2020-02-02\")\n```\n\n```py\npage.clock.pause_at(datetime.datetime(2020, 2, 2))\npage.clock.pause_at(\"2020-02-02\")\n```\n\n```java\nSimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd\");\npage.clock().pauseAt(format.parse(\"2020-02-02\"));\npage.clock().pauseAt(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.PauseAtAsync(DateTime.Parse(\"2020-02-02\"));\nawait page.Clock.PauseAtAsync(\"2020-02-02\");\n```\n", - "async": true, - "alias": "pauseAt", - "overloadIndex": 0, - "args": [ - { - "kind": "property", - "langs": { - "only": [ - "js", - "java" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "since": "v1.45", - "name": "time", - "type": { - "name": "", - "union": [ - { - "name": "long" - }, - { - "name": "string" - }, - { - "name": "Date" - } - ], - "expression": "[long]|[string]|[Date]" - }, - "spec": [ - { - "type": "text", - "text": "Time to pause at." - } - ], - "required": true, - "comment": "Time to pause at.", - "async": false, - "alias": "time", - "overloadIndex": 0 - }, - { - "kind": "property", - "langs": { - "only": [ - "python" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "since": "v1.45", - "name": "time", - "type": { - "name": "", - "union": [ - { - "name": "float" - }, - { - "name": "string" - }, - { - "name": "Date" - } - ], - "expression": "[float]|[string]|[Date]" - }, - "spec": [ - { - "type": "text", - "text": "Time to pause at." - } - ], - "required": true, - "comment": "Time to pause at.", - "async": false, - "alias": "time", - "overloadIndex": 0 - }, - { - "kind": "property", - "langs": { - "only": [ - "csharp" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "since": "v1.45", - "name": "time", - "type": { - "name": "", - "union": [ - { - "name": "Date" - }, - { - "name": "string" - } - ], - "expression": "[Date]|[string]" - }, - "spec": [ - { - "type": "text", - "text": "Time to pause at." - } - ], - "required": true, - "comment": "Time to pause at.", - "async": false, - "alias": "time", - "overloadIndex": 0 - } - ] - }, - { - "kind": "method", - "langs": {}, - "since": "v1.45", - "name": "resume", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual." - } - ], - "required": true, - "comment": "Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual.", - "async": true, - "alias": "resume", - "overloadIndex": 0, - "args": [] - }, - { - "kind": "method", - "langs": {}, - "since": "v1.45", - "name": "setFixedTime", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Makes `Date.now` and `new Date()` return fixed fake time at all times,↵keeps all the timers running." }, { "type": "text", - "text": "Use this method for simple scenarios where you only need to test with a predefined time. For more advanced scenarios, use [`method: Clock.install`] instead. Read docs on [clock emulation](../clock.md) to learn more." - }, - { - "type": "text", - "text": "**Usage**" + "text": "For best results, install the clock before navigating the page and set it to a time slightly before the intended test time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the page has fully loaded, you can safely use [`method: Clock.pauseAt`] to pause the clock." }, { "type": "code", "lines": [ - "await page.clock.setFixedTime(Date.now());", - "await page.clock.setFixedTime(new Date('2020-02-02'));", - "await page.clock.setFixedTime('2020-02-02');" + "// Initialize clock with some time before the test time and let the page load", + "// naturally. `Date.now` will progress as the timers fire.", + "await page.clock.install({ time: new Date('2024-12-10T08:00:00') });", + "await page.goto('http://localhost:3333');", + "await page.clock.pauseAt(new Date('2024-12-10T10:00:00'));" ], "codeLang": "js" }, { "type": "code", "lines": [ - "await page.clock.set_fixed_time(datetime.datetime.now())", - "await page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))", - "await page.clock.set_fixed_time(\"2020-02-02\")" + "# Initialize clock with some time before the test time and let the page load", + "# naturally. `Date.now` will progress as the timers fire.", + "await page.clock.install(time=datetime.datetime(2024, 12, 10, 8, 0, 0))", + "await page.goto(\"http://localhost:3333\")", + "await page.clock.pause_at(datetime.datetime(2024, 12, 10, 10, 0, 0))" ], "codeLang": "python async" }, { "type": "code", "lines": [ - "page.clock.set_fixed_time(datetime.datetime.now())", - "page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))", - "page.clock.set_fixed_time(\"2020-02-02\")" + "# Initialize clock with some time before the test time and let the page load", + "# naturally. `Date.now` will progress as the timers fire.", + "page.clock.install(time=datetime.datetime(2024, 12, 10, 8, 0, 0))", + "page.goto(\"http://localhost:3333\")", + "page.clock.pause_at(datetime.datetime(2024, 12, 10, 10, 0, 0))" ], "codeLang": "python sync" }, { "type": "code", "lines": [ - "page.clock().setFixedTime(new Date());", - "page.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));", - "page.clock().setFixedTime(\"2020-02-02\");" + "// Initialize clock with some time before the test time and let the page load", + "// naturally. `Date.now` will progress as the timers fire.", + "SimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd'T'HH:mm:ss\");", + "page.clock().install(new Clock.InstallOptions().setTime(format.parse(\"2024-12-10T08:00:00\")));", + "page.navigate(\"http://localhost:3333\");", + "page.clock().pauseAt(format.parse(\"2024-12-10T10:00:00\"));" ], "codeLang": "java" - }, - { - "type": "code", - "lines": [ - "await page.Clock.SetFixedTimeAsync(DateTime.Now);", - "await page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));", - "await page.Clock.SetFixedTimeAsync(\"2020-02-02\");" - ], - "codeLang": "csharp" } ], "required": true, - "comment": "Makes `Date.now` and `new Date()` return fixed fake time at all times, keeps all the timers running.\n\nUse this method for simple scenarios where you only need to test with a predefined time. For more advanced\nscenarios, use [`method: Clock.install`] instead. Read docs on [clock emulation](../clock.md) to learn more.\n\n**Usage**\n\n```js\nawait page.clock.setFixedTime(Date.now());\nawait page.clock.setFixedTime(new Date('2020-02-02'));\nawait page.clock.setFixedTime('2020-02-02');\n```\n\n```py\nawait page.clock.set_fixed_time(datetime.datetime.now())\nawait page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\nawait page.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```py\npage.clock.set_fixed_time(datetime.datetime.now())\npage.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\npage.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```java\npage.clock().setFixedTime(new Date());\npage.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));\npage.clock().setFixedTime(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.SetFixedTimeAsync(DateTime.Now);\nawait page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));\nawait page.Clock.SetFixedTimeAsync(\"2020-02-02\");\n```\n", + "comment": "Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers are fired\nunless [`method: Clock.runFor`], [`method: Clock.fastForward`], [`method: Clock.pauseAt`] or\n[`method: Clock.resume`] is called.\n\nOnly fires due timers at most once. This is equivalent to user closing the laptop lid for a while and reopening it\nat the specified time and pausing.\n\n**Usage**\n\n```js\nawait page.clock.pauseAt(new Date('2020-02-02'));\nawait page.clock.pauseAt('2020-02-02');\n```\n\n```py\nawait page.clock.pause_at(datetime.datetime(2020, 2, 2))\nawait page.clock.pause_at(\"2020-02-02\")\n```\n\n```py\npage.clock.pause_at(datetime.datetime(2020, 2, 2))\npage.clock.pause_at(\"2020-02-02\")\n```\n\n```java\nSimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd\");\npage.clock().pauseAt(format.parse(\"2020-02-02\"));\npage.clock().pauseAt(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.PauseAtAsync(DateTime.Parse(\"2020-02-02\"));\nawait page.Clock.PauseAtAsync(\"2020-02-02\");\n```\n\nFor best results, install the clock before navigating the page and set it to a time slightly before the intended\ntest time. This ensures that all timers run normally during page loading, preventing the page from getting stuck.\nOnce the page has fully loaded, you can safely use [`method: Clock.pauseAt`] to pause the clock.\n\n```js\n// Initialize clock with some time before the test time and let the page load\n// naturally. `Date.now` will progress as the timers fire.\nawait page.clock.install({ time: new Date('2024-12-10T08:00:00') });\nawait page.goto('http://localhost:3333');\nawait page.clock.pauseAt(new Date('2024-12-10T10:00:00'));\n```\n\n```py\n# Initialize clock with some time before the test time and let the page load\n# naturally. `Date.now` will progress as the timers fire.\nawait page.clock.install(time=datetime.datetime(2024, 12, 10, 8, 0, 0))\nawait page.goto(\"http://localhost:3333\")\nawait page.clock.pause_at(datetime.datetime(2024, 12, 10, 10, 0, 0))\n```\n\n```py\n# Initialize clock with some time before the test time and let the page load\n# naturally. `Date.now` will progress as the timers fire.\npage.clock.install(time=datetime.datetime(2024, 12, 10, 8, 0, 0))\npage.goto(\"http://localhost:3333\")\npage.clock.pause_at(datetime.datetime(2024, 12, 10, 10, 0, 0))\n```\n\n```java\n// Initialize clock with some time before the test time and let the page load\n// naturally. `Date.now` will progress as the timers fire.\nSimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd'T'HH:mm:ss\");\npage.clock().install(new Clock.InstallOptions().setTime(format.parse(\"2024-12-10T08:00:00\")));\npage.navigate(\"http://localhost:3333\");\npage.clock().pauseAt(format.parse(\"2024-12-10T10:00:00\"));\n```\n", "async": true, - "alias": "setFixedTime", + "alias": "pauseAt", "overloadIndex": 0, "args": [ { @@ -34942,11 +34813,222 @@ "spec": [ { "type": "text", - "text": "Time to be set in milliseconds." + "text": "Time to pause at." } ], "required": true, - "comment": "Time to be set in milliseconds.", + "comment": "Time to pause at.", + "async": false, + "alias": "time", + "overloadIndex": 0 + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "since": "v1.45", + "name": "time", + "type": { + "name": "", + "union": [ + { + "name": "float" + }, + { + "name": "string" + }, + { + "name": "Date" + } + ], + "expression": "[float]|[string]|[Date]" + }, + "spec": [ + { + "type": "text", + "text": "Time to pause at." + } + ], + "required": true, + "comment": "Time to pause at.", + "async": false, + "alias": "time", + "overloadIndex": 0 + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "since": "v1.45", + "name": "time", + "type": { + "name": "", + "union": [ + { + "name": "Date" + }, + { + "name": "string" + } + ], + "expression": "[Date]|[string]" + }, + "spec": [ + { + "type": "text", + "text": "Time to pause at." + } + ], + "required": true, + "comment": "Time to pause at.", + "async": false, + "alias": "time", + "overloadIndex": 0 + } + ] + }, + { + "kind": "method", + "langs": {}, + "since": "v1.45", + "name": "resume", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual." + } + ], + "required": true, + "comment": "Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual.", + "async": true, + "alias": "resume", + "overloadIndex": 0, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "since": "v1.45", + "name": "setFixedTime", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Makes `Date.now` and `new Date()` return fixed fake time at all times,↵keeps all the timers running." + }, + { + "type": "text", + "text": "Use this method for simple scenarios where you only need to test with a predefined time. For more advanced scenarios, use [`method: Clock.install`] instead. Read docs on [clock emulation](../clock.md) to learn more." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await page.clock.setFixedTime(Date.now());", + "await page.clock.setFixedTime(new Date('2020-02-02'));", + "await page.clock.setFixedTime('2020-02-02');" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "await page.clock.set_fixed_time(datetime.datetime.now())", + "await page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))", + "await page.clock.set_fixed_time(\"2020-02-02\")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "page.clock.set_fixed_time(datetime.datetime.now())", + "page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))", + "page.clock.set_fixed_time(\"2020-02-02\")" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "page.clock().setFixedTime(new Date());", + "page.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));", + "page.clock().setFixedTime(\"2020-02-02\");" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "await page.Clock.SetFixedTimeAsync(DateTime.Now);", + "await page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));", + "await page.Clock.SetFixedTimeAsync(\"2020-02-02\");" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Makes `Date.now` and `new Date()` return fixed fake time at all times, keeps all the timers running.\n\nUse this method for simple scenarios where you only need to test with a predefined time. For more advanced\nscenarios, use [`method: Clock.install`] instead. Read docs on [clock emulation](../clock.md) to learn more.\n\n**Usage**\n\n```js\nawait page.clock.setFixedTime(Date.now());\nawait page.clock.setFixedTime(new Date('2020-02-02'));\nawait page.clock.setFixedTime('2020-02-02');\n```\n\n```py\nawait page.clock.set_fixed_time(datetime.datetime.now())\nawait page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\nawait page.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```py\npage.clock.set_fixed_time(datetime.datetime.now())\npage.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\npage.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```java\npage.clock().setFixedTime(new Date());\npage.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));\npage.clock().setFixedTime(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.SetFixedTimeAsync(DateTime.Now);\nawait page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));\nawait page.Clock.SetFixedTimeAsync(\"2020-02-02\");\n```\n", + "async": true, + "alias": "setFixedTime", + "overloadIndex": 0, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "since": "v1.45", + "name": "time", + "type": { + "name": "", + "union": [ + { + "name": "long" + }, + { + "name": "string" + }, + { + "name": "Date" + } + ], + "expression": "[long]|[string]|[Date]" + }, + "spec": [ + { + "type": "text", + "text": "Time to be set in milliseconds." + } + ], + "required": true, + "comment": "Time to be set in milliseconds.", "async": false, "alias": "time", "overloadIndex": 0 @@ -63753,7 +63835,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`] 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#1`] for the corresponding assertion." }, { "type": "text", @@ -63848,7 +63930,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`] 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