57 lines
1.2 KiB
JavaScript
57 lines
1.2 KiB
JavaScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const baseURL = process.env.PLAYWRIGHT_BASE_URL || "http://127.0.0.1:4173";
|
|
const isCI = !!process.env.CI;
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e",
|
|
timeout: 60_000,
|
|
fullyParallel: true,
|
|
forbidOnly: isCI,
|
|
retries: isCI ? 2 : 0,
|
|
workers: isCI ? 2 : undefined,
|
|
reporter: [
|
|
["list"],
|
|
["html", { open: "never", outputFolder: "output/playwright/report" }]
|
|
],
|
|
outputDir: "output/playwright/test-results",
|
|
use: {
|
|
baseURL,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
video: "retain-on-failure"
|
|
},
|
|
webServer: {
|
|
command: "npm run dev -- --host 127.0.0.1 --port 4173",
|
|
port: 4173,
|
|
timeout: 120_000,
|
|
reuseExistingServer: !isCI
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium-desktop",
|
|
use: {
|
|
...devices["Desktop Chrome"]
|
|
}
|
|
},
|
|
{
|
|
name: "chromium-mobile",
|
|
use: {
|
|
...devices["Pixel 7"]
|
|
}
|
|
},
|
|
{
|
|
name: "firefox-desktop",
|
|
use: {
|
|
...devices["Desktop Firefox"]
|
|
}
|
|
},
|
|
{
|
|
name: "webkit-mobile",
|
|
use: {
|
|
...devices["iPhone 13"]
|
|
}
|
|
}
|
|
]
|
|
});
|