arrow-left Back to topicQuizNavigationsCheck yourself1.After clicking a Submit button, the app redirects to /orders/123/confirmation. What should you add after the click?await page.waitForTimeout(2000) to wait for redirectawait page.waitForURL(/\/orders\/\d+\/confirmation/) to wait for the specific URLawait page.reload() and then check the URL2.What is the default waitUntil value when you call page.goto(url) with no options?'networkidle' — waits until there are no more than 0 network connections for 500ms.'domcontentloaded' — waits only for the HTML to parse.'load' — waits for the page load event, meaning all resources have loaded.'commit' — returns immediately after the response headers are received.3.What is the difference between waitUntil: 'load' and waitUntil: 'networkidle'?They are identical — both wait for all network activity to finish.'load' waits for the browser's load event (all initial resources); 'networkidle' additionally waits until there are no open network connections for 500ms, catching late async requests.'networkidle' is faster than 'load' because it does not wait for images.'load' only applies to initial page loads; 'networkidle' works for SPAs.4.What does waitUntil: 'commit' mean in a page.goto() call?Playwright waits for all JavaScript to execute before returning.Playwright returns as soon as the response headers are received, before the HTML body is parsed.Playwright commits the current browser state to disk and then navigates.Playwright waits for the DOM to be fully interactive.5.How do you test that clicking the browser's back button restores the previous page state?await page.goto('javascript:history.back()')await page.keyboard.press('Alt+ArrowLeft')await page.goBack() — Playwright's built-in method for browser back navigation.await page.reload() — reloading simulates going back.6.A button click triggers a client-side redirect. Which is the correct way to wait for the navigation to complete?await page.click('#submit'); await page.waitForTimeout(1000);await Promise.all([page.waitForNavigation(), locator.click()]);await locator.click(); await page.waitForURL('/expected-path');await locator.click(); await page.reload();7.How do you assert that the current page URL matches /dashboard using Playwright's web-first assertions?assert(page.url() === '/dashboard')expect(page.url()).toBe('/dashboard')await expect(page).toHaveURL('/dashboard')await page.assertURL('/dashboard')8.What is the 'hydration trap' described in the article, and what is the recommended fix?The page runs out of memory during hydration. Fix: increase the browser memory limit.Playwright clicks a server-rendered element before React/Vue/Svelte has hydrated it, so the click handler doesn't exist yet and nothing happens. Fix: the app should disable interactive elements until hydration completes.The test loses its session cookie during page hydration. Fix: re-authenticate in test.beforeEach.Hydration causes a race condition in Playwright's locator engine. Fix: use --slowMo flag.Submit answersarrow-left PreviousActionsAuto-waitingNext arrow-right