diff --git a/dotnet/docs/api/class-apiresponseassertions.mdx b/dotnet/docs/api/class-apiresponseassertions.mdx index acc0223240..375b06ac48 100644 --- a/dotnet/docs/api/class-apiresponseassertions.mdx +++ b/dotnet/docs/api/class-apiresponseassertions.mdx @@ -33,13 +33,11 @@ Ensures the response status code is within `200..299` range. Added in: v1.20apiResponseAssertions.Not -Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful: +Makes the assertion check for the opposite condition. **Usage** -```csharp -Expect(Response).Not -``` +For example, this code tests that the response status is not successful: **Type** - [APIResponseAssertions] diff --git a/dotnet/docs/api/class-locatorassertions.mdx b/dotnet/docs/api/class-locatorassertions.mdx index d0beb208ec..af83bbbef3 100644 --- a/dotnet/docs/api/class-locatorassertions.mdx +++ b/dotnet/docs/api/class-locatorassertions.mdx @@ -893,16 +893,14 @@ await Expect(page.Locator("body")).ToMatchAriaSnapshotAsync(@" Added in: v1.20locatorAssertions.Not -Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain text `"error"`: - -```csharp -await Expect(locator).Not.ToContainTextAsync("error"); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the Locator doesn't contain text `"error"`: + ```csharp -Expect(Locator).Not +await Expect(locator).Not.ToContainTextAsync("error"); ``` **Type** diff --git a/dotnet/docs/api/class-pageassertions.mdx b/dotnet/docs/api/class-pageassertions.mdx index 50b532f3e2..5e5bd5b6b2 100644 --- a/dotnet/docs/api/class-pageassertions.mdx +++ b/dotnet/docs/api/class-pageassertions.mdx @@ -94,16 +94,14 @@ await Expect(Page).ToHaveURLAsync(new Regex(".*checkout")); Added in: v1.20pageAssertions.Not -Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain `"error"`: - -```csharp -await Expect(Page).Not.ToHaveURLAsync("error"); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the page URL doesn't contain `"error"`: + ```csharp -Expect(Page).Not +await Expect(Page).Not.ToHaveURLAsync("error"); ``` **Type** diff --git a/dotnet/docs/api/class-request.mdx b/dotnet/docs/api/class-request.mdx index edb81d78df..85cb3ea915 100644 --- a/dotnet/docs/api/class-request.mdx +++ b/dotnet/docs/api/class-request.mdx @@ -43,6 +43,25 @@ await Request.AllHeadersAsync(); --- +### ExistingResponse {#request-existing-response} + +Added in: v1.59request.ExistingResponse + +Returns the [Response] object if the response has already been received, `null` otherwise. + +Unlike [Request.ResponseAsync()](/api/class-request.mdx#request-response), this method does not wait for the response to arrive. It returns immediately with the response object if the response has been received, or `null` if the response has not been received yet. + +**Usage** + +```csharp +Request.ExistingResponse +``` + +**Returns** +- [Response]?# + +--- + ### Failure {#request-failure} Added before v1.9request.Failure diff --git a/dotnet/docs/api/class-video.mdx b/dotnet/docs/api/class-video.mdx index 73e92d07c2..d2bf16aeb1 100644 --- a/dotnet/docs/api/class-video.mdx +++ b/dotnet/docs/api/class-video.mdx @@ -18,8 +18,7 @@ Alternatively, you can use [Video.StartAsync()](/api/class-video.mdx#video-start ```csharp await page.Video.StartAsync(); // ... perform actions ... -await page.Video.StopAsync(); -await page.Video.SaveAsAsync("video.webm"); +await page.Video.StopAsync(new() { Path = "video.webm" }); ``` @@ -118,14 +117,20 @@ await page.Video.StopAsync(new() { Path = "video.webm" }); Added in: v1.59video.StopAsync -Stops video recording started with [Video.StartAsync()](/api/class-video.mdx#video-start). Use [Video.PathAsync()](/api/class-video.mdx#video-path) or [Video.SaveAsAsync()](/api/class-video.mdx#video-save-as) methods to access the video file. +Stops video recording started with [Video.StartAsync()](/api/class-video.mdx#video-start). **Usage** ```csharp -await Video.StopAsync(); +await Video.StopAsync(options); ``` +**Arguments** +- `options` `VideoStopOptions?` *(optional)* + - `Path` [string]? *(optional)*# + + Path where the video should be saved. + **Returns** - [void]# diff --git a/java/docs/api/class-apiresponseassertions.mdx b/java/docs/api/class-apiresponseassertions.mdx index b12c477f99..e93eeb3fab 100644 --- a/java/docs/api/class-apiresponseassertions.mdx +++ b/java/docs/api/class-apiresponseassertions.mdx @@ -52,16 +52,14 @@ assertThat(response).isOK(); Added in: v1.20apiResponseAssertions.not() -Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful: - -```java -assertThat(response).not().isOK(); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the response status is not successful: + ```java -assertThat(response).not() +assertThat(response).not().isOK(); ``` **Returns** diff --git a/java/docs/api/class-locatorassertions.mdx b/java/docs/api/class-locatorassertions.mdx index 69b92aa7cf..c1ae944730 100644 --- a/java/docs/api/class-locatorassertions.mdx +++ b/java/docs/api/class-locatorassertions.mdx @@ -868,16 +868,14 @@ assertThat(page.locator("body")).matchesAriaSnapshot(""" Added in: v1.20locatorAssertions.not() -Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain text `"error"`: - -```java -assertThat(locator).not().containsText("error"); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the Locator doesn't contain text `"error"`: + ```java -assertThat(locator).not() +assertThat(locator).not().containsText("error"); ``` **Returns** diff --git a/java/docs/api/class-pageassertions.mdx b/java/docs/api/class-pageassertions.mdx index 887e0bd5fe..1712c67bb4 100644 --- a/java/docs/api/class-pageassertions.mdx +++ b/java/docs/api/class-pageassertions.mdx @@ -90,16 +90,14 @@ assertThat(page).hasURL(".com"); Added in: v1.20pageAssertions.not() -Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain `"error"`: - -```java -assertThat(page).not().hasURL("error"); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the page URL doesn't contain `"error"`: + ```java -assertThat(page).not() +assertThat(page).not().hasURL("error"); ``` **Returns** diff --git a/java/docs/api/class-request.mdx b/java/docs/api/class-request.mdx index 11d2f87c35..03e8e65fd4 100644 --- a/java/docs/api/class-request.mdx +++ b/java/docs/api/class-request.mdx @@ -43,6 +43,25 @@ Request.allHeaders(); --- +### existingResponse {#request-existing-response} + +Added in: v1.59request.existingResponse + +Returns the [Response] object if the response has already been received, `null` otherwise. + +Unlike [Request.response()](/api/class-request.mdx#request-response), this method does not wait for the response to arrive. It returns immediately with the response object if the response has been received, or `null` if the response has not been received yet. + +**Usage** + +```java +Request.existingResponse(); +``` + +**Returns** +- [null] | [Response]# + +--- + ### failure {#request-failure} Added before v1.9request.failure diff --git a/java/docs/api/class-video.mdx b/java/docs/api/class-video.mdx index 8e73e07522..2febf2a5e5 100644 --- a/java/docs/api/class-video.mdx +++ b/java/docs/api/class-video.mdx @@ -18,8 +18,7 @@ Alternatively, you can use [Video.start()](/api/class-video.mdx#video-start) and ```java page.video().start(); // ... perform actions ... -page.video().stop(); -page.video().saveAs(Paths.get("video.webm")); +page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm"))); ``` @@ -118,14 +117,21 @@ page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm"))); Added in: v1.59video.stop -Stops video recording started with [Video.start()](/api/class-video.mdx#video-start). Use [Video.path()](/api/class-video.mdx#video-path) or [Video.saveAs()](/api/class-video.mdx#video-save-as) methods to access the video file. +Stops video recording started with [Video.start()](/api/class-video.mdx#video-start). **Usage** ```java Video.stop(); +Video.stop(options); ``` +**Arguments** +- `options` `Video.StopOptions` *(optional)* + - `setPath` [Path] *(optional)*# + + Path where the video should be saved. + **Returns** - [void]# diff --git a/nodejs/docs/api/class-apiresponseassertions.mdx b/nodejs/docs/api/class-apiresponseassertions.mdx index d566f1cf19..edede3d6e0 100644 --- a/nodejs/docs/api/class-apiresponseassertions.mdx +++ b/nodejs/docs/api/class-apiresponseassertions.mdx @@ -47,16 +47,14 @@ await expect(response).toBeOK(); Added in: v1.20apiResponseAssertions.not -Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful: - -```js -await expect(response).not.toBeOK(); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the response status is not successful: + ```js -expect(response).not +await expect(response).not.toBeOK(); ``` **Type** diff --git a/nodejs/docs/api/class-genericassertions.mdx b/nodejs/docs/api/class-genericassertions.mdx index 8e2bde4fb6..b85af067bf 100644 --- a/nodejs/docs/api/class-genericassertions.mdx +++ b/nodejs/docs/api/class-genericassertions.mdx @@ -768,17 +768,15 @@ expect(() => { Added in: v1.9genericAssertions.not -Makes the assertion check for the opposite condition. For example, the following code passes: - -```js -const value = 1; -expect(value).not.toBe(2); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, the following code passes: + ```js -expect(value).not +const value = 1; +expect(value).not.toBe(2); ``` **Type** diff --git a/nodejs/docs/api/class-locatorassertions.mdx b/nodejs/docs/api/class-locatorassertions.mdx index dd756b50ca..21f76f7c97 100644 --- a/nodejs/docs/api/class-locatorassertions.mdx +++ b/nodejs/docs/api/class-locatorassertions.mdx @@ -1104,16 +1104,14 @@ await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.aria.yml' } Added in: v1.20locatorAssertions.not -Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain text `"error"`: - -```js -await expect(locator).not.toContainText('error'); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the Locator doesn't contain text `"error"`: + ```js -expect(locator).not +await expect(locator).not.toContainText('error'); ``` **Type** diff --git a/nodejs/docs/api/class-pageassertions.mdx b/nodejs/docs/api/class-pageassertions.mdx index 5e936e8235..a9b23b221a 100644 --- a/nodejs/docs/api/class-pageassertions.mdx +++ b/nodejs/docs/api/class-pageassertions.mdx @@ -260,16 +260,14 @@ await expect(page).toHaveURL(url => { Added in: v1.20pageAssertions.not -Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain `"error"`: - -```js -await expect(page).not.toHaveURL('error'); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the page URL doesn't contain `"error"`: + ```js -expect(page).not +await expect(page).not.toHaveURL('error'); ``` **Type** diff --git a/nodejs/docs/api/class-request.mdx b/nodejs/docs/api/class-request.mdx index a44b77db28..c238e30c90 100644 --- a/nodejs/docs/api/class-request.mdx +++ b/nodejs/docs/api/class-request.mdx @@ -43,6 +43,25 @@ await request.allHeaders(); --- +### existingResponse {#request-existing-response} + +Added in: v1.59request.existingResponse + +Returns the [Response] object if the response has already been received, `null` otherwise. + +Unlike [request.response()](/api/class-request.mdx#request-response), this method does not wait for the response to arrive. It returns immediately with the response object if the response has been received, or `null` if the response has not been received yet. + +**Usage** + +```js +request.existingResponse(); +``` + +**Returns** +- [null] | [Response]# + +--- + ### failure {#request-failure} Added before v1.9request.failure diff --git a/nodejs/docs/api/class-video.mdx b/nodejs/docs/api/class-video.mdx index 58bf6d9739..ecade42bdf 100644 --- a/nodejs/docs/api/class-video.mdx +++ b/nodejs/docs/api/class-video.mdx @@ -18,8 +18,7 @@ Alternatively, you can use [video.start()](/api/class-video.mdx#video-start) and ```js await page.video().start(); // ... perform actions ... -await page.video().stop(); -await page.video().saveAs('video.webm'); +await page.video().stop({ path: 'video.webm' }); ``` @@ -118,14 +117,21 @@ await page.video().stop({ path: 'video.webm' }); Added in: v1.59video.stop -Stops video recording started with [video.start()](/api/class-video.mdx#video-start). Use [video.path()](/api/class-video.mdx#video-path) or [video.saveAs()](/api/class-video.mdx#video-save-as) methods to access the video file. +Stops video recording started with [video.start()](/api/class-video.mdx#video-start). **Usage** ```js await video.stop(); +await video.stop(options); ``` +**Arguments** +- `options` [Object] *(optional)* + - `path` [string] *(optional)*# + + Path where the video should be saved. + **Returns** - [Promise]<[void]># diff --git a/nodejs/docs/debug.mdx b/nodejs/docs/debug.mdx index 3bc8504bab..891601de09 100644 --- a/nodejs/docs/debug.mdx +++ b/nodejs/docs/debug.mdx @@ -30,7 +30,7 @@ You can also edit the locators in VS Code and Playwright will show you the chang ### Picking a Locator -Pick a [locator](./locators.mdx) and copy it into your test file by clicking the **Pick locator** button form the testing sidebar. Then in the browser click the element you require and it will now show up in the **Pick locator** box in VS Code. Press 'enter' on your keyboard to copy the locator into the clipboard and then paste anywhere in your code. Or press 'escape' if you want to cancel. +Pick a [locator](./locators.mdx) and copy it into your test file by clicking the **Pick locator** button from the testing sidebar. Then in the browser click the element you require and it will now show up in the **Pick locator** box in VS Code. Press 'enter' on your keyboard to copy the locator into the clipboard and then paste anywhere in your code. Or press 'escape' if you want to cancel. Pick locators diff --git a/python/docs/api/class-request.mdx b/python/docs/api/class-request.mdx index 5dcc69043a..99b10dc859 100644 --- a/python/docs/api/class-request.mdx +++ b/python/docs/api/class-request.mdx @@ -136,6 +136,25 @@ request.sizes() ## Properties +### existing_response {#request-existing-response} + +Added in: v1.59request.existing_response + +Returns the [Response] object if the response has already been received, `null` otherwise. + +Unlike [request.response()](/api/class-request.mdx#request-response), this method does not wait for the response to arrive. It returns immediately with the response object if the response has been received, or `null` if the response has not been received yet. + +**Usage** + +```python +request.existing_response +``` + +**Returns** +- [NoneType] | [Response]# + +--- + ### failure {#request-failure} Added before v1.9request.failure diff --git a/python/docs/api/class-video.mdx b/python/docs/api/class-video.mdx index 29f55e4009..0f22d0507e 100644 --- a/python/docs/api/class-video.mdx +++ b/python/docs/api/class-video.mdx @@ -48,8 +48,7 @@ Alternatively, you can use [video.start()](/api/class-video.mdx#video-start) and ```py page.video.start() # ... perform actions ... -page.video.stop() -page.video.save_as("video.webm") +page.video.stop(path="video.webm") ``` @@ -58,8 +57,7 @@ page.video.save_as("video.webm") ```py await page.video.start() # ... perform actions ... -await page.video.stop() -await page.video.save_as("video.webm") +await page.video.stop(path="video.webm") ``` @@ -182,14 +180,20 @@ await page.video.stop(path="video.webm") Added in: v1.59video.stop -Stops video recording started with [video.start()](/api/class-video.mdx#video-start). Use [video.path()](/api/class-video.mdx#video-path) or [video.save_as()](/api/class-video.mdx#video-save-as) methods to access the video file. +Stops video recording started with [video.start()](/api/class-video.mdx#video-start). **Usage** ```python video.stop() +video.stop(**kwargs) ``` +**Arguments** +- `path` [Union]\[[str], [pathlib.Path]\] *(optional)*# + + Path where the video should be saved. + **Returns** - [NoneType]#