Restructured JUnit class/method name reporting #626
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I propose the following slight tweaks to the way the scenarios/steps are mentioned in the name and classname attributes of the JUnit XML report:
“Scenario( Outline): ” map to the ‘package’ of the JUnit reported classname
“||” or “Scenario” map to the class name of the JUnit reported classname
“ step description” map to the name of the JUnit reported test case
The main reason for this change is to have a more structured view in a JUnit based test overview page like that of Jenkins, where on the 1st page a list of packages (=scenario names) is shown. Clicking on a package shows all test classes (=examples, or just 'Scenario' if it isn't an outline scenario) in that package. Clicking on a class shows all test methods (=steps of that scenario).
Also, failing tests are shown on the overview page with their complete package.classname.testmethod description and with this mapping, it is instantly clear which step of which scenario (example) has failed.
In order to make sure the parsing of packages (substring of 0 - in classname) and JUnit internal distinction of class and method in its description goes alright, the following character replacements are done in the scenario and descriptions and example rows:
. translates to ,
( translates to {
) translates to }
Finally, the redundant reporting on the scenario itself has been removed.