Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions dotnet/docs/api/class-apiresponseassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ Ensures the response status code is within `200..299` range.

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>apiResponseAssertions.Not</x-search>

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]
Expand Down
10 changes: 4 additions & 6 deletions dotnet/docs/api/class-locatorassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -893,16 +893,14 @@ await Expect(page.Locator("body")).ToMatchAriaSnapshotAsync(@"

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>locatorAssertions.Not</x-search>

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**
Expand Down
10 changes: 4 additions & 6 deletions dotnet/docs/api/class-pageassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,14 @@ await Expect(Page).ToHaveURLAsync(new Regex(".*checkout"));

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>pageAssertions.Not</x-search>

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**
Expand Down
19 changes: 19 additions & 0 deletions dotnet/docs/api/class-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ await Request.AllHeadersAsync();

---

### ExistingResponse {#request-existing-response}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>request.ExistingResponse</x-search>

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]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-existing-response-return"/><a href="#request-existing-response-return" class="list-anchor">#</a>

---

### Failure {#request-failure}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.Failure</x-search>
Expand Down
13 changes: 9 additions & 4 deletions dotnet/docs/api/class-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
```


Expand Down Expand Up @@ -118,14 +117,20 @@ await page.Video.StopAsync(new() { Path = "video.webm" });

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>video.StopAsync</x-search>

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)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="video-stop-option-path"/><a href="#video-stop-option-path" class="list-anchor">#</a>

Path where the video should be saved.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="video-stop-return"/><a href="#video-stop-return" class="list-anchor">#</a>

Expand Down
10 changes: 4 additions & 6 deletions java/docs/api/class-apiresponseassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@ assertThat(response).isOK();

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>apiResponseAssertions.not()</x-search>

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**
Expand Down
10 changes: 4 additions & 6 deletions java/docs/api/class-locatorassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -868,16 +868,14 @@ assertThat(page.locator("body")).matchesAriaSnapshot("""

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>locatorAssertions.not()</x-search>

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**
Expand Down
10 changes: 4 additions & 6 deletions java/docs/api/class-pageassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,14 @@ assertThat(page).hasURL(".com");

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>pageAssertions.not()</x-search>

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**
Expand Down
19 changes: 19 additions & 0 deletions java/docs/api/class-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ Request.allHeaders();

---

### existingResponse {#request-existing-response}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>request.existingResponse</x-search>

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]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-existing-response-return"/><a href="#request-existing-response-return" class="list-anchor">#</a>

---

### failure {#request-failure}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.failure</x-search>
Expand Down
12 changes: 9 additions & 3 deletions java/docs/api/class-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
```


Expand Down Expand Up @@ -118,14 +117,21 @@ page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm")));

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>video.stop</x-search>

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)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="video-stop-option-path"/><a href="#video-stop-option-path" class="list-anchor">#</a>

Path where the video should be saved.

**Returns**
- [void]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="video-stop-return"/><a href="#video-stop-return" class="list-anchor">#</a>

Expand Down
10 changes: 4 additions & 6 deletions nodejs/docs/api/class-apiresponseassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ await expect(response).toBeOK();

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>apiResponseAssertions.not</x-search>

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**
Expand Down
12 changes: 5 additions & 7 deletions nodejs/docs/api/class-genericassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -768,17 +768,15 @@ expect(() => {

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.9</font><x-search>genericAssertions.not</x-search>

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**
Expand Down
10 changes: 4 additions & 6 deletions nodejs/docs/api/class-locatorassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1104,16 +1104,14 @@ await expect(page.locator('body')).toMatchAriaSnapshot({ name: 'body.aria.yml' }

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>locatorAssertions.not</x-search>

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**
Expand Down
10 changes: 4 additions & 6 deletions nodejs/docs/api/class-pageassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,14 @@ await expect(page).toHaveURL(url => {

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font><x-search>pageAssertions.not</x-search>

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**
Expand Down
19 changes: 19 additions & 0 deletions nodejs/docs/api/class-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ await request.allHeaders();

---

### existingResponse {#request-existing-response}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>request.existingResponse</x-search>

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]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="request-existing-response-return"/><a href="#request-existing-response-return" class="list-anchor">#</a>

---

### failure {#request-failure}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>request.failure</x-search>
Expand Down
12 changes: 9 additions & 3 deletions nodejs/docs/api/class-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
```


Expand Down Expand Up @@ -118,14 +117,21 @@ await page.video().stop({ path: 'video.webm' });

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59</font><x-search>video.stop</x-search>

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)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="video-stop-option-path"/><a href="#video-stop-option-path" class="list-anchor">#</a>

Path where the video should be saved.

**Returns**
- [Promise]&lt;[void]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="video-stop-return"/><a href="#video-stop-return" class="list-anchor">#</a>

Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<img width="1394" alt="Pick locators" src="https://user-images.githubusercontent.com/13063165/212741666-6479a702-2517-44a3-9eca-e719e13b379c.png" />

Expand Down
Loading