I am using cypress with 'cypress-junit-reporter' to output test results to an XML file. I have recently tweaked the setup to run cucumber Feature files but I would like the full feature file text to be outputted to the XML results file instead of just currently just pulling in the Scenario. How can I do this?
Cypress.json
{
"chromeWebSecurity": false,
"baseUrl": "https://www.testurl.com",
"defaultCommandTimeout": 10000,
"requestTimeout": 20000,
"experimentalFetchPolyfill": true,
"video": false,
"scrollBehavior": "nearest",
"reporter": "cypress-junit-reporter",
"reporterOptions": {
"mochaFile": "cypress/results/output-[hash].xml",
"jenkinsMode": true,
"useFullSuiteTitle": true,
"testsuitesTitle": true,
"antMode": true
},
"experimentalSourceRewriting": true,
"testFiles": "**/*.{feature,features}"
}
Output XML file
?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="" timestamp="2021-05-17T13:42:07" tests="0" file="cypress/integration/BDDTest.feature" package="" hostname="undefined" id="0" errors="0" time="0.00" failures="0">
<properties>
</properties>
<system-out>
</system-out>
<system-err>
</system-err>
</testsuite>
<testsuite name="Root Suite.Test scenarios for BDD" timestamp="2021-05-17T13:42:07" tests="1" package="Root Suite.Test scenarios for BDD" hostname="undefined" id="1" errors="0" time="9.05" failures="0">
<properties>
</properties>
<testcase name="User can navigate to Login page" time="9.05" classname="Test scenarios for BDD">
</testcase>
<system-out>
</system-out>
<system-err>
</system-err>
</testsuite>
</testsuites>
Test.feature
Feature: Test scenarios for BDD
Scenario: User can navigate to Login page
Given I open the homepage
When User clicks on the Login button
Then User should be on Login page