Playwright · Matcher
toHaveURL
expect(page).toHaveURL waits for the page URL to match a string, regular expression, URL pattern, or predicate. Use it to verify navigation and query parameters.
Last updated
- Since
- v1.20
Syntax
await expect(page).toHaveURL(url, options);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expectPageAssertions.notexpect.pollpage.getByRole