mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs(python): remove await in sync code snippet (#24124)
This commit is contained in:
parent
b4ffb848de
commit
6ab6cde929
@ -1614,16 +1614,16 @@ await expect(page.locator("ul")).to_have_text(["Text 1", "Text 2", "Text 3"])
|
|||||||
from playwright.sync_api import expect
|
from playwright.sync_api import expect
|
||||||
|
|
||||||
# ✓ Has the right items in the right order
|
# ✓ Has the right items in the right order
|
||||||
await expect(page.locator("ul > li")).to_have_text(["Text 1", "Text 2", "Text 3"])
|
expect(page.locator("ul > li")).to_have_text(["Text 1", "Text 2", "Text 3"])
|
||||||
|
|
||||||
# ✖ Wrong order
|
# ✖ Wrong order
|
||||||
await expect(page.locator("ul > li")).to_have_text(["Text 3", "Text 2", "Text 1"])
|
expect(page.locator("ul > li")).to_have_text(["Text 3", "Text 2", "Text 1"])
|
||||||
|
|
||||||
# ✖ Last item does not match
|
# ✖ Last item does not match
|
||||||
await expect(page.locator("ul > li")).to_have_text(["Text 1", "Text 2", "Text"])
|
expect(page.locator("ul > li")).to_have_text(["Text 1", "Text 2", "Text"])
|
||||||
|
|
||||||
# ✖ Locator points to the outer list element, not to the list items
|
# ✖ Locator points to the outer list element, not to the list items
|
||||||
await expect(page.locator("ul")).to_have_text(["Text 1", "Text 2", "Text 3"])
|
expect(page.locator("ul")).to_have_text(["Text 1", "Text 2", "Text 3"])
|
||||||
```
|
```
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user