-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
66 lines (63 loc) · 2.03 KB
/
playwright.config.ts
File metadata and controls
66 lines (63 loc) · 2.03 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
62
63
64
65
66
import {defineConfig, devices} from '@playwright/test';
import dotenv from 'dotenv';
import path from 'path';
import {USER_SETS} from './playwright/test-data';
dotenv.config({path: path.resolve(__dirname, '.env')});
const dummyAudioPath = path.resolve(__dirname, './playwright/wav/dummyAudio.wav');
export default defineConfig({
testDir: './playwright',
timeout: 220000,
webServer: {
command: 'yarn workspace samples-cc-react-app serve',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
},
retries: 0,
fullyParallel: true,
workers: Object.keys(USER_SETS).length, // Dynamic worker count based on USER_SETS
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
trace: 'retain-on-failure',
},
projects: [
{
name: 'OAuth: Get Access Token',
testMatch: /global\.setup\.ts/,
},
// Dynamically generate test projects from USER_SETS
...Object.entries(USER_SETS).map(([setName, setData], index) => {
return {
name: setName,
dependencies: ['OAuth: Get Access Token'],
fullyParallel: false,
retries: 1,
testMatch: [`**/suites/${setData.TEST_SUITE}`],
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
storageState: undefined,
launchOptions: {
args: [
`--disable-site-isolation-trials`,
`--disable-web-security`,
`--no-sandbox`,
`--disable-features=WebRtcHideLocalIpsWithMdns`,
`--allow-file-access-from-files`,
`--use-fake-ui-for-media-stream`,
`--use-fake-device-for-media-stream`,
`--use-file-for-fake-audio-capture=${dummyAudioPath}`,
`--remote-debugging-port=${9221 + index}`,
`--disable-extensions`,
`--disable-plugins`,
`--window-position=${index * 1300},0`,
`--window-size=1280,720`,
],
},
},
};
}),
],
});