Playwright · Matcher
toHaveTitle
expect(page).toHaveTitle() checks that a page has the expected title. It accepts an exact string or a regular expression and retries until it matches or times out.
Last updated
- Since
- v1.20
Syntax
await expect(page).toHaveTitle(titleOrRegExp, options);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expecttoHaveURLtoBeVisibletoHaveText