Skip to content
masterclass Buddy

Playwright · Matcher

toMatchAriaSnapshot

Checks a page or locator against an accessibility-tree snapshot. The snapshot describes roles, names, attributes, and nesting.

Last updated

Since
v1.49

Syntax

expect(locator).toMatchAriaSnapshot(expected)
expect(locator).toMatchAriaSnapshot(options)

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

Subscribe
  • LocatorAssertions.toMatchAriaSnapshot(options)
  • page.ariaSnapshot()
  • locator.ariaSnapshot()
  • expect.toMatchAriaSnapshot.pathTemplate
  • snapshotPathTemplate

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