playwright: only add currents reporter if requisite env is set
This commit is contained in:
parent
5e7a9a3b7b
commit
94206fcac3
1 changed files with 11 additions and 6 deletions
|
|
@ -1,4 +1,13 @@
|
|||
import { defineConfig, devices } from '@playwright/test';
|
||||
import { defineConfig, devices, type ReporterDescription } from '@playwright/test';
|
||||
|
||||
const reporters: ReporterDescription[] = [
|
||||
['html'],
|
||||
['list'],
|
||||
];
|
||||
|
||||
if (process.env.CURRENTS_PROJECT_ID && process.env.CURRENTS_RECORD_KEY) {
|
||||
reporters.push(['@currents/playwright']);
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
testDir: 'playwright',
|
||||
|
|
@ -6,11 +15,7 @@ export default defineConfig({
|
|||
workers: 1,
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: process.env.CI ? 1 : 0,
|
||||
reporter: [
|
||||
['html'],
|
||||
['list'],
|
||||
['@currents/playwright'],
|
||||
],
|
||||
reporter: reporters,
|
||||
use: {
|
||||
headless: true,
|
||||
baseURL: process.env.BASE_URL ? process.env.BASE_URL : 'http://127.0.0.1:9090',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue