mirror of
https://github.com/hanzoui/workflow-templates-broken-zap-2026-06-08.git
synced 2026-10-30 20:44:35 +00:00
44 lines
900 B
TypeScript
44 lines
900 B
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
export default defineConfig({
|
|
testDir: './tests',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: [['html'], ['list']],
|
|
outputDir: 'test-results',
|
|
|
|
expect: {
|
|
toHaveScreenshot: {
|
|
maxDiffPixels: 100,
|
|
threshold: 0.2,
|
|
},
|
|
},
|
|
|
|
use: {
|
|
baseURL: 'http://localhost:4321',
|
|
trace: 'on-first-retry',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: 'desktop-chrome',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
{
|
|
name: 'mobile-chrome',
|
|
use: { ...devices['Pixel 5'] },
|
|
},
|
|
],
|
|
|
|
webServer: {
|
|
command: 'pnpm run preview',
|
|
url: 'http://localhost:4321',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120 * 1000,
|
|
},
|
|
});
|