UNPKG

@alphabin/trx

Version:

TRX reporter for Playwright tests with Azure Blob Storage upload support

62 lines (57 loc) 1.62 kB
// @ts-check /** * Basic usage example for the TestReportX reporter in a Playwright configuration file */ /** @type {import('@playwright/test').PlaywrightTestConfig} */ const config = { testDir: './tests', /* Maximum time one test can run for. */ timeout: 30 * 1000, /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ retries: process.env.CI ? 1 : 0, /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. */ reporter: [ // Required reporters ['json', { outputFile: 'test-results/report.json' }], ['@alphabin/trx', { serverUrl: process.env.TRX_SERVER_URL || 'YOUR_TRX_SERVER_URL', apiKey: process.env.TRX_API_KEY, // Optional: Add custom tags to the run tags: ['smoke-test', process.env.CI_COMMIT_REF_SLUG] // ... see options below }], // If you want to upload media to cloud, enable HTML reporter like given below ['html', { outputDir: 'playwright-report', open: 'never' }], ], /* Configure projects for different browsers */ projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'], }, }, { name: 'firefox', use: { ...devices['Desktop Firefox'], }, }, ], /* Run your local dev server before starting the tests */ webServer: { command: 'npm run start', port: 3000, reuseExistingServer: true, }, }; module.exports = config;