freshen icon indicating copy to clipboard operation
freshen copied to clipboard

xunit XML output has the same name for all tests

Open jacek99 opened this issue 14 years ago • 5 comments

When you run a Freshen note test with the --with-xunit option, the generated XML file has "runTest" as the name for all entries. It would be great if the "name" attribute would reflect the actual title that is being displayed in the console.

jacek99 avatar Nov 26 '10 22:11 jacek99

Here's a sample

File "/usr/local/lib/python2.6/dist-packages/freshen-0.2-py2.6.egg/freshen/noseplugin.py", line 70, in runTest self.step_runner.run_step(step) File "/usr/local/lib/python2.6/dist-packages/freshen-0.2-py2.6.egg/freshen/core.py", line 33, in run_step return step_impl.run(step.arg, _args) File "/usr/local/lib/python2.6/dist-packages/freshen-0.2-py2.6.egg/freshen/stepregistry.py", line 39, in run self.func(_args, **kwargs) File "/home/jacekf/src/Maven-Python-Mojos/maven-python-mojos/maven-bdd-plugin/src/test/python/features/db/steps.py", line 19, in and_those_who_werent raise Exception("TEST") Exception: TEST

in "those that weren't:" # features/db/db.feature:18 ]]>

jacek99 avatar Nov 26 '10 22:11 jacek99

Oops, sorry I closed this one by mistake...how do you re-open it?

jacek99 avatar Nov 26 '10 22:11 jacek99

Please consider adding to FreshenTestCase method:

def id(self):
    return "%s.%s"%(self.feature.name, self.scenario.name)

This is later on used in xunit xml's giving you a nice output

lroszak avatar Sep 02 '11 06:09 lroszak

I've put in an alternative solution in #35. By creating sub-classes with feature names having scenario names as test methods, any other plugins introspecting test classes will get a consistent view.

dexterous avatar Sep 21 '11 18:09 dexterous

I think we can close this now that we have merged #35; or do we want to wait for the release?

dexterous avatar Sep 29 '11 20:09 dexterous