Playwright: How to check with considering URL Params
The thing is that my website redirects you to this URL:
localhost:3000/home?cityId=...
I want to just check if the first part is /home and ignore the url param. How can I do that with Playwright?
Current code which not works:
5 Replies
you could use .toContainText(), according to docs
but not for the url right?
This requires a locator to an element. I cannot use the toContainText() thing on urls
page.url() returns a string, so i don't see why not
honestly I don't know much about playwright, but from what I'm reading, .toContainText() should work fine
so
Solution
yeah, bro, nvm, thank you much for your help. I now did it like this.