GitXplorerGitXplorer
s

playwright-report-action

public
5 stars
1 forks
2 issues

Commits

List of commits on branch master.
Verified
c4a59a38c93035a705f325b56026bc3b909ec7b9

Build

ssidharthv96 committed 3 years ago
Verified
fec048f923d0e846d3f0591e4e75ac2f0e9a406a

Merge branch 'master' of https://github.com/sidharthv96/playwright-report-action

ssidharthv96 committed 3 years ago
Verified
f5cd8a615509e9268b57c798219c36d97c93d9ed

feat: Group logs

ssidharthv96 committed 3 years ago
Verified
df8fe21501074831c1fbb1251d4f8f1a092456eb

Fix test (#3)

ssidharthv96 committed 3 years ago
Verified
664edfd32a7de7608c39847e43e8484b60cb37dc

Merge pull request #2 from sidharthv96/releaseTest

ssidharthv96 committed 3 years ago
Verified
0e4781d063ea4b1f9785f2cf7a164f412d38fa52

Update readme

ssidharthv96 committed 3 years ago

README

The README file for this repository.

Playwright report action 🎭

PR Comment example

A GitHub action that reports playwright test results in every pull request.

MIT License Issues

This action uses Playwright to run e2e tests, and comments it's results on pull request. Forked from jest-coverage-report-action.

Status

This action is being developed and is in Beta state. There will be bugs and inconsistencies. Please raise Issues.

Usage

  1. Install and configure Playwright.
  2. Create new action inside .github/workflows:

Minimal configuration

name: 'playwright'
on:
    pull_request:
        branches:
            - master
            - main
jobs:
    playwright:
        runs-on: ubuntu-latest
        if: "!contains(github.event.head_commit.message, '[skip ci]')"
        steps:
            - uses: actions/checkout@v1
            - uses: sidharthv96/playwright-report-action
              with:
                  github-token: ${{ secrets.GITHUB_TOKEN }}
  1. Pay attention to the action parameters. You can specify custom threshold or test script
  2. That's it!

Custom working directory

If you want to run this action in custom directory, specify working-directory:

with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    working-directory: <dir>

Customizing test script

By default, this action will run this command:

PLAYWRIGHT_JSON_OUTPUT_NAME="report.json" npx playwright test --reporter=json,line

If you're not satisfied with default behaviour, you can specify your own command, by passing custom option test-script.

⚠ IMPORTANT ⚠: Please, note that this is not simple npx playwright test script call. If you're specify your custom script, YOU SHOULD PASS SAME COVERAGE REPORTERS as it does default script (json reporter). Without those options, your action will not work.

For instance, if you want to run test:e2e npm script:

with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    test-script: npm run test:e2e

Usage with yarn

By default, this action will install your dependencies using npm. If you are using yarn, you can specify it in the package-manager option:

with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    package-manager: yarn

Use existing test report(s)

To bypass running unit tests, you can pass the filepath to the current report.json

with:
    coverage-file: ./tests/report.json
  • coverage-file is the filepath to the JSON coverage report for the current pull request.

For example, you can save every test run to an artifact and then download and reference them here.

Skipping steps

By default, this action will install dependencies and run the tests for you, generating the coverage report. Alternatively, you can skip these steps using the skip-step option.

with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    skip-step: all

Accepted values are:

  • none (default) - all steps will be run
  • install - skip installing dependencies
  • all - skip installing dependencies and running the test script

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Playwright Report action is made with <3 thanks to these wonderful people (emoji key ✨):


Artiom Tretjakovas

💻 📖 👀 🚧 🖋

Guilherme Taschetto

💻 📖

Adam Tuttle

💻

dadayama

💻

bluelovers

📖

gdelahodde-masteos

💻 📖

jlim9333

💻

Jeremy Gillick

💻 📖

Matej Zajo Kralik

💻

Sidharth Vinod

💻

Jaylen Wimbish

📖

License

MIT © Artiom Tretjakovas