Hi,
In my k6 tests I needed to include 4-5 contextual variables in the generated HTML report, for example:
- environment name
- test profile
- test file or scenario name
I implemented a small local change that adds an optional summaryVars option to htmlReport(data, opts), rendered as a simple Test Context table near the top of the default HTML report.
Example usage:
htmlReport(data, {
title: 'Custom Test Report',
summaryVars: [
{ name: 'Environment', value: __ENV.ENVIRONMENT },
{ name: 'Profile', value: __ENV.PROFILE },
],
})
It seems to me that this is a fairly common scenario for tests that are data driven.
Are you interested in integrating this feature?
Hi,
In my k6 tests I needed to include 4-5 contextual variables in the generated HTML report, for example:
I implemented a small local change that adds an optional
summaryVarsoption tohtmlReport(data, opts), rendered as a simpleTest Contexttable near the top of the default HTML report.Example usage: