mirror of
https://github.com/jeffusion/gitea-ai-assistant.git
synced 2026-03-27 10:05:50 +00:00
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { defineConfig } from '@playwright/test';
|
|
|
|
const port = Number(process.env.PW_PORT ?? 4173);
|
|
const baseURL = process.env.PW_BASE_URL ?? `http://127.0.0.1:${port}`;
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/visual',
|
|
timeout: 30_000,
|
|
forbidOnly: !!process.env.CI,
|
|
expect: {
|
|
timeout: 8_000,
|
|
toHaveScreenshot: {
|
|
animations: 'disabled',
|
|
caret: 'hide',
|
|
scale: 'css',
|
|
maxDiffPixelRatio: 0.012,
|
|
stylePath: './tests/visual/fixtures/screenshot.css',
|
|
},
|
|
},
|
|
reporter: [
|
|
['list'],
|
|
['html', { outputFolder: 'playwright-report', open: 'never' }],
|
|
],
|
|
fullyParallel: false,
|
|
use: {
|
|
baseURL,
|
|
deviceScaleFactor: 1,
|
|
hasTouch: false,
|
|
isMobile: false,
|
|
locale: 'zh-CN',
|
|
timezoneId: 'Asia/Shanghai',
|
|
viewport: { width: 1440, height: 900 },
|
|
launchOptions: {
|
|
args: [
|
|
'--disable-gpu',
|
|
'--disable-dev-shm-usage',
|
|
'--disable-lcd-text',
|
|
'--disable-font-subpixel-positioning',
|
|
'--font-render-hinting=none',
|
|
'--force-color-profile=srgb',
|
|
'--hide-scrollbars',
|
|
],
|
|
},
|
|
trace: 'retain-on-failure',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
},
|
|
webServer: process.env.PW_BASE_URL
|
|
? undefined
|
|
: {
|
|
command: `bun run dev --host 127.0.0.1 --port ${port}`,
|
|
url: baseURL,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120_000,
|
|
},
|
|
});
|