Gathering detailed insights and metrics for @skilbourn/playwright-report-summary
Gathering detailed insights and metrics for @skilbourn/playwright-report-summary
Gathering detailed insights and metrics for @skilbourn/playwright-report-summary
Gathering detailed insights and metrics for @skilbourn/playwright-report-summary
generate a customizable text summary of your playwright test results
npm install @skilbourn/playwright-report-summary
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
15 Stars
38 Commits
4 Forks
1 Watching
1 Branches
1 Contributors
Updated on 01 Nov 2024
TypeScript (99.34%)
JavaScript (0.66%)
Cumulative downloads
Total Downloads
Last day
-3.7%
10,639
Compared to previous day
Last week
-0.6%
71,537
Compared to previous week
Last month
40.9%
304,863
Compared to previous month
Last year
1,169.3%
1,032,316
Compared to previous year
19
Small text based custom reporter for Playwright. It can be handy to publish test results for things such as an SNS message or minimal Slack update. This Tool allows you to generate smaller reports with basic info about your test run.
Run following commands:
npm install @skilbourn/playwright-report-summary --save-dev
yarn add @skilbourn/playwright-report-summary --dev
Modify your playwright.config.ts
file to include the reporter:
1 reporter: [ 2 ['@skilbourn/playwright-report-summary', { outputFile: 'custom-summary.txt' }]], 3 ['html'], // other reporters 4 ['dot'] 5 ],
The default output location will be to your root as summary.txt
Including the optional outputFile
parameter allows you to specify a custom report location.
If you do not pass an outputFile
option, then the summary will be generated to a summary.txt
file in the following format:
1Total Tests in Suite: 30, 2Total Tests Completed: 30, 3Tests Passed: 27, 4Tests Failed: 0, 5Flaky Tests: 0, 6Test run was failure free? true, 7Test Skipped: 3, 8Duration of CPU usage in ms: 75188, 9Duration of entire test run in ms: 12531, 10Average Test Duration in ms:2506.3, 11Test Suite Duration: 00:13 (mm:ss), 12Average Test Duration: 00:03 (mm:ss), 13Number of workers used for test run: 6
You may also create a custom report by leveraging the values in the stats
object. To add a custom report leveraging your stats, create a function in the format:
1import type { Stats } from '@skilbourn/playwright-report-summary'; 2 3function customReport(stats: Stats) { 4 return `Greetings, hello, ${stats.expectedResults} tests passed as expected in ${stats.formattedDurationSuite}`; 5} 6 7export default customReport;
and then modify your playwright.config.ts
file with the following:
1import type { PlaywrightTestConfig } from '@playwright/test'; 2import { devices } from '@playwright/test'; 3 4import customReport from './customReport'; 5 // Your custom report path and preferred name 6 7 8const config: PlaywrightTestConfig = { 9 ... 10 reporter: [ 11 ['@skilbourn/playwright-report-summary', { outputFile: 'custom-summary.txt', inputTemplate: customReport }]] 12 ], 13
this will generate a custom-summary.txt
file such as :
1hello, 50 tests passed as expected in 03:51 (mm:ss)
The stats
object provides information on your test suite:
Name | type | Description |
---|---|---|
testsInSuite | number | Total number of tests in suite |
totalTestsRun | number | total tests run. Retried tests can make this value larger than testsInSuite |
expectedResults | number | total test finished as expected |
unexpectedResults | number | total tests not finished as expected |
flakyTests | number | total of tests that passed when retried |
testMarkedSkipped | number | total tests marked as test.skip() or test.fixme() |
failureFree | boolean | returns true if suite completes with all test completing as expected after retries |
durationCPU | number | total milliseconds spent run tests. If tests run parallel with multiple workers, this value will be larger than the duration of running the suite |
durationSuite | number | milliseconds to complete all tests in suite |
avgTestDuration | number | average test duration of all tests in milliseconds |
formattedDurationSuite | string | duration to complete all tests in mm:ss format |
formattedAvgTestDuration | string | average test duration of all tests in mm:ss format |
failures | object | an object containing each failure in the format {[test.title: result.status]} Retries with failures will populate this with multiple entries of the same test |
workers | number | total number of workers used to run the suite |
No vulnerabilities found.
No security vulnerabilities found.