Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
message-circle

GitHub Action

Playwright report comment

v2.1.1

Playwright report comment

message-circle

Playwright report comment

Report Playwright test results as pull request comments

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Playwright report comment

uses: daun/[email protected]

Learn more about this action in daun/playwright-report-summary

Choose a version

report   Playwright Report Summary

GitHub Super-Linter CI

A GitHub action to report Playwright test results as a pull request comment.

  • Parse the JSON test report generated by Playwright
  • Generate a markdown summary of the test results
  • Post the summary as a pull request comment
  • Uses GitHub's official icons and color scheme

Examples

Usage

Basic usage

Playwright must be configured to generate a JSON report and write it to disk. This action receives the report file path as input, in this case results.json:

jobs:
  test:
    name: Run playwright tests
    needs: install
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v3
        with:
          node-version: 20

      - run: PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test --reporter json

      - uses: daun/playwright-report-summary@v2
        with:
          report-file: results.json

With all options

- uses: daun/playwright-report-summary@v2
  with:
    # The GitHub access token to use for API requests. Defaults to the standard GITHUB_TOKEN.
    github-token: ''

    # Path to the JSON report file generated by Playwright. Required.
    report-file: 'result.json'

    # URL to a published html report, uploaded by another action in a previous step.
    # Example pipeline: https://playwright.dev/docs/test-sharding#publishing-report-on-the-web
    report-url: 'https://user.github.io/repo/yyyy-mm-dd-id/'

    # Title/headline to use for the created pull request comment.
    # Default: Playwright test results
    comment-title: 'Results'

    # Create a job summary comment for the workflow run
    # Default: false
    job-summary: true

    # Icon style to use: octicons | emojis
    # Default: octicons
    icon-style: 'emojis'

Output

The action creates two output variables:

summary

The rendered markdown summary of the test report.

comment-id

The ID of the comment that was created or updated