From fbd91cd3733655b5fb2b0760f3084bec346ca444 Mon Sep 17 00:00:00 2001 From: Jude Gao Date: Wed, 5 Feb 2025 20:24:48 -0500 Subject: [PATCH] fix tests --- test/lib/next-test-utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/lib/next-test-utils.ts b/test/lib/next-test-utils.ts index 11c6b929e092c..903db88acb7cd 100644 --- a/test/lib/next-test-utils.ts +++ b/test/lib/next-test-utils.ts @@ -999,7 +999,10 @@ export async function getRedboxTotalErrorCount(browser: BrowserInterface) { return parseInt(header.match(/\d+ of (\d+) issue/)?.[1], 10) } -export function getRedboxSource(browser: BrowserInterface) { +export async function getRedboxSource(browser: BrowserInterface) { + // Wait for stack frames to be available + await browser.waitForElementByCss('[data-nextjs-call-stack-frame]') + return browser.eval(() => { const portal = [].slice .call(document.querySelectorAll('nextjs-portal'))