Use toHaveUrl function when you want to check that page's url is equal to the expected url
example
awaitexpect(page).toHaveUrl('https://example.com/');// also you can wait for the urlawaitexpect(page).toHaveUrl('https://example.com/', {timeout:5000})
Use
toHaveUrl
function when you want to check that page's url is equal to the expected url