-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
Description
Bug Report: Playwright Merged Report Timeline Shows Only One Shard
Describe the bug
When merging Playwright blob reports from multiple sharded test runs, the HTML report timeline only displays one shard's execution timeline instead of showing all shards' timelines. Additionally, the Overview tab shows incorrect start time, end time, and total duration.
To Reproduce
Steps to reproduce the behavior:
-
Configure Playwright with blob reporter for CI:
// playwright.config.ts reporter: process.env.CI ? [['blob']] : reporters,
-
Run tests with sharding (e.g., 5 shards):
npx playwright test --grep '@e2esanity' --shard=1/5 npx playwright test --grep '@e2esanity' --shard=2/5 npx playwright test --grep '@e2esanity' --shard=3/5 npx playwright test --grep '@e2esanity' --shard=4/5 npx playwright test --grep '@e2esanity' --shard=5/5
-
Merge the blob reports using merge.config.ts:
npx playwright merge-reports --config merge.config.ts ./blob-reports
-
Open the merged HTML report:
npx playwright show-report playwright-report
-
Navigate to the Timeline view
-
Check the Overview tab for start/end times and duration
-
Observe that only one shard's timeline is displayed and times are incorrect
Expected behavior
- The Timeline view should display execution timelines for all 5 shards running in parallel
- The Overview tab should show:
- Start Time: Earliest start time across all shards
- End Time: Latest end time across all shards
- Duration: Time from earliest start to latest end (not sum of all shards)
- Should visualize parallel execution showing all shards running concurrently
Configuration Files
merge.config.ts
Documentation: https://playwright.dev/docs/test-sharding#merge-reports-cli
import { defineConfig } from '@playwright/test';
import { reporters } from './reporting.config';
/**
* Configuration for merging blob reports from sharded test runs
* See https://playwright.dev/docs/test-sharding#merge-reports-cli
*/
export default defineConfig({
testDir: './tests',
reporter: reporters,
});reporting.config.ts
import * as env from '@env';
import type { ReporterDescription } from '@playwright/test';
import * as os from 'os';
/**
* Centralized reporter configuration
* Used by both playwright.config.ts (local) and merge.config.ts (CI merge)
*/
export const reporters: ReporterDescription[] = [
['html', { open: process.env.CI ? 'never' : 'always' }],
['line'],
...(process.env.CI
? [
['playwright-ctrf-json-reporter'] as ReporterDescription,
['./Utilities/badgeReporter.ts'] as ReporterDescription,
]
: []),
[
'allure-playwright',
{
resultsDir: 'test-results/allure-results',
detail: true,
suiteTitle: true,
environmentInfo: {
Test_Environment: env.currentEnv,
Locale: env.locale,
Test_Tags: process.env.TEST_TAGS || '',
Test_Suite: env.suiteName,
Device: env.Device,
os_platform: os.platform(),
os_release: os.release(),
os_version: os.version(),
node_version: process.version,
},
},
],
];playwright.config.ts (reporter section)
import { reporters } from './reporting.config';
export default defineConfig({
// ... other config
reporter: process.env.CI ? [['blob']] : reporters,
// ... other config
});Commands Used
Merge Command
npx playwright merge-reports --config merge.config.ts ./blob-reportsCI Workflow (GitHub Actions)
# Run sharded tests
- name: Run Playwright tests (Shard ${{ matrix.shard }})
run: npx playwright test --grep '${{ inputs.testTags }}' --shard=${{ matrix.shard }}/${{ needs.calculate-shards.outputs.shard-count }}
# Upload blob reports
- name: Upload blob report
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shard }}
path: blob-report
retention-days: 1
# Merge all blob reports
- name: Merge blob reports
run: npx playwright merge-reports --config merge.config.ts ./all-blob-reportsScreenshots
- Timeline view displaying only one shard instead of all 5 shards
- Overview tab with incorrect start/end/duration times
- Expected: Timeline showing 5 parallel execution tracks
Environment
- OS: macOS (local) / Ubuntu (CI - GitHub Actions)
- Playwright Version: @playwright/test (latest)
- Node Version: LTS/*
- CI: GitHub Actions with self-hosted runners
- Sharding Configuration:
- 5 parallel shards (dynamic based on test count)
- 2 workers per shard
- Total parallel capacity: 10 tests
Additional Context
- All 5 shards complete successfully and generate blob reports
- Individual shard blob reports are stored in
./blob-reports/blob-report-1through./blob-reports/blob-report-5 - Merged Allure report generates successfully but timeline/timing data appears incomplete or only shows one shard
- Expected behavior: Timeline should visualize parallel shard execution similar to how CI logs show parallel job execution
Related Documentation
Reactions are currently unavailable