|
1 | 1 | import { defineConfig, devices } from '@playwright/test' |
2 | 2 |
|
3 | | -/** |
4 | | - * Read environment variables from file. |
5 | | - * https://github.com/motdotla/dotenv |
6 | | - */ |
7 | | -// import dotenv from 'dotenv'; |
8 | | -// import path from 'path'; |
9 | | -// dotenv.config({ path: path.resolve(__dirname, '.env') }); |
10 | | - |
11 | | -/** |
12 | | - * See https://playwright.dev/docs/test-configuration. |
13 | | - */ |
14 | 3 | export default defineConfig({ |
15 | 4 | testDir: './src/tests', |
16 | 5 | testIgnore: ['**.test.ts'], |
17 | 6 | fullyParallel: true, |
18 | 7 | forbidOnly: Boolean(process.env.CI), |
19 | 8 | retries: process.env.CI ? 2 : 0, |
20 | | - /* Opt out of parallel tests on CI. */ |
21 | 9 | workers: process.env.CI ? 1 : undefined, |
22 | 10 | reporter: 'html', |
23 | 11 | use: { |
24 | 12 | baseURL: 'http://localhost:3000', |
25 | 13 | trace: 'on-first-retry', |
26 | 14 | }, |
27 | | - |
28 | | - /* Configure projects for major browsers */ |
29 | | - projects: [ |
30 | | - { |
31 | | - name: 'chromium', |
32 | | - use: { ...devices['Desktop Chrome'] }, |
33 | | - }, |
34 | | - |
35 | | - { |
36 | | - name: 'firefox', |
37 | | - use: { ...devices['Desktop Firefox'] }, |
38 | | - }, |
39 | | - |
40 | | - { |
41 | | - name: 'webkit', |
42 | | - use: { ...devices['Desktop Safari'] }, |
43 | | - }, |
44 | | - |
45 | | - /* Test against mobile viewports. */ |
46 | | - // { |
47 | | - // name: 'Mobile Chrome', |
48 | | - // use: { ...devices['Pixel 5'] }, |
49 | | - // }, |
50 | | - // { |
51 | | - // name: 'Mobile Safari', |
52 | | - // use: { ...devices['iPhone 12'] }, |
53 | | - // }, |
54 | | - |
55 | | - /* Test against branded browsers. */ |
56 | | - // { |
57 | | - // name: 'Microsoft Edge', |
58 | | - // use: { ...devices['Desktop Edge'], channel: 'msedge' }, |
59 | | - // }, |
60 | | - // { |
61 | | - // name: 'Google Chrome', |
62 | | - // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, |
63 | | - // }, |
64 | | - ], |
65 | | - |
66 | | - /* Run your local dev server before starting the tests */ |
| 15 | + projects: process.env.CI |
| 16 | + ? [ |
| 17 | + { |
| 18 | + name: 'firefox', |
| 19 | + use: { ...devices['Desktop Firefox'] }, |
| 20 | + }, |
| 21 | + ] |
| 22 | + : [ |
| 23 | + { |
| 24 | + name: 'chromium', |
| 25 | + use: { ...devices['Desktop Chrome'] }, |
| 26 | + }, |
| 27 | + { |
| 28 | + name: 'firefox', |
| 29 | + use: { ...devices['Desktop Firefox'] }, |
| 30 | + }, |
| 31 | + { |
| 32 | + name: 'webkit', |
| 33 | + use: { ...devices['Desktop Safari'] }, |
| 34 | + }, |
| 35 | + ], |
67 | 36 | webServer: { |
68 | 37 | command: process.env.CI ? 'npm run start' : 'npm run dev', |
69 | 38 | url: 'http://localhost:3000', |
|
0 commit comments