Skip to content
masterclass Buddy

Playwright · Matcher

toBeAttached

Checks that a Locator points to an element attached to a document or shadow root. It retries until the check passes or the assertion timeout is reached.

Last updated

Since
v1.33

Syntax

await expect(locator).toBeAttached(options?)

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

Subscribe
  • LocatorAssertions.not
  • toBeVisible
  • toBeHidden
  • expect

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