Skip to content

Commit e4f902e

Browse files
authored
chore(CI): speed up playwright browser setup (#3223)
1 parent 47392b9 commit e4f902e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/test-Windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484

8585
- name: E2E Test
8686
if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
87-
run: pnpm playwright install --with-deps chromium && pnpm run test:e2e
87+
run: pnpm run test:e2e
8888

8989
- name: Upload Playwright Report
9090
uses: actions/upload-artifact@v6

.github/workflows/test-macOS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: E2E Test
8080
if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
81-
run: pnpm playwright install --with-deps chromium && pnpm run test:e2e
81+
run: pnpm run test:e2e
8282

8383
- name: Upload Playwright Report
8484
uses: actions/upload-artifact@v6

playwright.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { defineConfig } from '@playwright/test';
22

3+
const isCI = Boolean(process.env.CI);
4+
35
export default defineConfig({
46
// exclude webpack / rspack self-feature test cases when run rspack / webpack test
57
testDir: './e2e',
@@ -10,9 +12,11 @@ export default defineConfig({
1012
quiet: true,
1113
reporter: 'list',
1214
use: {
13-
trace: 'on',
14-
video: 'on',
15+
trace: isCI ? 'on-first-retry' : 'on',
16+
video: isCI ? 'off' : 'on',
1517
viewport: { width: 1440, height: 900 }, // screen size
18+
// Use the built-in Chrome browser to speed up CI tests
19+
channel: isCI ? 'chrome' : undefined,
1620
},
17-
retries: process.env.CI ? 3 : 0,
21+
retries: isCI ? 3 : 0,
1822
});

0 commit comments

Comments
 (0)