Payment, login, form submission — after these operations an app typically redirects to a new URL. Playwright’s waitForURL method waits for the URL redirect to complete.
The pattern can be a string ('**/thanks') or a regex. The next line of code does not execute until the navigation is finished — keeping the test reliable.
page is available. Click the Pay button, then wait for the URL to contain #thanks.