docs: add the general rule to expect the opposite of the matchers (#9772)

This commit is contained in:
Kenneth Lum 2021-10-28 08:35:35 -07:00 committed by GitHub
parent 2e4722d460
commit a72930a7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 -->