mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: add a toHaveClass hint (#11249)
This commit is contained in:
parent
f0269e7144
commit
303d49e8de
@ -543,7 +543,7 @@ expect(locator).to_contain_text("substring")
|
|||||||
expect(locator).to_contain_text(re.compile(r"\d messages"))
|
expect(locator).to_contain_text(re.compile(r"\d messages"))
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if array is passed as an expected value, entire lists can be asserted:
|
Note that if array is passed as an expected value, entire lists of elements can be asserted:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const locator = page.locator('list > .list-item');
|
const locator = page.locator('list > .list-item');
|
||||||
@ -660,7 +660,7 @@ locator = page.locator("#component")
|
|||||||
expect(locator).to_have_class(re.compile(r"selected"))
|
expect(locator).to_have_class(re.compile(r"selected"))
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if array is passed as an expected value, entire lists can be asserted:
|
Note that if array is passed as an expected value, entire lists of elements can be asserted:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const locator = page.locator('list > .component');
|
const locator = page.locator('list > .component');
|
||||||
@ -891,7 +891,7 @@ expect(locator).to_have_text(re.compile(r"Welcome, Test User"))
|
|||||||
expect(locator).to_have_text(re.compile(r"Welcome, .*"))
|
expect(locator).to_have_text(re.compile(r"Welcome, .*"))
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if array is passed as an expected value, entire lists can be asserted:
|
Note that if array is passed as an expected value, entire lists of elements can be asserted:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const locator = page.locator('list > .component');
|
const locator = page.locator('list > .component');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user