cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.01k stars 1.09k forks source link

Adding timestamps to html or json report #2377

Closed jonathan-boudreau-work closed 5 months ago

jonathan-boudreau-work commented 5 months ago

🤔 What's the problem you're trying to solve?

Making it easier to debug test failures.

✨ What's your proposed solution?

Add step timestamps to the html or json report.

⛏ Have you considered any alternatives or workarounds?

No.

📚 Any additional context?

When running large test suites against environments it can be hard to troubleshoot due to the sheer number of logs generated. Having timestamps on the steps would make it easier to get a more appropriate range to filter logs on when using a logging tool like splunk.


This text was originally generated from a template, then edited by hand. You can modify the template here.

davidjgoss commented 5 months ago

Thanks for raising @jonathan-boudreau-work. You mentioned both JSON and HTML so I'll address them separately:

JSON

The JSON formatter has durations for steps, but not timestamps. This format is in maintenance mode now and won't have any new functionality added. You can however use the message formatter which emits Cucumber Messages - these include testStepStarted events which have a timestamp.

HTML

What you're saying here chimes a lot with https://github.com/cucumber/html-formatter/issues/283, where we want to change the design direction of the formatter to include more useful information for debugging, and this would definitely include timings.