mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-23 17:52:49 +00:00
test(e2e): desktop browser-tabs hides developer toasts on its attached page
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
const HIDE_DEVELOPER_TOASTS = "#error-toast { display: none !important; }";
|
||||
|
||||
/** @param {import('@playwright/test').Page} page */
|
||||
export async function hideDeveloperToasts(page) {
|
||||
// Developer chrome must not cover app actions or move the test's pointer/focus.
|
||||
// Console errors remain in the runner's logs. Hiding the toast, instead of clicking it away,
|
||||
// leaves no race with a toast that closes or is replaced between matching and clicking.
|
||||
await page.addInitScript(() => {
|
||||
await page.addInitScript((css) => {
|
||||
const style = document.createElement("style");
|
||||
style.textContent = "#error-toast { display: none !important; }";
|
||||
style.textContent = css;
|
||||
document.addEventListener("DOMContentLoaded", () => document.head.append(style));
|
||||
});
|
||||
}, HIDE_DEVELOPER_TOASTS);
|
||||
// A page attached after it loaded (Electron over CDP) runs no init script until it navigates.
|
||||
await page.addStyleTag({ content: HIDE_DEVELOPER_TOASTS });
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { fileURLToPath } from "node:url";
|
||||
import { experimental_createMCPClient } from "ai";
|
||||
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
||||
import { chromium } from "playwright";
|
||||
import { installDeveloperToastDismissal } from "../../app/e2e/support/developer-ui.mjs";
|
||||
import { hideDeveloperToasts } from "../../app/e2e/support/developer-ui.mjs";
|
||||
import { runAppearanceFontSizeRegression } from "./appearance-font-size.electron.mjs";
|
||||
import { runSettingsMemoryRegression } from "./settings-memory.electron.mjs";
|
||||
|
||||
@@ -1189,7 +1189,7 @@ async function main() {
|
||||
|
||||
browser = await chromium.connectOverCDP(`http://127.0.0.1:${cdpPort}`);
|
||||
const page = await waitForAppPage(browser, expoPort);
|
||||
await installDeveloperToastDismissal(page);
|
||||
await hideDeveloperToasts(page);
|
||||
const status = await waitForDesktopStatus(page);
|
||||
|
||||
const checkPluginLinks = () =>
|
||||
|
||||
Reference in New Issue
Block a user