-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
61 lines (49 loc) · 1.46 KB
/
playwright.config.ts
File metadata and controls
61 lines (49 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import path from 'node:path';
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
dotenv.config({
path: path.resolve(import.meta.dirname, 'tests', '.env'),
quiet: true,
});
const ci = process.env.CI === 'true';
const baseURL = process.env.BASE_URL ?? 'https://staging.koyeb.com';
const oneClickApps = process.env.ONE_CLICK_APP !== undefined;
export default defineConfig({
testDir: './tests',
timeout: oneClickApps ? ms({ minutes: 20 }) : undefined,
globalTimeout: oneClickApps ? ms({ hours: 6 }) : ms({ minutes: 25 }),
forbidOnly: !!ci,
retries: ci && !oneClickApps ? 2 : 0,
maxFailures: oneClickApps ? 30 : undefined,
workers: 10,
reporter: ci ? [['list'], ['github']] : 'list',
grep: oneClickApps ? /one-click-apps/ : undefined,
grepInvert: oneClickApps ? undefined : /one-click-apps/,
use: {
baseURL,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
actionTimeout: 10 * 1000,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
],
});
function ms({ minutes = 0, hours = 0 }: { minutes?: number; hours?: number }) {
return (minutes * 60 + hours * 60 * 60) * 1000;
}