From 2d3e0fd5c95d9c7a6dee8a99379bdadb6309e15a Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 31 Jul 2026 13:02:27 +0800 Subject: [PATCH 1/3] chore(ci): use preinstalled Chrome for browser tests --- .github/workflows/ci.yaml | 4 ++-- rstest/browser-locator/rstest.config.ts | 8 ++++++++ rstest/browser-rsbuild-react/rstest.config.ts | 8 ++++++++ rstest/browser-rsbuild-vanilla/rstest.config.ts | 8 ++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 49f952078..5730e90f6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,8 +31,8 @@ jobs: - name: Install dependencies run: pnpm install - - name: Install Playwright browsers - run: pnpm --filter @rstest-example/browser-locator exec playwright install --with-deps chromium + # Browser tests launch the Chrome already available on the CI runner, + # so Playwright does not need to download Chromium. - name: Build run: node --run build diff --git a/rstest/browser-locator/rstest.config.ts b/rstest/browser-locator/rstest.config.ts index 435b0f340..28c6303dc 100644 --- a/rstest/browser-locator/rstest.config.ts +++ b/rstest/browser-locator/rstest.config.ts @@ -7,6 +7,14 @@ export default defineConfig({ enabled: true, provider: 'playwright', browser: 'chromium', + // Use the preinstalled Chrome in CI to avoid downloading Playwright's Chromium. + providerOptions: process.env.CI + ? { + launch: { + channel: 'chrome', + }, + } + : undefined, port: 3013, }, }); diff --git a/rstest/browser-rsbuild-react/rstest.config.ts b/rstest/browser-rsbuild-react/rstest.config.ts index 100ad51fe..f764f683b 100644 --- a/rstest/browser-rsbuild-react/rstest.config.ts +++ b/rstest/browser-rsbuild-react/rstest.config.ts @@ -7,6 +7,14 @@ export default defineConfig({ enabled: true, provider: 'playwright', browser: 'chromium', + // Use the preinstalled Chrome in CI to avoid downloading Playwright's Chromium. + providerOptions: process.env.CI + ? { + launch: { + channel: 'chrome', + }, + } + : undefined, port: 3012, }, }); diff --git a/rstest/browser-rsbuild-vanilla/rstest.config.ts b/rstest/browser-rsbuild-vanilla/rstest.config.ts index d94abe842..c4a88ad41 100644 --- a/rstest/browser-rsbuild-vanilla/rstest.config.ts +++ b/rstest/browser-rsbuild-vanilla/rstest.config.ts @@ -5,6 +5,14 @@ export default defineConfig({ enabled: true, provider: 'playwright', browser: 'chromium', + // Use the preinstalled Chrome in CI to avoid downloading Playwright's Chromium. + providerOptions: process.env.CI + ? { + launch: { + channel: 'chrome', + }, + } + : undefined, port: 3010, }, }); From fbd3f3d40ea56e99c93aefa023255c756c0dc8d1 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 31 Jul 2026 13:05:07 +0800 Subject: [PATCH 2/3] chore(ci): remove redundant workflow comment --- .github/workflows/ci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5730e90f6..3ff9007cd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,9 +31,6 @@ jobs: - name: Install dependencies run: pnpm install - # Browser tests launch the Chrome already available on the CI runner, - # so Playwright does not need to download Chromium. - - name: Build run: node --run build From 1d7c24c47e3fc7ce56ae2d7d36c25aad459310b3 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 31 Jul 2026 13:08:12 +0800 Subject: [PATCH 3/3] chore(ci): detect GitHub Actions explicitly --- rstest/browser-locator/rstest.config.ts | 2 +- rstest/browser-rsbuild-react/rstest.config.ts | 2 +- rstest/browser-rsbuild-vanilla/rstest.config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rstest/browser-locator/rstest.config.ts b/rstest/browser-locator/rstest.config.ts index 28c6303dc..6573dfbcc 100644 --- a/rstest/browser-locator/rstest.config.ts +++ b/rstest/browser-locator/rstest.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ provider: 'playwright', browser: 'chromium', // Use the preinstalled Chrome in CI to avoid downloading Playwright's Chromium. - providerOptions: process.env.CI + providerOptions: process.env.GITHUB_ACTIONS ? { launch: { channel: 'chrome', diff --git a/rstest/browser-rsbuild-react/rstest.config.ts b/rstest/browser-rsbuild-react/rstest.config.ts index f764f683b..50bd29139 100644 --- a/rstest/browser-rsbuild-react/rstest.config.ts +++ b/rstest/browser-rsbuild-react/rstest.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ provider: 'playwright', browser: 'chromium', // Use the preinstalled Chrome in CI to avoid downloading Playwright's Chromium. - providerOptions: process.env.CI + providerOptions: process.env.GITHUB_ACTIONS ? { launch: { channel: 'chrome', diff --git a/rstest/browser-rsbuild-vanilla/rstest.config.ts b/rstest/browser-rsbuild-vanilla/rstest.config.ts index c4a88ad41..65f8f4947 100644 --- a/rstest/browser-rsbuild-vanilla/rstest.config.ts +++ b/rstest/browser-rsbuild-vanilla/rstest.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ provider: 'playwright', browser: 'chromium', // Use the preinstalled Chrome in CI to avoid downloading Playwright's Chromium. - providerOptions: process.env.CI + providerOptions: process.env.GITHUB_ACTIONS ? { launch: { channel: 'chrome',