|
| 1 | +"use strict"; |
| 2 | +var __assign = (this && this.__assign) || function () { |
| 3 | + __assign = Object.assign || function(t) { |
| 4 | + for (var s, i = 1, n = arguments.length; i < n; i++) { |
| 5 | + s = arguments[i]; |
| 6 | + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) |
| 7 | + t[p] = s[p]; |
| 8 | + } |
| 9 | + return t; |
| 10 | + }; |
| 11 | + return __assign.apply(this, arguments); |
| 12 | +}; |
| 13 | +var _a; |
| 14 | +Object.defineProperty(exports, "__esModule", { value: true }); |
| 15 | +var test_1 = require("@playwright/test"); |
| 16 | +var dotenv_1 = require("dotenv"); |
| 17 | +/** |
| 18 | + * Read environment variables from file. |
| 19 | + * https://github.com/motdotla/dotenv |
| 20 | + */ |
| 21 | +// require('dotenv').config(); |
| 22 | +dotenv_1.default.config(); |
| 23 | +/** |
| 24 | + * See https://playwright.dev/docs/test-configuration. |
| 25 | + */ |
| 26 | +exports.default = (0, test_1.defineConfig)({ |
| 27 | + expect: { |
| 28 | + timeout: 60 * 1000, |
| 29 | + }, |
| 30 | + testDir: './tests', |
| 31 | + /* Run tests in files in parallel */ |
| 32 | + fullyParallel: !!process.env.CI, |
| 33 | + /* Fail the build on CI if you accidentally left test.only in the source code. */ |
| 34 | + forbidOnly: !!process.env.CI, |
| 35 | + /* Retry on CI only */ |
| 36 | + retries: process.env.CI ? 2 : 0, |
| 37 | + /* Opt out of parallel tests on CI. */ |
| 38 | + workers: process.env.CI ? 4 : undefined, |
| 39 | + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
| 40 | + reporter: 'html', |
| 41 | + /* Global setup and teardown */ |
| 42 | + globalSetup: './tests/global-setup.mjs', |
| 43 | + globalTeardown: './tests/global-teardown.mjs', |
| 44 | + /* Custom metadata for setup/teardown */ |
| 45 | + metadata: { |
| 46 | + isEnterprise: false, |
| 47 | + }, |
| 48 | + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 49 | + use: { |
| 50 | + navigationTimeout: 30 * 1000, |
| 51 | + actionTimeout: 30 * 1000, |
| 52 | + viewport: { width: 1920, height: 1080 }, |
| 53 | + headless: !!process.env.CI, |
| 54 | + /* Base URL to use in actions like `await page.goto('/')`. */ |
| 55 | + baseURL: (_a = process.env.REACT_APP_ORIGIN) !== null && _a !== void 0 ? _a : 'http://localhost:3000', |
| 56 | + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
| 57 | + trace: 'retain-on-failure', |
| 58 | + /* Capture screenshot on failure */ |
| 59 | + screenshot: 'only-on-failure', |
| 60 | + /* Record video on failure */ |
| 61 | + video: 'retain-on-failure', |
| 62 | + }, |
| 63 | + /* Configure projects for major browsers */ |
| 64 | + projects: [ |
| 65 | + { |
| 66 | + name: 'chromium', |
| 67 | + use: __assign(__assign({}, test_1.devices['Desktop Chrome']), { |
| 68 | + // Grant clipboard permissions for tests |
| 69 | + permissions: ['clipboard-read', 'clipboard-write'] }), |
| 70 | + }, |
| 71 | + ], |
| 72 | +}); |
0 commit comments