Skip to content

Commit

Permalink
chery-pick(#19507): docs: fix HTML snippets (#19508)
Browse files Browse the repository at this point in the history
This PR cherry-picks the following commits:

- ba8a6c4
  • Loading branch information
playwrightmachine committed Dec 16, 2022
1 parent 1263bc3 commit 8a9692e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/src/locators.md
Expand Up @@ -815,7 +815,7 @@ Consider the following DOM structure where we want to click on the buy button of
<h3>Product 2</h3>
<button>Add to cart</button>
</li>
<ul>
</ul>
```

### Filter by text
Expand Down Expand Up @@ -854,7 +854,7 @@ page.get_by_role("listitem").filter(has_text="Product 2").get_by_role(
await page
.GetByRole(AriaRole.Listitem)
.Filter(new() { HasText = "Product 2" })
.GetByRole(AriaRole.Button, new () { Name = "Add to cart" })
.GetByRole(AriaRole.Button, new() { Name = "Add to cart" })
.ClickAsync();
```

Expand Down Expand Up @@ -893,7 +893,7 @@ page.get_by_role("listitem").filter(has_text=re.compile("Product 2")).get_by_rol
await page
.GetByRole(AriaRole.Listitem)
.Filter(new() { HasTextRegex = new Regex("Product 2") })
.GetByRole(AriaRole.Button, new () { Name = "Add to cart" })
.GetByRole(AriaRole.Button, new() { Name = "Add to cart" })
.ClickAsync();
```

Expand Down Expand Up @@ -948,11 +948,11 @@ page.get_by_role("listitem").filter(
await page
.GetByRole(AriaRole.Listitem)
.Filter(new() {
Has = page.GetByRole(AriaRole.Heading, new () {
Has = page.GetByRole(AriaRole.Heading, new() {
Name = "Product 2"
})
})
.GetByRole(AriaRole.Button, new () { Name = "Add to cart" })
.GetByRole(AriaRole.Button, new() { Name = "Add to cart" })
.ClickAsync();
```

Expand Down Expand Up @@ -992,7 +992,7 @@ expect(
await Expect(page
.GetByRole(AriaRole.Listitem)
.Filter(new() {
Has = page.GetByRole(AriaRole.Heading, new () { Name = "Product 2" })
Has = page.GetByRole(AriaRole.Heading, new() { Name = "Product 2" })
})
.toHaveCountAsync(1);
```
Expand Down

0 comments on commit 8a9692e

Please sign in to comment.