docs: add the general rule to expect the opposite of the matchers (#9772)
This commit is contained in:
parent
2e4722d460
commit
a72930a7bb
|
|
@ -11,7 +11,13 @@ expect(success).toBeTruthy();
|
|||
```
|
||||
|
||||
Playwright also extends it with convenience async matchers that will wait until
|
||||
the expected condition is met.
|
||||
the expected condition is met. In general, we can expect the opposite to be true by adding a `.not` to the front
|
||||
of the matchers:
|
||||
|
||||
```js
|
||||
expect(value).not.toEqual(0);
|
||||
await expect(locator).not.toContainText("some text");
|
||||
```
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue