@@ -277,8 +277,10 @@ jobs:
277277 strategy :
278278 fail-fast : false
279279 matrix :
280- # 3 shards per browser for balanced parallel execution
281- # (4 shards caused uneven distribution due to serial test files)
280+ # Keep three balanced shards for non-storage tests. Storage tests
281+ # have their own unsharded lane because OPFS is browser-scoped.
282+ # That lane uses one worker, so Playwright can retry only the
283+ # failed test without allowing storage tests to overlap.
282284 include :
283285 - browser : ' chromium'
284286 shard : ' 1/3'
@@ -307,6 +309,12 @@ jobs:
307309 - browser : ' webkit'
308310 shard : ' 3/3'
309311 shard_name : ' 3-of-3'
312+ - browser : ' chromium'
313+ test_group : ' storage'
314+ - browser : ' firefox'
315+ test_group : ' storage'
316+ - browser : ' webkit'
317+ test_group : ' storage'
310318 steps :
311319 - name : Free up runner disk space
312320 shell : bash
@@ -329,27 +337,27 @@ jobs:
329337 run : sudo npx playwright install ${{ matrix.browser }} --with-deps
330338 - name : Build app for E2E tests
331339 run : CORS_PROXY_URL=http://127.0.0.1:5263/cors-proxy.php? npx nx e2e:playwright:prepare-app-deploy-and-offline-mode playground-website
332- - name : Run Playwright tests - ${{ matrix.browser }}${{ matrix.shard && format(' (shard {0})', matrix.shard) || '' }}
340+ - name : Run Playwright${{ matrix.test_group && format(' {0}', matrix.test_group) || '' }} tests - ${{ matrix.browser }}${{ matrix.shard && format(' (shard {0})', matrix.shard) || '' }}
333341 run : |
334342 SHARD_ARG=""
335343 if [ -n "${{ matrix.shard }}" ]; then
336344 SHARD_ARG="--shard=${{ matrix.shard }}"
337345 fi
338346 if [ "${{ matrix.browser }}" = "firefox" ]; then
339- sudo -E HOME=/root XDG_RUNTIME_DIR=/root CI=true npx playwright test --config=packages/playground/website/playwright/playwright.ci.config.ts --project=${{ matrix.browser }} $SHARD_ARG
347+ sudo -E HOME=/root XDG_RUNTIME_DIR=/root CI=true PLAYWRIGHT_TEST_GROUP=${{ matrix.test_group || 'regular' }} npx playwright test --config=packages/playground/website/playwright/playwright.ci.config.ts --project=${{ matrix.browser }} $SHARD_ARG
340348 else
341- sudo CI=true npx playwright test --config=packages/playground/website/playwright/playwright.ci.config.ts --project=${{ matrix.browser }} $SHARD_ARG
349+ sudo CI=true PLAYWRIGHT_TEST_GROUP=${{ matrix.test_group || 'regular' }} npx playwright test --config=packages/playground/website/playwright/playwright.ci.config.ts --project=${{ matrix.browser }} $SHARD_ARG
342350 fi
343351 - uses : actions/upload-artifact@v4
344352 if : ${{ !cancelled() }}
345353 with :
346- name : playwright-report-${{ matrix.browser }}${{ matrix.shard_name && format('-shard-{0}', matrix.shard_name) || '' }}
354+ name : playwright-report-${{ matrix.browser }}${{ matrix.test_group && format('-{0}', matrix.test_group) || '' }}${{ matrix. shard_name && format('-shard-{0}', matrix.shard_name) || '' }}
347355 path : packages/playground/website/playwright-report/
348356 if-no-files-found : ignore
349357 - uses : actions/upload-artifact@v4
350358 if : ${{ !cancelled() }}
351359 with :
352- name : playwright-snapshots-${{ matrix.browser }}${{ matrix.shard_name && format('-shard-{0}', matrix.shard_name) || '' }}
360+ name : playwright-snapshots-${{ matrix.browser }}${{ matrix.test_group && format('-{0}', matrix.test_group) || '' }}${{ matrix. shard_name && format('-shard-{0}', matrix.shard_name) || '' }}
353361 path : packages/playground/website/playwright/e2e/deployment.spec.ts-snapshots/
354362 if-no-files-found : ignore
355363
0 commit comments