1- import { defineConfig , devices } from ' @playwright/test' ;
2- import ' dotenv/config' ;
1+ import { defineConfig , devices } from " @playwright/test" ;
2+ import " dotenv/config" ;
33
44/**
55 * Read environment variables from file.
@@ -11,78 +11,80 @@ import 'dotenv/config';
1111 * See https://playwright.dev/docs/test-configuration.
1212 */
1313export default defineConfig ( {
14- testDir : './tests' ,
15- /* Run tests in files in parallel */
16- fullyParallel : true ,
17- /* Fail the build on CI if you accidentally left test.only in the source code. */
18- forbidOnly : ! ! process . env . CI ,
19- /* Retry on CI only */
20- retries : process . env . CI ? 2 : 0 ,
21- /* Opt out of parallel tests on CI. */
22- workers : process . env . CI ? 1 : undefined ,
23- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
24- reporter : 'html' ,
25- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
26- use : {
27- /* Base URL to use in actions like `await page.goto('/')`. */
28- baseURL : process . env . APP_BASE_URL ,
29- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30- trace : 'on-first-retry' ,
31- } ,
32-
33- /* Configure projects for major browsers */
34- projects : process . env . CI ? [
35- {
36- name : 'chromium' ,
37- use : { ...devices [ 'Desktop Chrome' ] } ,
14+ testDir : "./tests" ,
15+ /* Run tests in files in parallel */
16+ fullyParallel : true ,
17+ /* Fail the build on CI if you accidentally left test.only in the source code. */
18+ forbidOnly : ! ! process . env . CI ,
19+ /* Retry on CI only */
20+ retries : process . env . CI ? 2 : 0 ,
21+ /* Opt out of parallel tests on CI. */
22+ workers : process . env . CI ? 1 : undefined ,
23+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
24+ reporter : "html" ,
25+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
26+ use : {
27+ /* Base URL to use in actions like `await page.goto('/')`. */
28+ baseURL : process . env . APP_BASE_URL ,
29+ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30+ trace : "on-first-retry" ,
3831 } ,
3932
40- {
41- name : 'firefox' ,
42- use : { ...devices [ 'Desktop Firefox' ] } ,
43- } ,
33+ /* Configure projects for major browsers */
34+ projects : process . env . CI
35+ ? [
36+ {
37+ name : "chromium" ,
38+ use : { ...devices [ "Desktop Chrome" ] } ,
39+ } ,
4440
45- {
46- name : 'webkit' ,
47- use : { ...devices [ ' Desktop Safari' ] } ,
48- } ,
41+ {
42+ name : "firefox" ,
43+ use : { ...devices [ " Desktop Firefox" ] } ,
44+ } ,
4945
50- /* Test against mobile viewports. */
51- // {
52- // name: 'Mobile Chrome',
53- // use: { ...devices['Pixel 5'] },
54- // },
55- // {
56- // name: 'Mobile Safari',
57- // use: { ...devices['iPhone 12'] },
58- // },
46+ {
47+ name : "webkit" ,
48+ use : { ...devices [ "Desktop Safari" ] } ,
49+ } ,
5950
60- /* Test against branded browsers. */
61- // {
62- // name: 'Microsoft Edge',
63- // use: { ...devices['Desktop Edge'], channel: 'msedge' },
64- // },
65- // {
66- // name: 'Google Chrome',
67- // use: { ...devices['Desktop Chrome'], channel: 'chrome' },
68- // },
69- ] : [
70- // NOTE: WebKit is only supported on Debian and Ubuntu in Playwright.
71- {
72- name : 'chromium' ,
73- use : { ...devices [ 'Desktop Chrome' ] } ,
74- } ,
51+ /* Test against mobile viewports. */
52+ // {
53+ // name: 'Mobile Chrome',
54+ // use: { ...devices['Pixel 5'] },
55+ // },
56+ // {
57+ // name: 'Mobile Safari',
58+ // use: { ...devices['iPhone 12'] },
59+ // },
7560
76- {
77- name : 'firefox' ,
78- use : { ...devices [ 'Desktop Firefox' ] } ,
79- } ,
80- ] ,
61+ /* Test against branded browsers. */
62+ // {
63+ // name: 'Microsoft Edge',
64+ // use: { ...devices['Desktop Edge'], channel: 'msedge' },
65+ // },
66+ // {
67+ // name: 'Google Chrome',
68+ // use: { ...devices['Desktop Chrome'], channel: 'chrome' },
69+ // },
70+ ]
71+ : [
72+ // NOTE: WebKit is only supported on Debian and Ubuntu in Playwright.
73+ {
74+ name : "chromium" ,
75+ use : { ...devices [ "Desktop Chrome" ] } ,
76+ } ,
8177
82- /* Run your local dev server before starting the tests */
83- // webServer: {
84- // command: 'npm run start',
85- // url: 'http://127.0.0.1:3000',
86- // reuseExistingServer: !process.env.CI,
87- // },
78+ {
79+ name : "firefox" ,
80+ use : { ...devices [ "Desktop Firefox" ] } ,
81+ } ,
82+ ] ,
83+
84+ /* Run your local dev server before starting the tests */
85+ // webServer: {
86+ // command: 'npm run start',
87+ // url: 'http://127.0.0.1:3000',
88+ // reuseExistingServer: !process.env.CI,
89+ // },
8890} ) ;
0 commit comments