Playwright · Matcher
toContainText
Playwright assertions check values and web page state. Web-specific matchers retry until the expected condition passes or the assertion timeout is reached; generic matchers check immediately.
Last updated
Syntax
expect(value).matcher(expected)
await expect(locator).matcher(expected)
expect.soft(value).matcher(expected)
expect(value).not.matcher(expected)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expectexpect.pollexpect.toPassexpect.softLocatorAssertionstoHaveTexttoContainTexttoHaveTitle