-
-
Notifications
You must be signed in to change notification settings - Fork 57
/
playwright.config.ts
77 lines (72 loc) · 2 KB
/
playwright.config.ts
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* eslint-disable n/prefer-global/process */
import * as os from 'node:os'
import type { PlaywrightTestConfig } from '@playwright/test'
import { defineConfig, devices } from '@playwright/test'
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
const headless = !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS
const webServer: PlaywrightTestConfig['webServer'] = []
if (!process.env.SKIP_BACKEND_START) {
webServer.push({
command: 'ENV=local bun run backend',
port: 54321,
timeout: 60_000,
reuseExistingServer: true,
})
}
else {
console.log('Skipping backend server')
}
webServer.push({
command: 'bun run prebuild-serve-dev',
port: 5173,
timeout: 60_000,
reuseExistingServer: true,
stdout: 'pipe',
})
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Never retry, the entire thing is stateful and retries will never succed becouse of the modifications to supabase in the previous attempt */
retries: 0,
/* Opt out of parallel tests on CI. */
workers: os.cpus().length,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['list', { printSteps: true }],
['github'],
['html', { outputFolder: './test-results/reports/playwright-html-report', open: 'never' }],
],
use: {
headless,
trace: 'on',
video: 'on',
screenshot: 'on',
// storageState: 'playwright/.auth/user1.json',
},
expect: {
/* CI/CD is VERY slow, I am sorry */
timeout: 40_000,
},
webServer,
// globalSetup: './tests/global-auth-setup',
timeout: 180 * 1000,
projects: [
{
name: 'chromium',
use: {
// storageState: 'playwright/.auth/user1.json',
...devices['Desktop Chrome'],
},
},
],
})