MCPcopy
hub / github.com/vercel/next.js / waitForRedbox

Function waitForRedbox

test/lib/next-test-utils.ts:881–902  ·  view source on GitHub ↗
(browser: Playwright)

Source from the content-addressed store, hash-verified

879}
880
881export async function waitForRedbox(browser: Playwright) {
882 const redbox = browser.locateRedbox()
883 try {
884 await redbox.waitFor({ timeout: 5000 })
885 } catch (errorCause) {
886 const error = new Error('Expected Redbox but found no visible one.')
887 Error.captureStackTrace(error, waitForRedbox)
888 throw error
889 }
890
891 try {
892 await redbox
893 .locator('[data-nextjs-error-suspended]')
894 .waitFor({ state: 'detached', timeout: 10000 })
895 } catch (cause) {
896 const error = new Error('Redbox still had suspended content after 10s', {
897 cause,
898 })
899 Error.captureStackTrace(error, waitForRedbox)
900 throw error
901 }
902}
903
904export async function waitForNoRedbox(
905 browser: Playwright,

Callers 15

runTestsFunction · 0.90
runTestsFunction · 0.90
runTestsFunction · 0.90
index.test.tsFile · 0.90
showsErrorFunction · 0.90
index.test.tsFile · 0.90
runTestsFunction · 0.90
runTestsFunction · 0.90
index.test.tsFile · 0.90
runTestsFunction · 0.90
runTestsFunction · 0.90
runTestsFunction · 0.90

Calls 3

locateRedboxMethod · 0.80
waitForMethod · 0.80
locatorMethod · 0.80

Tested by 15

runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
showsErrorFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72