mirror of
https://github.com/home-assistant/frontend.git
synced 2026-07-02 12:05:39 +01:00
e53ffd76ac
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const APP_PORT = 8095;
|
|
const APP_BASE_URL = `http://localhost:${APP_PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: ".",
|
|
testMatch: "app.spec.ts",
|
|
|
|
timeout: 60_000,
|
|
expect: { timeout: 15_000 },
|
|
|
|
retries: process.env.CI ? 1 : 0,
|
|
|
|
outputDir: "test-results",
|
|
reporter: [["list"], ["blob", { outputDir: "reports/app" }]],
|
|
|
|
use: {
|
|
baseURL: APP_BASE_URL,
|
|
trace: "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
video: "on-first-retry",
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
{
|
|
name: "mobile-chrome",
|
|
use: { ...devices["Pixel 7"] },
|
|
},
|
|
],
|
|
|
|
webServer: {
|
|
command: process.env.CI
|
|
? `npx serve test/e2e/app/dist -p ${APP_PORT} --no-clipboard -s`
|
|
: `./node_modules/.bin/gulp build-e2e-test-app && npx serve test/e2e/app/dist -p ${APP_PORT} --no-clipboard -s`,
|
|
url: APP_BASE_URL,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: process.env.CI ? 30_000 : 600_000,
|
|
cwd:
|
|
process.env.GITHUB_WORKSPACE ??
|
|
new URL("../..", import.meta.url).pathname,
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
},
|
|
});
|