Skip to content

Free open-source image editor for the browser

Run browser tests on the GPU on Linux (#95)

Rodrigo Belfiore8627080635b2
diff --git a/playwright.config.ts b/playwright.config.ts
index b96ad57..a3ffb8d 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -2,13 +2,13 @@ import { defineConfig } from "@playwright/test";
const args = ["--enable-unsafe-webgpu"];
const features = ["WebMCP"];
-if (process.platform !== "darwin") {
+if (process.platform === "win32") {
args.push("--use-webgpu-adapter=swiftshader");
}
if (process.platform === "linux") {
- // Vulkan enables image transfers; ANGLE's SwiftShader path presents canvases in headless Chromium.
+ // ANGLE on Vulkan gives headless Chromium the machine's GPU for WebGPU and canvases.
features.push("Vulkan");
- args.push("--use-angle=swiftshader", "--use-vulkan=swiftshader");
+ args.push("--use-angle=vulkan");
}
args.push(`--enable-features=${features.join(",")}`);
diff --git a/tests/editing.e2e.ts b/tests/editing.e2e.ts
index b33beef..8aa0279 100644
--- a/tests/editing.e2e.ts
+++ b/tests/editing.e2e.ts
@@ -7,6 +7,7 @@ import { box, choose, drag, zoom } from "./pointer";
test("edit a photo, inspect the preview and histograms, undo changes, and export", async ({
page,
}) => {
+ test.setTimeout(90_000);
const state = () => page.evaluate(() => window.openlight.getState());
await openPhoto(page);
const canvas = page
@@ -291,11 +292,12 @@ test("edit a photo, inspect the preview and histograms, undo changes, and export
// A neutral mask receives the same pixels, counted only where it covers them.
await expect(plot).toHaveAttribute("points", /,\d{1,2}\./);
await expect(plot).not.toHaveAttribute("points", whole);
+ const neutral = (await plot.getAttribute("points")) ?? "";
await page.evaluate(
(mask) => window.openlight.setAdjustments({ exposure: 1 }, mask),
mask,
);
- await expect(plot).toHaveAttribute("points", /,\d{1,2}\./);
+ await expect(plot).not.toHaveAttribute("points", neutral);
const points = (await plot.getAttribute("points")) ?? "";
await page
.getByRole("button", { name: "Show Curve input mask", exact: true })