BrauzerLab
← Back to missions 24 / 50

Wait for a URL Redirect

Medium ~180 sec

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.

TASK

Wait for the URL to change.

Provided for you
import { test, expect } from '@playwright/test';

test('Wait for a URL Redirect', async ({ page }) => {
  await page.goto('https://lab.local/mission/wait-for-url');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/wait-for-url
Loading...
Results will appear here — press Run or Check.