79469970

Date: 2025-02-26 13:54:50
Score: 1
Natty:
Report link

Building on @Vishal Aggarwal answer:

Testing if the element is attached to document or shadowDOM is probably a better solution than checking if the element is visible (the element can exists and not be visible, it happens quite often actually).

So, here you go:

await expect(page.locator('.somethingdoesnotexistYET')).toBeAttached()

With the docs

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Vishal
  • Low reputation (0.5):
Posted by: Er...