docs(locator): code snippet fixes (#18884)

Follow-up on https://github.com/microsoft/playwright/pull/18839
This commit is contained in:
Max Schmitt 2022-11-17 08:41:25 -10:00 committed by GitHub
parent f7b269d9c6
commit 3ed9dab1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,7 @@ page.get_by_role("button", name="Sign in").click()
``` ```
```csharp ```csharp
await page.GetByRole(AriaRole.BUTTON, new() { NameString = "Sign in" }).ClickAsync(); await page.GetByRole(AriaRole.Button, new() { NameString = "Sign in" }).ClickAsync();
``` ```
:::tip :::tip
@ -248,7 +248,7 @@ await Expect(page
.ToBeVisibleAsync(); .ToBeVisibleAsync();
await page await page
.GetByRole(AriaRole.Ceckbox, new() { NameString = "Subscribe" }) .GetByRole(AriaRole.Checkbox, new() { NameString = "Subscribe" })
.CheckAsync(); .CheckAsync();
await page await page
@ -1023,7 +1023,7 @@ product.get_by_role("button", name="Add to cart").click()
```java ```java
Locator product = page Locator product = page
.get_by_role("listitem") .getByRole(AriaRole.LISTITEM)
.filter(new Locator.FilterOptions().setHasText("Product 2")); .filter(new Locator.FilterOptions().setHasText("Product 2"));
product product