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