Stabilize text rendering
Disable subpixel text and font hinting in Chromium so glyphs render identically across macOS, Linux, and CI.
Why text causes flaky screenshots
The fix
import { defineConfig } from "@playwright/test";
export default defineConfig({
use: {
launchOptions: {
args: ["--disable-lcd-text", "--font-render-hinting=none"],
},
},
});import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
export default defineConfig({
test: {
browser: {
enabled: true,
provider: playwright({
launchOptions: {
args: ["--disable-lcd-text", "--font-render-hinting=none"],
},
}),
instances: [{ browser: "chromium" }],
},
},
});Last updated
Was this helpful?