You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test case name in JUnit XML not consistent when using scenario retries #4983
When using Codecept with mocha-junit-reporter I noticed that testcase name is not always consistent and changes depending on whether retry is used on scenario or not.
For a test without any retries, its testcase always follows the pattern: <suite name>: <scenario name>. Including trimmed down XML for easier reading:
<testsuitename="JUnit reporting"timestamp="2025-04-30T12:34:22"tests="1"file="/path/to/test.js"time="10.966"failures="1">
<testcasename="JUnit reporting: Test 1"time="5.060"classname="Test 1">
If I use either Feature.retry(1) or Scenario.retry(1) the name of testcase omits the colon : character between suite and scenario name.
<testsuitename="JUnit reporting"timestamp="2025-04-30T12:34:22"tests="1"file="/path/to/test.js"time="10.966"failures="1">
<testcasename="JUnit reporting Test 1"time="5.060"classname="Test 1">
If the test uses retries but passes on 1st try the colon is still there:
<testsuitename="JUnit reporting"timestamp="2025-04-30T12:34:22"tests="1"file="/path/to/test.js"time="10.966"failures="0">
<testcasename="JUnit reporting: Test 1"time="5.060"classname="Test 1">
The full title seems to get modified somewhere during the retry but I haven't been able to identify where. It's missing no matter if the test passes or fails on the retry. I know it looks like a small difference but it's an inconvenience if you want to do any kind of automatic processing on output XML files.
I think the reason for this difference is that mocha's test.fullTitle() (which is space separated) gets overwritten with Codecept's version (which is delimited by colon) at the start when tests are added to suite:
Not sure why this is the case since test.fullTitle() already exists at that point (at least from my limited testing) but once the retry is triggered it somehow reverts back to the initial implementation?
Activity
nikzupancic commentedon May 7, 2025
I think the reason for this difference is that mocha's
test.fullTitle()(which is space separated) gets overwritten with Codecept's version (which is delimited by colon) at the start when tests are added to suite:CodeceptJS/lib/mocha/test.js
Line 53 in 0025e2c
Not sure why this is the case since
test.fullTitle()already exists at that point (at least from my limited testing) but once the retry is triggered it somehow reverts back to the initial implementation?github-actions commentedon Aug 6, 2025
This issue is stale because it has been open for 90 days with no activity.