|
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(path.dirname("/"), '.env') }); |
10 | | - |
11 | | - |
12 | 3 | const localhost = "http://localhost:8080" |
13 | | -/** |
14 | | - * See https://playwright.dev/docs/test-configuration. |
15 | | - */ |
| 4 | + |
16 | 5 | export default defineConfig({ |
17 | 6 | testDir: './tests', |
18 | | - /* Run tests in files in parallel */ |
19 | 7 | fullyParallel: true, |
20 | | - /* Fail the build on CI if you accidentally left test.only in the source code. */ |
21 | 8 | forbidOnly: !!process.env.CI, |
22 | | - /* Retry on CI only */ |
23 | 9 | retries: process.env.CI ? 2 : 0, |
24 | | - /* Opt out of parallel tests on CI. */ |
25 | 10 | workers: process.env.CI ? 1 : undefined, |
26 | | - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
27 | 11 | reporter: [['html', { open: 'never' }]], |
28 | | - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
29 | 12 | use: { |
30 | | - /* Base URL to use in actions like `await page.goto('/')`. */ |
31 | 13 | baseURL: localhost, |
32 | | - |
33 | | - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
34 | 14 | trace: 'on-first-retry', |
35 | 15 | }, |
36 | | - |
37 | | - /* Configure projects for major browsers */ |
38 | 16 | projects: [ |
39 | 17 | { |
40 | 18 | name: 'chromium', |
41 | 19 | use: { ...devices['Desktop Chrome'] }, |
42 | 20 | }, |
43 | | - |
44 | | - { |
45 | | - name: 'firefox', |
46 | | - use: { ...devices['Desktop Firefox'] }, |
47 | | - }, |
48 | | - |
49 | | - { |
50 | | - name: 'webkit', |
51 | | - use: { ...devices['Desktop Safari'] }, |
52 | | - }, |
53 | | - |
54 | | - /* Test against mobile viewports. */ |
55 | | - // { |
56 | | - // name: 'Mobile Chrome', |
57 | | - // use: { ...devices['Pixel 5'] }, |
58 | | - // }, |
59 | | - // { |
60 | | - // name: 'Mobile Safari', |
61 | | - // use: { ...devices['iPhone 12'] }, |
62 | | - // }, |
63 | | - |
64 | | - /* Test against branded browsers. */ |
65 | | - // { |
66 | | - // name: 'Microsoft Edge', |
67 | | - // use: { ...devices['Desktop Edge'], channel: 'msedge' }, |
68 | | - // }, |
69 | | - // { |
70 | | - // name: 'Google Chrome', |
71 | | - // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, |
72 | | - // }, |
73 | 21 | ], |
74 | | - |
75 | | - /* Run your local dev server before starting the tests */ |
76 | 22 | webServer: { |
77 | 23 | command: 'npm run dev', |
78 | 24 | url: localhost, |
|
0 commit comments