🔧 Run the Playwright tests with a dark color scheme (#12989)

* 🔧 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

* 🔧 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
This commit is contained in:
Eva Marco 2026-11-12 13:27:52 +01:00 committed by GitHub
parent 88e1b29e5c
commit d829e47a04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -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,

View File

@ -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");