Skip to content
masterclass Buddy

Playwright · Matcher

toBeInViewport

Playwright assertions use expect and matchers to check values or web-page state. Web-specific locator assertions retry until they pass or the assertion timeout is reached.

Last updated

Syntax

await expect(locator).toHaveText(expected, options);

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

Subscribe
  • expect
  • toHaveText
  • toBeVisible
  • toBeAttached
  • toBeChecked
  • toHaveURL
  • toHaveTitle
  • expect.poll

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