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

Function getRedboxSource

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

Source from the content-addressed store, hash-verified

1152}
1153
1154export function getRedboxSource(browser: Playwright): Promise<string | null> {
1155 return browser.eval(() => {
1156 const portal = [].slice
1157 .call(document.querySelectorAll('nextjs-portal'))
1158 .find((p) =>
1159 p.shadowRoot.querySelector(
1160 '#nextjs__container_errors_label, #nextjs__container_errors_label'
1161 )
1162 )
1163 const root = portal.shadowRoot
1164 return (
1165 root.querySelector('[data-nextjs-codeframe], [data-nextjs-terminal]')
1166 ?.innerText ?? null
1167 )
1168 })
1169}
1170
1171export function getRedboxTitle(browser: Playwright): Promise<string | null> {
1172 return browser.eval(() => {

Calls 3

evalMethod · 0.80
callMethod · 0.80
findMethod · 0.45

Tested by 4

runTestsFunction · 0.72
runTestsFunction · 0.72
runTestsFunction · 0.72
containConflictsErrorFunction · 0.72