40 lines
970 B
TypeScript
40 lines
970 B
TypeScript
|
|
import { devices, type PlaywrightTestConfig } from '@playwright/test';
|
||
|
|
|
||
|
|
const config: PlaywrightTestConfig = {
|
||
|
|
testDir: 'tests/playwright',
|
||
|
|
timeout: process.env.CI ? 60 * 5 * 1000 : 30 * 1000,
|
||
|
|
forbidOnly: Boolean(process.env.CI),
|
||
|
|
retries: process.env.CI ? 2 : 0,
|
||
|
|
webServer: {
|
||
|
|
command: 'npm run build:mocked && serve -l 1235 dist',
|
||
|
|
port: 1235,
|
||
|
|
timeout: 120 * 1000,
|
||
|
|
reuseExistingServer: !process.env.CI,
|
||
|
|
},
|
||
|
|
use: {
|
||
|
|
baseURL: 'http://localhost:1235/',
|
||
|
|
video: 'retain-on-failure',
|
||
|
|
trace: 'on-first-retry',
|
||
|
|
},
|
||
|
|
reporter: [['html', { outputFolder: 'playwright-report' }]],
|
||
|
|
projects: [
|
||
|
|
{
|
||
|
|
name: 'chromium',
|
||
|
|
use: { ...devices['Desktop Chrome'] },
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: 'firefox',
|
||
|
|
use: { ...devices['Desktop Firefox'] },
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: 'webkit',
|
||
|
|
use: { ...devices['Desktop Safari'] },
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: 'ios',
|
||
|
|
use: { ...devices['iPhone X'] },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
};
|
||
|
|
export default config;
|