k6-html-reporter
A html reporter for k6
Install
npm install k6-html-reporter --save-dev
Usage
- Install the package
- Create a js/ts file and specify the options:
const reporter = require('k6-html-reporter');
const options = {
jsonFile: <path-to-json-report>,
output: <path-to-output-directory>,
};
reporter.generateSummaryReport(options);
for typescript
import {generateSummaryReport} from 'k6-html-reporter';
const options = {
jsonFile: <path-to-json-report>,
output: <path-to-output-directory>,
};
generateSummaryReport(options);
- Run the k6 test with this command
k6 run --summary-export=<path-to-json-report> <test-script>
to output a json summary report - Run the code in step two as a node.js script after the test execution:
node xxxx.js
Sample report: