cucumber-reactive-reporter
v1.0.11
Published
A filterable html report generator for cucumberjs written in react
Downloads
17
Maintainers
Readme
Cucumber report library based on react-redux and @mui Parses output of cucumberjs provides filtering via tags ans status and few other things.
Why another reporter?
The main motivation behind this project was the desire for a more dynamic experience as well as the need to get more control over various data attachments and how they are displayed.
Here are some of the things that were deemed important to implement in this reporter:
- Control over how data is displayed, including the ability to pass html snippets as attachments and render them in the reporter: (can be useful when pointing to "local" files generated as part of the test run)
- Ability to filter and search the reports based on such things like status and tags
- Ability to work with large-ish amounts of tests, some existing reports become unwieldy or slow
- Control filter and search configuration with url params, allows sharing a preconfigured link in case you want to share a specific failure for example.
- Better use available space on the report page (needs tweaking)
Install
$ npm install cucumber-reactive-reporter
Example usage:
import Reporter from "cucumber-reactive-reporter";
let options = {
"title": "Cucumber reactive reporter sample",
"description": "... test suite description"
};
let metadata = {
"some key": "value",
"additional key": "value",
"more keys": "value"
};
let linkTags = [{
"pattern": "[a-zA-Z]*-(\\d)*$",
"link": "https://my.jira.server/browse/"
}];
options.metadata = metadata;
options.linkTags = linkTags;
(async () => {
await Reporter.generate("mytest/cucumber-output.json", "htmlOutputFolder/", options);
})();
See sample in action:
- @TAGS button displays a list of every tag found in the report
- METADATA button opens a section with any custom key value pairs passed in during creating of the report
- Search window allows for cucumber expressions to filter down to features with scenarios matching the expression, for example:
(@catfacts or @image) and not @1_tag
TODOs and ideas for improvement:
- patch more settings for intial render (before/after toggle, theme, filter etc.)
- handle state "ambiguous" (probably lump em with errors), generate one when there are two test definitions with similar regex
- Figure out a strategy for handling combined reports (from parallel runs)
Release notes
| Version | Description | | ----------- | ----------- | | 1.0.2 | improvements to debugging and readme | | 1.0.3 | fixed crashes when search threw syntax errorsfixed css for @tags and @metadata buttons | | 1.0.4 | Added more pagination choices for scenariosList, 50 and 100 | | 1.0.5 | Fixing publishing code and adding notes | | 1.0.6 | Added pagination to the main feature screen, shows up if above 50 | | 1.0.7 | Changed feature pagination to be always on if above 10 elements, the reason why is you can change to display 10 at a time to force single column| | 1.0.8 | Fixed json parsing error for newer cucumber version, where Before and After steps do not provide code line info| | 1.0.9 | Fixed displayed step duration in newer versions of cucumber| | 1.0.10 | New reporter option to convert some tags to custom links|