Cucumber for Jira is only supporting JSON results of official cucumber implementations. But there is a trick to be able to push results from Cypress.
Cucumber for Jira is using this schema to validate the JSON result file received. Which means that if we can produce something that is validated by this schema, we will be able to push it in Cucumber for Jira.
That’s possible in 2 steps:
Produce a JSON result files using cucumber-json-preprocessor.
Create a valid JSON result file
Produce a JSON result file
Please follow installation and configuration steps described in the homepage of cucumber-json-preprocessor
Create a valid JSON result file
Let say we have two feature files : Bad Usage and Serve Coffee
Feature: Bad Usage
Feature: Serve Coffee
Cypress with cucumber-json-preprocessor
Cypress cucumber-json-preprocessor will produce one result file per feature.
You will end up with a file containing
{ "id": "bad-usage", "uri": "features/bad_usage.feature", "keyword": "Feature", "name": "Bad usage", ... }
And the other one will contain
{ "id":"serve-coffee", "uri":"features/serve-coffee.feature", "keyword":"Feature", "name":"Serve Coffee", ... }
Based on the schema, the JSON files should be an array of feature result objects.
What we are expecting
[ { "id": "bad-usage", "uri": "features/bad_usage.feature", "keyword": "Feature", "name": "Bad usage", ... }, { "id":"serve-coffee", "uri":"features/serve-coffee.feature", "keyword":"Feature", "name":"Serve Coffee", ... } ]
Generate a valid JSON result file
I Create a new JSON file with the content :
[]
I copy content of Bad Usage result file in the newly created JSON file inside the array
[ { "id": "bad-usage", "uri": "features/bad_usage.feature", "keyword": "Feature", "name": "Bad usage", ... } ]
I repeat the second operation for every results generated ( don’t forget to separate object with a comma )
[ { "id": "bad-usage", "uri": "features/bad_usage.feature", "keyword": "Feature", "name": "Bad usage", ... }, { "id":"serve-coffee", "uri":"features/serve-coffee.feature", "keyword":"Feature", "name":"Serve Coffee", ... } ]