From f7bae98539d7a8cc0c7890f0af06c1427f42cd60 Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Tue, 28 Feb 2023 17:48:16 -0800 Subject: [PATCH] dbg --- test/lib/next-test-utils.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/lib/next-test-utils.js b/test/lib/next-test-utils.js index 918fb43f23f8f3..959df6014ed825 100644 --- a/test/lib/next-test-utils.js +++ b/test/lib/next-test-utils.js @@ -667,18 +667,25 @@ export async function hasRedbox(browser, expected = true) { return false } +/*const headerDataQuery = shouldRunTurboDevTest() + ? '[data-nextjs-turbo-dialog-body]' + : '[data-nextjs-dialog-header]'*/ +const headerDataQuery = '[data-nextjs-dialog-header]' + export async function getRedboxHeader(browser) { + require('console').log('', { + t: shouldRunTurboDevTest(), + q: headerDataQuery + }) + return retry( () => evaluate(browser, () => { - const query = shouldRunTurboDevTest() ? '[data-nextjs-turbo-dialog-body]' : '[data-nextjs-dialog-header]' const portal = [].slice .call(document.querySelectorAll('nextjs-portal')) - .find((p) => - p.shadowRoot.querySelector(query) - ) + .find((p) => p.shadowRoot.querySelector(headerDataQuery)) const root = portal.shadowRoot - return root.querySelector(query).innerText + return root.querySelector(headerDataQuery).innerText }), 10000, 500,