40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { defineConfig } from "@playwright/test";
|
|
import { phoneViewport } from "./dimensions";
|
|
const externalBaseUrl = process.env["DEMO_BASE_URL"];
|
|
const productionUrl = "http://127.0.0.1:4175";
|
|
|
|
export default defineConfig({
|
|
...(externalBaseUrl
|
|
? {}
|
|
: {
|
|
webServer: {
|
|
command: "pnpm build && pnpm exec vp preview --host 127.0.0.1 --port 4175",
|
|
url: productionUrl,
|
|
timeout: 180000,
|
|
reuseExistingServer: false,
|
|
},
|
|
}),
|
|
testDir: ".",
|
|
testMatch: "viewport.spec.ts",
|
|
workers: 1,
|
|
timeout: 480000,
|
|
outputDir: "../../reports/viewport-demo/recordings",
|
|
use: {
|
|
actionTimeout: 12000,
|
|
baseURL: externalBaseUrl ?? productionUrl,
|
|
viewport: phoneViewport,
|
|
deviceScaleFactor: 1,
|
|
hasTouch: true,
|
|
reducedMotion: "no-preference",
|
|
launchOptions: {
|
|
headless: false,
|
|
args: [
|
|
"--enable-unsafe-webgpu",
|
|
"--use-angle=metal",
|
|
"--disable-background-timer-throttling",
|
|
"--disable-backgrounding-occluded-windows",
|
|
"--disable-renderer-backgrounding",
|
|
],
|
|
},
|
|
},
|
|
});
|