docs(python): remove await in sync code snippet (#24124)

This commit is contained in:
Max Schmitt 2023-07-10 16:08:39 +02:00 committed by GitHub
parent b4ffb848de
commit 6ab6cde929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1614,16 +1614,16 @@ await expect(page.locator("ul")).to_have_text(["Text 1", "Text 2", "Text 3"])
from playwright.sync_api import expect
# ✓ 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
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
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
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