Skip to content

Proposal: add custom Test Context to HTML report #91

Description

@antoniogiurini

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions