F
finethen
Guest
finethen Asks: Playwright: Find icon by classname in near range of a defined text
Good evening,
I would like to ask if someone knows, if it's possible in Playwright to check if an icon - under certain conditions - is visible? The conditions are:
My first idea was something like this...
...but as you can see, I miss the option to declare the icons classname
Thanks in advance and have a nice evening.
finethen
Good evening,
I would like to ask if someone knows, if it's possible in Playwright to check if an icon - under certain conditions - is visible? The conditions are:
- the icon has a specific name, but appears multiple times on the site
- it has to be in a certain range (lets say 15 pixel) of a unique text
My first idea was something like this...
Code:
await expect(page.locator('icon:near(:text("Specific text"), 15)'))
...but as you can see, I miss the option to declare the icons classname
Thanks in advance and have a nice evening.
finethen