Hi,
First, thanks for your job.
I've test the Junit XML output for Behat 3, it work's, but it miss the optional time attribute in seconds (<xs:attribute name="time" type="xs:string" use="optional"/>) on testcase element.
Is it possible to add it?
Current output:
<testcase name="1.Affichage du site" status="passed"></testcase>
Desired output:
<testcase name="1.Affichage du site" status="passed" time="2"></testcase>
this would be a great addition for me too.
I can see why the optional attributes are not implemented right now, but would i be a possibility to add a hook to the Output/Node Generation? This would give developers a way to add optional attributes if they need any without cluttering the code too much.
thanks anyway for your work on this.
If that attribute wouldn't confuse existing implementations of JUnit (Jenkins and such), I'm all for it.
I would definitely love to see this implemented
@everzet It would actually improve those CIs, especially CircleCI which has an option to load balance tests between containers (automatically), by looking at the time property.
Here's how it looks in CircleCI's test summary:

We really need this to pinpoint long running tests/performance issues.
Thought this was easy by just adding "time" and "timestamp" in JUnitScenarioPrinter.php but I'm not sure where we would pull the duration from.
I implemented a initial version of this in my fork. https://github.com/higrow/Behat/commit/eabe3346303034ba9426b84b4791a660abfaf2b5
if anyone can verify the approach i'm happy to add tests, clean up and make a pull request.
I'm unsure how to get the tests passing though because the junit format tests verify the equality of the generated file with the content specified in the junit_format.feature
Because the execution time varies i'd have to either stub the duration somehow or change the check to only verify the format, not the exact content. Any preference there?
It would be great to have an easy and cleany way to do it, with a behat extension for example
Oh but it already exist ! look at it : https://packagist.org/packages/jarnaiz/behat-junit-formatter
Seems the _time_ attribute was written to JUnit output in Behat 2.5 - since upgrading to Behat 3.1 it's noticeable that Jenkins CI has stopped gathering test duration statistics, as the _time_ attribute is missing from the XML... would be great to get this back!
@everzet changes by https://github.com/higrow/Behat/commit/eabe3346303034ba9426b84b4791a660abfaf2b5 as clear as possible. Can I provide behat scenarios for this feature?
@guillaumeray it would be nice to have a CLI Controller in your extension
@higrow @everzet can you look at PR https://github.com/Behat/Behat/pull/1083
@wouterj please, take a look https://github.com/Behat/Behat/pull/1083
Most helpful comment
I implemented a initial version of this in my fork. https://github.com/higrow/Behat/commit/eabe3346303034ba9426b84b4791a660abfaf2b5
if anyone can verify the approach i'm happy to add tests, clean up and make a pull request.
I'm unsure how to get the tests passing though because the junit format tests verify the equality of the generated file with the content specified in the junit_format.feature
Because the execution time varies i'd have to either stub the duration somehow or change the check to only verify the format, not the exact content. Any preference there?