// A
expect(await page.getByText("Welcome").isVisible()).toBe(true);
// B
await expect(page.getByText("Welcome")).toBeVisible();
A checks visibility once at that instant; B retries until the element is visible or the timeout passes
A checks visibility once, at that instant. B retries until the element is visible or the timeout passes. isVisible() returns the current state at once, without waiting. The generic toBe can't retry either. Web-first matchers on a locator, like toBeVisible, keep polling. This handles elements that appear after a network request or an animation. The option saying B is flaky too is wrong, because B retries.
Read more
- Assertions (https://playwright.dev/docs/test-assertions)playwright.dev