Skip to content

ci: render Playwright results as a GitHub Step Summary - #94

Merged
kzamanbd merged 1 commit into
developfrom
ci/e2e-report-summary
Jun 29, 2026
Merged

ci: render Playwright results as a GitHub Step Summary#94
kzamanbd merged 1 commit into
developfrom
ci/e2e-report-summary

Conversation

@dev-shahed

@dev-shahed dev-shahed commented Jun 26, 2026

Copy link
Copy Markdown
Member

Add a CI-only json reporter and .github/scripts/pw-summary.js that writes a pass/fail table plus the failing-test list to the workflow run summary page. No production code touched.

Summary by CodeRabbit

  • New Features
    • Added a clear test summary to GitHub Actions, showing pass/fail counts, duration, and failing tests in an easy-to-read format.
  • Bug Fixes
    • Improved reporting so test results are still summarized even when the report is missing or cannot be parsed.
  • Chores
    • Updated CI test output handling to generate the data needed for the summary view.

Add a CI-only json reporter and .github/scripts/pw-summary.js that writes a
pass/fail table plus the failing-test list to the workflow run summary page.
No production code touched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 85db5a83-c67a-47bf-8aff-18a81dc018e4

📥 Commits

Reviewing files that changed from the base of the PR and between 5d20bb9 and 3dab690.

📒 Files selected for processing (4)
  • .github/scripts/pw-summary.js
  • .github/workflows/e2e.yml
  • .gitignore
  • playwright.config.ts

📝 Walkthrough

Walkthrough

The e2e pipeline now emits a Playwright JSON report, ignores the generated results file, and adds a GitHub Actions step that converts the report into a step-summary table with failing tests.

Changes

Playwright e2e summary flow

Layer / File(s) Summary
JSON report output
playwright.config.ts, .gitignore
Playwright CI adds a JSON reporter that writes tests/e2e/results.json, and the generated file is ignored by git.
Script setup
.github/scripts/pw-summary.js
The summary script defines the report path, version fallback, and output target, and adds a helper for appending Markdown to $GITHUB_STEP_SUMMARY or stdout.
Report parsing
.github/scripts/pw-summary.js
The script reads the JSON report when present, extracts stats, computes duration, and walks nested suites to collect failing specs.
Summary rendering
.github/scripts/pw-summary.js
The script builds the summary table, adds a failing-tests details block, includes the attached HTML report note, and catches report read or parse errors without rethrowing.
Workflow publish step
.github/workflows/e2e.yml
The e2e workflow runs the summary script in a non-cancelled job with WP_VERSION passed from the matrix.

Sequence Diagram(s)

sequenceDiagram
  participant PlaywrightConfig as playwright.config.ts
  participant ResultsJson as tests/e2e/results.json
  participant SummaryScript as .github/scripts/pw-summary.js
  participant StepSummary as GITHUB_STEP_SUMMARY
  PlaywrightConfig->>ResultsJson: write JSON reporter output
  SummaryScript->>ResultsJson: read report stats and suites
  SummaryScript->>StepSummary: append Markdown summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through reports with a twitchy nose,
Found JSON carrots in neat little rows.
I tucked the failures in a summary snug,
Then left a warm note in the GitHub snug.
Hop hop hooray, the tests tell their tale!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: rendering Playwright results in the GitHub Actions step summary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/e2e-report-summary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kzamanbd
kzamanbd merged commit ea4c8d6 into develop Jun 29, 2026
3 checks passed
@kzamanbd
kzamanbd deleted the ci/e2e-report-summary branch June 29, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants