Skip to content

Commit

Permalink
merge test reports
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver committed Sep 16, 2023
1 parent 5f09529 commit 9f004f5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/playwright.yml
Expand Up @@ -69,9 +69,39 @@ jobs:
- name: Run Playwright tests
run: npx playwright test --shard=${{ matrix.shard }}/${{ strategy.job-total }}

- uses: actions/upload-artifact@v3
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report-${{ matrix.shard }}_${{ strategy.job-total }}
path: playwright-report
retention-days: 30
name: all-blob-reports
path: blob-report
retention-days: 1

create-report:
name: 📔 Create test report
if: always()
needs: [test]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Install dependencies
run: npm ci

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v3
with:
name: all-blob-reports
path: all-blob-reports

- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports

- name: Upload HTML report
uses: actions/upload-artifact@v3
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 7
2 changes: 1 addition & 1 deletion playwright.config.ts
Expand Up @@ -28,7 +28,7 @@ const config: PlaywrightTestConfig = {
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
reporter: process.env.CI ? 'blob' : 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
Expand Down
2 changes: 1 addition & 1 deletion tests/example.spec.ts
Expand Up @@ -295,7 +295,7 @@ test.describe('Persistence', () => {
await expect(todoItems).toHaveClass(['completed', '']);

// Ensure there is 1 completed item.
checkNumberOfCompletedTodosInLocalStorage(page, 1);
await checkNumberOfCompletedTodosInLocalStorage(page, 1);

// Now reload.
await page.reload();
Expand Down

0 comments on commit 9f004f5

Please sign in to comment.