From 8bfd63e4ba53c50ba7b12143dae26c4e993fe505 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Oct 2021 21:21:56 +0200 Subject: [PATCH] chore(create-playwright): have better config defaults (#9362) --- packages/create-playwright/assets/playwright.config.js | 6 +++--- packages/create-playwright/assets/playwright.config.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/create-playwright/assets/playwright.config.js b/packages/create-playwright/assets/playwright.config.js index 6fb2629c37..011c63d191 100644 --- a/packages/create-playwright/assets/playwright.config.js +++ b/packages/create-playwright/assets/playwright.config.js @@ -11,8 +11,8 @@ const config = { timeout: 30 * 1000, // Test directory testDir: path.join(__dirname, '{{testDir}}'), - // If a test fails, retry it additional 2 times - retries: 2, + // If a test fails on CI, retry it additional 2 times + retries: process.env.CI ? 2 : 0, // Artifacts folder where screenshots, videos, and traces are stored. outputDir: 'test-results/', @@ -26,7 +26,7 @@ const config = { use: { // Retry a test if its failing with enabled tracing. This allows you to analyse the DOM, console logs, network traffic etc. // More information: https://playwright.dev/docs/trace-viewer - trace: 'retry-with-trace', + trace: 'on-first-retry', // All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context contextOptions: { diff --git a/packages/create-playwright/assets/playwright.config.ts b/packages/create-playwright/assets/playwright.config.ts index 7fbddeec85..52ea620832 100644 --- a/packages/create-playwright/assets/playwright.config.ts +++ b/packages/create-playwright/assets/playwright.config.ts @@ -7,8 +7,8 @@ const config: PlaywrightTestConfig = { timeout: 30 * 1000, // Test directory testDir: path.join(__dirname, '{{testDir}}'), - // If a test fails, retry it additional 2 times - retries: 2, + // If a test fails on CI, retry it additional 2 times + retries: process.env.CI ? 2 : 0, // Artifacts folder where screenshots, videos, and traces are stored. outputDir: 'test-results/', @@ -22,7 +22,7 @@ const config: PlaywrightTestConfig = { use: { // Retry a test if its failing with enabled tracing. This allows you to analyse the DOM, console logs, network traffic etc. // More information: https://playwright.dev/docs/trace-viewer - trace: 'retry-with-trace', + trace: 'on-first-retry', // All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context contextOptions: {