fix(overlay): the Overlay menu page reloads with the menu, not as a full-screen window (1.89.5)
This commit is contained in:
1 parent
d5f81f4290
commit
39eaad64ed
6 files changed
+30
-7
No files matched your search
@@ -37,7 +37,7 @@ export async function runOverlayDriverLinkSmoke({ evaluate, navigate, savedState
|
||||
console.log("PASS a click on a driver in the Overlay opens that driver's training stats");
|
||||
|
||||
// The stand-alone overlay window stays up and opens a new tab.
|
||||
await navigate("overlay", "view");
|
||||
await navigate("overlay&overlayMode=leaderboard", "view");
|
||||
await waitFor(async () => evaluate(`Boolean(${row})`), "the driver row is a link in the overlay window");
|
||||
await evaluate(`window.__opened = []; window.open = (url, target) => { window.__opened.push([url, target]); return null; }; ${row}.click()`);
|
||||
const [openedUrl, target] = (await evaluate(`window.__opened`))[0];
|
||||
|
||||
@@ -224,6 +224,20 @@ try {
|
||||
console.log("PASS decoder diagnostics update without resetting settings draft");
|
||||
await runOverlaySmoke({ evaluate });
|
||||
await runOverlayLiveMarksSmoke({ evaluate });
|
||||
// The Overlay menu page survives a reload (the page reloads itself after npm restart): it must
|
||||
// come back with the menu, not as a full-screen overlay window.
|
||||
await navigate("dashboard", "dashboardQuickPractice");
|
||||
await evaluate(`[...document.querySelectorAll(".nav-item")].find(el => el.textContent === "Overlay")?.click()`);
|
||||
await waitFor(async () => await evaluate('Boolean(document.getElementById("overlayLaunchObs"))'), "Overlay menu page");
|
||||
const overlayUrl = await evaluate("location.search");
|
||||
if (!/view=overlays\b/.test(overlayUrl)) throw new Error("Overlay menu URL: " + overlayUrl);
|
||||
for (const search of [overlayUrl, "?view=overlay"]) {
|
||||
await send("Page.navigate", { url: base + "/" + search });
|
||||
await waitFor(async () => await evaluate('Boolean(document.getElementById("overlayLaunchObs")) && Boolean(document.querySelector(".nav-item"))'), "menu page after reload of " + search);
|
||||
}
|
||||
await send("Page.navigate", { url: base + "/?view=overlay&overlayMode=leaderboard" });
|
||||
await waitFor(async () => await evaluate('!document.getElementById("overlayLaunchObs") && Boolean(document.querySelector("[data-overlay-competitor], .overlay-shell"))'), "a real overlay window stays full screen");
|
||||
console.log("PASS the Overlay menu page reloads with the menu; an overlay window link stays full screen");
|
||||
const mobileState = await savedState();
|
||||
const mobileToken = "browser-mobile-profile-token-1234567890";
|
||||
mobileState.training ||= {};
|
||||
|
||||
Reference in new issue
Block a user