-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
48 lines (42 loc) · 1.1 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
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
dotenv.config();
const getBaseUrl = () => {
switch (process.env.STAGE) {
case 'pro':
return 'https://www.mytheresa.com';
case 'test':
return 'https://test.mytheresa.com';
case 'staging':
return 'https://staging.mytheresa.com';
case 'local':
return 'https://local.mytheresa.com';
default:
throw new Error(`Unknown stage: ${process.env.STAGE}`);
}
};
export default defineConfig({
expect: {
timeout: 10 * 1000,
},
use: {
baseURL: getBaseUrl(),
headless: true,
},
projects: [
/* Test against desktop browsers */
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
reporter: [['html', { open: 'never' }]],
});