docs(dotnet): enable api response assertions (#16799)

This commit is contained in:
Max Schmitt 2022-08-24 17:30:47 +02:00 committed by GitHub
parent 80389c7d47
commit 9341bf12c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,5 @@
# class: APIResponseAssertions
* 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`]:
@ -50,7 +49,7 @@ def test_navigates_to_login_page(page: Page) -> None:
## property: APIResponseAssertions.not
* since: v1.20
* langs: java, js
* langs: java, js, csharp
- returns: <[APIResponseAssertions]>
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:
- alias-java: isOK
Ensures the response status code is within [200..299] range.
Ensures the response status code is within `200..299` range.
```js
await expect(response).toBeOK();

View File

@ -74,7 +74,7 @@ By default, the timeout for assertions is set to 5 seconds.
## method: PlaywrightAssertions.expectAPIResponse
* since: v1.18
* langs: js, java, python
* langs:
- alias-java: assertThat
- alias-python: expect
- alias-js: expect

View File

@ -3180,7 +3180,7 @@ interface APIResponseAssertions {
not: APIResponseAssertions;
/**
* Ensures the response status code is within [200..299] range.
* Ensures the response status code is within `200..299` range.
*
* ```js
* await expect(response).toBeOK();