Skip to content
masterclass Buddy

Playwright · Matcher

toBeHidden

toBeHidden() checks that a locator matches no DOM node or matches a non-visible element. It retries until the condition passes or the assertion timeout is reached.

Last updated

Since
v1.20

Syntax

await expect(locator).toBeHidden(options);

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Locator
  • LocatorAssertions.not
  • toBeVisible
  • toBeAttached
  • expect
  • TestConfig.expect

Source: LocatorAssertions | Playwright. Checked 2026-11-03.