From d829e47a043c283c2796d28dd638a57d31dd243f Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 12 Nov 2026 13:27:52 +0100 Subject: [PATCH] :wrench: Run the Playwright tests with a dark color scheme (#12989) * :wrench: Run the Playwright tests with a dark color scheme Since #12480 a profile without a theme follows the system one, and headless Chrome reports a light scheme, so the e2e tests ran with the light UI. Set colorScheme to dark in the shared Playwright options so the tests use the default dark UI again. Tests that need another scheme still set it with page.emulateMedia. AI-assisted-by: claude-opus-5-5 * :wrench: Drop the dark color scheme overrides now set for every test The shared Playwright options now set the dark color scheme, so the ds project override and the emulateMedia call in the selection size badge test do nothing. AI-assisted-by: claude-opus-5-5 --- frontend/playwright.config.js | 7 ++++--- frontend/playwright/ui/specs/workspace.spec.js | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/playwright.config.js b/frontend/playwright.config.js index a7e5496a7a..db8b9be4fc 100644 --- a/frontend/playwright.config.js +++ b/frontend/playwright.config.js @@ -48,6 +48,9 @@ export default defineConfig({ locale: "en-US", + /* Profiles without a theme follow the system one; run the UI in dark */ + colorScheme: "dark", + permissions: ["clipboard-write", "clipboard-read"], }, @@ -73,9 +76,7 @@ export default defineConfig({ }, { name: "ds", - // Accounts without a theme follow the system one; keep the visual - // specs on the dark theme so their screenshots stay comparable. - use: { ...devices["Desktop Chrome"], colorScheme: "dark" }, + use: { ...devices["Desktop Chrome"] }, testDir: "./playwright/ui/visual-specs", expect: { timeout: expectTimeout, diff --git a/frontend/playwright/ui/specs/workspace.spec.js b/frontend/playwright/ui/specs/workspace.spec.js index b59266f5eb..051530b877 100644 --- a/frontend/playwright/ui/specs/workspace.spec.js +++ b/frontend/playwright/ui/specs/workspace.spec.js @@ -107,8 +107,6 @@ test("Selection size badge appears on selection and hides on deselect", async ({ test("Selection size badge uses component color for component selection", async ({ page, }) => { - // The expected component color below is the dark palette value. - await page.emulateMedia({ colorScheme: "dark" }); const workspacePage = new WasmWorkspacePage(page); await workspacePage.setupEmptyFile(); await workspacePage.mockGetFile("components/get-file-13267.json");