Cucumber-React is a set of React components for rendering Gherkin documents and Cucumber results.
The source code for screenshots above is:
<Wrapper envelopes={envelopes}>
<GherkinDocumentList />
</Wrapper>
The <GherkinDocumentList>
React component,
is an accordion of <GherkinDocument>
.
The <GherkinDocument>
React component and any component nested within it (such as <Scenario>
) can be rendered standalone.
The <GherkinDocument>
React component is instantiated with a single gherkinDocument
prop.
The value must be a GherkinDocument object.
You can use the Gherkin parser to generate a GherkinDocument
object.
By default the <GherkinDocument>
component will not display any coloured results, as the GherkinDocument
message object does not contain results, only the AST of the document.
This is fine for simple use cases where results are not important.
To render a <GherkinDocument>
with results and highlighted Cucumber Expression parameters parameters it must be nested inside a
<Wrapper>
component.
Install dependencies
npm install
Run tests
npm test
Interactive development
npm run storybook
A component that renders a list of scenarios (possibly from multiple files, filtered by e.g. tag).
This component could be used to render relevant scenarios in 3rd-party tools, such as JIRA, Confluence and various issue trackers that support plugins.
Configure with a regexp and url function, and tags will be rendered as JIRA issue links
Search by tag, but also by text. Could use http://elasticlunr.com/
or https://lunrjs.com/ - or it could simply perform filtering on an array of GherkinDocument
messages.
Each scenario displayed underneath each other, grouped by feature file. The feature description is "collapsed", (unless it contains the search term) but can be opened.
- by tag
- by duration (find slow ones)
- by status
- by recency (update timestamp) - exclude old ones
- by flickeriness
- Render a tag cloud for all tags
- Size: count
- Color: pass/fail/undefined
For large reports (especially with screenshots) it may be too heavy to store it all in the browser. The GUI should request data for the current document on demand. The GUI should also be able to filter what kind of events it wants. For example, to render the initial screen.
It should be easy to use. Just run the app (Electron). It will create a named pipe where it will listen. What's written here gets written straight to the React app (no websocket, it's in the same process). This app can be fairly small.
Add a message to represent a config+cwd+env for a run, so the GUI can rerun it. The config is essentially command line options. They can be modified in the gui. Rerun on file change can also be set up. This just makes the whole DX simple.
The app could use the OS to send screen messages (autotest like)