allure-framework / allure-framework/allure-js
Allure-playwright - Merged Report Timeline Shows Only One Shard & Time take is incorrect on overview
- Dominant language
- TypeScript
- Stars
- 281
- Forks
- 137
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 13
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:
1. **Configure Playwright with blob reporter for CI:**
```typescript
// playwright.config.ts
reporter: process.env.CI ? [['blob']] : reporters,
```
2. **Run tests with sharding (e.g., 5 shards):**
```bash
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
```
3. **Merge the blob reports using merge.config.ts:**
```bash
npx playwright merge-reports --config merge.config.ts ./blob-reports
```
4. **Open the merged HTML report:**
```bash
npx playwright show-report playwright-report
```
5. Navigate to the **Timeline** view
6. Check the **Overview** tab for start/end times and duration
7. **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
```typescript
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
```typescript
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)
```typescript
import { reporters } from './reporting.config';
export default defineConfig({
// ... other config
reporter: process.env.CI ? [['blob']] : reporters,
// ... other config
});
```
## Commands Used
### Merge Command
```bash
npx playwright merge-reports --config merge.config.ts ./blob-reports
```
### CI Workflow (GitHub Actions)
```yaml
# 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-reports
```
## Screenshots
- 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-1` through `./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
- [Playwright Test Sharding](https://playwright.dev/docs/test-sharding)
- [Merge Reports CLI](https://playwright.dev/docs/test-sharding#merge-reports-cli)
- [Blob Reporter](https://playwright.dev/docs/test-reporters#blob-reporter)
Contributor guide
Assessment
This issue has not been assessed yet.