-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
🚀 Feature Request
I have a locator:
page.getByText('Waiting for response...', { exact: true });
And playwright points to multiple locators on screen, one visible locator and other invisible ones.
I only want the visible one, and my workaround is to use the following locator:
page.locator('div:has-text("Waiting for response..."):visible');
Please note that: If I remove the part :visible, this locator will behave the same as my first example using getByText()
So, is it possible to add an additional option within getByText() and other getBy locator methods for visible locator?
Maybe something like:
page.getByText('Waiting for response...', { visible: true });
Example
No response
Motivation
I believe having the visible option will give us more flexibility when creating any getBy locators.