From 0293c2621217359b908b77601e4fddd14c60e6f0 Mon Sep 17 00:00:00 2001 From: LongLiveY96 Date: Fri, 24 Mar 2023 22:03:48 +0800 Subject: [PATCH] docs(locators): fixed a descriptive error about Chaining Locators (#21902) --- docs/src/locators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/locators.md b/docs/src/locators.md index b1e8b778c8..76d1ba4073 100644 --- a/docs/src/locators.md +++ b/docs/src/locators.md @@ -989,7 +989,7 @@ Note that the inner locator is matched starting from the outer one, not from the You can chain methods that create a locator, like [`method: Page.getByText`] or [`method: Locator.getByRole`], to narrow down the search to a particular part of the page. -In this example we first create a locator called product by locating the test id. We then filter by text. We can use the product locator again to get by role of button and click it and then use an assertion to make sure there is only one product with the text "Product 2". +In this example we first create a locator called product by locating its role of `listitem`. We then filter by text. We can use the product locator again to get by role of button and click it and then use an assertion to make sure there is only one product with the text "Product 2". ```js const product = page.getByRole('listitem').filter({ hasText: 'Product 2' });