|
| 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 | +dotenv_1.default.config(); |
| 18 | +// Configure reporters based on environment |
| 19 | +var reporters = process.env.CI |
| 20 | + ? [['github'], ['html', { outputFolder: 'playwright-report' }]] |
| 21 | + : [['list'], ['html', { outputFolder: 'playwright-report' }]]; |
| 22 | +/** |
| 23 | + * Playwright Test configuration for OSS (console) variant |
| 24 | + */ |
| 25 | +var config = (0, test_1.defineConfig)({ |
| 26 | + expect: { |
| 27 | + timeout: 60 * 1000, |
| 28 | + }, |
| 29 | + // Test directory specified in package.json script |
| 30 | + testMatch: '**/*.spec.ts', |
| 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 | + /* Number of parallel workers */ |
| 38 | + workers: process.env.CI ? 4 : undefined, |
| 39 | + /* Reporter to use */ |
| 40 | + reporter: reporters, |
| 41 | + /* Global setup and teardown */ |
| 42 | + globalSetup: '../shared/global-setup.mjs', |
| 43 | + globalTeardown: '../shared/global-teardown.mjs', |
| 44 | + /* Custom metadata for setup/teardown */ |
| 45 | + metadata: { |
| 46 | + variant: 'console', |
| 47 | + variantName: 'console', |
| 48 | + configFile: 'console.config.yaml', |
| 49 | + isEnterprise: false, |
| 50 | + needsShadowlink: false, |
| 51 | + }, |
| 52 | + /* Shared settings for all projects */ |
| 53 | + use: { |
| 54 | + navigationTimeout: 30 * 1000, |
| 55 | + actionTimeout: 30 * 1000, |
| 56 | + viewport: { width: 1920, height: 1080 }, |
| 57 | + headless: !!process.env.CI, |
| 58 | + /* Base URL uses variant-specific backend port */ |
| 59 | + baseURL: (_a = process.env.REACT_APP_ORIGIN) !== null && _a !== void 0 ? _a : 'http://localhost:3000', |
| 60 | + /* Collect trace when retrying the failed test */ |
| 61 | + trace: 'retain-on-failure', |
| 62 | + /* Capture screenshot on failure */ |
| 63 | + screenshot: 'only-on-failure', |
| 64 | + /* Record video on failure */ |
| 65 | + video: 'retain-on-failure', |
| 66 | + }, |
| 67 | + /* Configure projects */ |
| 68 | + projects: [ |
| 69 | + // OSS: Single project without authentication |
| 70 | + { |
| 71 | + name: 'chromium', |
| 72 | + use: __assign(__assign({}, test_1.devices['Desktop Chrome']), { permissions: ['clipboard-read', 'clipboard-write'] }), |
| 73 | + testIgnore: '**/quotas/pagination.spec.ts', |
| 74 | + }, |
| 75 | + // Isolated project for quota pagination tests (avoid RPK conflicts) |
| 76 | + { |
| 77 | + name: 'quotas-isolated', |
| 78 | + testMatch: '**/quotas/pagination.spec.ts', |
| 79 | + workers: 1, |
| 80 | + use: __assign(__assign({}, test_1.devices['Desktop Chrome']), { permissions: ['clipboard-read', 'clipboard-write'] }), |
| 81 | + }, |
| 82 | + ], |
| 83 | +}); |
| 84 | +exports.default = config; |
0 commit comments