|
| 1 | +/* eslint-disable no-undef */ |
| 2 | +// playwright.config.js |
| 3 | +// @ts-check |
| 4 | + |
| 5 | +// eslint-disable-next-line no-unused-vars |
| 6 | +const { devices } = require('@playwright/test'); |
| 7 | +const MAX_FAILURES = 5; |
| 8 | +const NUM_WORKERS = 2; |
| 9 | + |
| 10 | +/** @type {import('@playwright/test').PlaywrightTestConfig} */ |
| 11 | +const config = { |
| 12 | + retries: 0, //Retries 2 times for a total of 3 runs. When running sharded and with max-failures=5, this should ensure that flake is managed without failing the full suite |
| 13 | + testDir: 'tests', |
| 14 | + timeout: 60 * 1000, |
| 15 | + webServer: { |
| 16 | + command: 'npm run start', //Start in dev mode for hot reloading |
| 17 | + url: 'http://localhost:8080/#', |
| 18 | + timeout: 200 * 1000, |
| 19 | + reuseExistingServer: true //This was originally disabled to prevent differences in local debugging vs. CI. However, it significantly speeds up local debugging. |
| 20 | + }, |
| 21 | + maxFailures: MAX_FAILURES, //Limits failures to 5 to reduce CI Waste |
| 22 | + workers: NUM_WORKERS, //Limit to 2 for CircleCI Agent |
| 23 | + use: { |
| 24 | + baseURL: 'http://localhost:8080/', |
| 25 | + headless: true, |
| 26 | + ignoreHTTPSErrors: true, |
| 27 | + screenshot: 'only-on-failure', |
| 28 | + trace: 'on-first-retry', |
| 29 | + video: 'off' |
| 30 | + }, |
| 31 | + projects: [ |
| 32 | + { |
| 33 | + name: 'chrome', |
| 34 | + testMatch: '**/*.spec.js', // run all tests |
| 35 | + use: { |
| 36 | + browserName: 'chromium' |
| 37 | + } |
| 38 | + } |
| 39 | + ], |
| 40 | + reporter: [ |
| 41 | + ['list'], |
| 42 | + [ |
| 43 | + 'html', |
| 44 | + { |
| 45 | + open: 'never', |
| 46 | + outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840 |
| 47 | + } |
| 48 | + ], |
| 49 | + ['junit', { outputFile: '../test-results/results.xml' }], |
| 50 | + ['@deploysentinel/playwright'] |
| 51 | + ] |
| 52 | +}; |
| 53 | + |
| 54 | +module.exports = config; |
0 commit comments