Skip to content

Restructured JUnit class/method name reporting #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

sirchia
Copy link
Contributor

@sirchia sirchia commented Nov 9, 2013

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.

“Scenario( Outline): <scenario name>” map to the ‘package’ of the JUnit reported classname
“|<example row>|” or “Scenario” map to the class name of the JUnit reported classname
“<step keyword> step description” map to the name of the JUnit reported testcase
@mpkorstanje
Copy link
Contributor

This PR is based on an implementation that used an older version of Gherkin and can't be merged anymore. However with #1135 we'll more or less have the functionality as desired.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants