docs(dotnet): enable api response assertions (#16799)
This commit is contained in:
parent
80389c7d47
commit
9341bf12c6
|
|
@ -1,6 +1,5 @@
|
||||||
# class: APIResponseAssertions
|
# class: APIResponseAssertions
|
||||||
* since: v1.18
|
* since: v1.18
|
||||||
* langs: js, java, python
|
|
||||||
|
|
||||||
The [APIResponseAssertions] class provides assertion methods that can be used to make assertions about the [APIResponse] in the tests. A new instance of [APIResponseAssertions] is created by calling [`method: PlaywrightAssertions.expectAPIResponse`]:
|
The [APIResponseAssertions] class provides assertion methods that can be used to make assertions about the [APIResponse] in the tests. A new instance of [APIResponseAssertions] is created by calling [`method: PlaywrightAssertions.expectAPIResponse`]:
|
||||||
|
|
||||||
|
|
@ -50,7 +49,7 @@ def test_navigates_to_login_page(page: Page) -> None:
|
||||||
|
|
||||||
## property: APIResponseAssertions.not
|
## property: APIResponseAssertions.not
|
||||||
* since: v1.20
|
* since: v1.20
|
||||||
* langs: java, js
|
* langs: java, js, csharp
|
||||||
- returns: <[APIResponseAssertions]>
|
- returns: <[APIResponseAssertions]>
|
||||||
|
|
||||||
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. For example, this code tests that the response status is not successful:
|
||||||
|
|
@ -74,7 +73,7 @@ The opposite of [`method: APIResponseAssertions.toBeOK`].
|
||||||
* langs:
|
* langs:
|
||||||
- alias-java: isOK
|
- alias-java: isOK
|
||||||
|
|
||||||
Ensures the response status code is within [200..299] range.
|
Ensures the response status code is within `200..299` range.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
await expect(response).toBeOK();
|
await expect(response).toBeOK();
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ By default, the timeout for assertions is set to 5 seconds.
|
||||||
|
|
||||||
## method: PlaywrightAssertions.expectAPIResponse
|
## method: PlaywrightAssertions.expectAPIResponse
|
||||||
* since: v1.18
|
* since: v1.18
|
||||||
* langs: js, java, python
|
* langs:
|
||||||
- alias-java: assertThat
|
- alias-java: assertThat
|
||||||
- alias-python: expect
|
- alias-python: expect
|
||||||
- alias-js: expect
|
- alias-js: expect
|
||||||
|
|
|
||||||
2
packages/playwright-test/types/test.d.ts
vendored
2
packages/playwright-test/types/test.d.ts
vendored
|
|
@ -3180,7 +3180,7 @@ interface APIResponseAssertions {
|
||||||
not: APIResponseAssertions;
|
not: APIResponseAssertions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensures the response status code is within [200..299] range.
|
* Ensures the response status code is within `200..299` range.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* await expect(response).toBeOK();
|
* await expect(response).toBeOK();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue