Playwright · Junior · Question 37 of 75
How do you assert that an error message is NOT shown?
- 1
await expect(error).not.toBeVisible() - 2
await expect(error).toBeMissing() - 3
expect(error).toBeFalsy()
Show the answer
Correct answer: await expect(error).not.toBeVisible()
Explanation
.not inverts any matcher and still retries. toBeHidden() is an equivalent that passes for hidden or absent elements.