1.0.28 • Published 1 year ago

playwright-e2e-coverage-report v1.0.28

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

playwright-e2e-coverage-report

Caution - not extensively tested. Share report files to help improve the solution.

Description

This package is a hacky solution to an inconvenience found.

The incovenience

Playwright end2end test report structure uses suites and specs object array and code coverage report structure uses statement, branch and function mapping. This left me unable to use places like codecov etc. to be used as e2e coverage reporting places as well.

Where did I try it ?

In a CI where playwright e2e test report is generated which then is converted into code coverage format and uploaded to codecov.

Dashboard gymnastics

Here e2e tests are thought of as function coverage and are therefore under fnMap key of the final coverage report.

In dashboards, the header and their meanings would need some mental gymnastics as they are set to code coverage formats example -

e2etestcoverage
filefile
total no of teststracked lines
passedcovered
not implementedpartial
failmissed

NOTE: Only supports playwright json reporter.


Usage

In your CI pipeline eg. github actions add a step after the one which generates playwright test report.

Place after the step that generates playwright e2e test report.

- name: Convert E2E Report to Coverage Report
  run : |
    npm install playwright-e2e-coverage-report
    wget https://raw.githubusercontent.com/MandarDevarshi/playwright-e2e-coverage-report/master/scripts/reportConverter.js	
    chmod u+x reportConverter.js
    node ./reportConverter.js

The playwright report named e2eresults.json is to be generated or made available at project root by default, i.e when checked out in a CI. To make changes to report location and name set it in the script file reportConverter.js by saving it in your repository and removing the fetching of the script in the CI job.

Useful links

1.0.22

1 year ago

1.0.21

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago