Files
Frost/playwright.config.mjs
T

50 lines
1.2 KiB
JavaScript

import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests/browser",
fullyParallel: true,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? "line" : [["list"], ["html", { open: "never" }]],
expect: {
timeout: 5_000,
toHaveScreenshot: {
animations: "disabled",
caret: "hide",
maxDiffPixelRatio: 0.01,
},
},
use: {
baseURL: "http://127.0.0.1:4173",
locale: "de-CH",
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "desktop-chromium",
use: {
...devices["Desktop Chrome"],
colorScheme: "light",
},
},
{
name: "mobile-chromium",
use: {
...devices["Desktop Chrome"],
viewport: { width: 390, height: 844 },
colorScheme: "light",
},
},
],
webServer: {
command: "node tests/browser/serve-example.mjs",
url: "http://127.0.0.1:4173/examples/index.html",
reuseExistingServer: !process.env.CI,
timeout: 15_000,
},
});