You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can chain methods that create a locator, like page.getByText() or 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 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".
コード例
以下のように書くと「指定の data-testid を持つ要素が、指定のテキストを持っている」という検証ができるようだ
つまり複数のlocatorを組み合わせて使えるらしい
公式
翻訳
以下の例では一時変数を使ってるが、やっていることは変わらないはず
https://playwright.dev/docs/locators#matching-inside-a-locator
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ
プロフィール・経歴
https://github.com/YumaInaura/YumaInaura
The text was updated successfully, but these errors were encountered: