ladariha/junitxml-to-javascript

durationSec in testsuites and testsuite is broken

Opened this issue · 6 comments

Sorry I am not able to re-open the previous issue, so I have to raise a new one.
I have re-tried your new fix, but the durationSec for testsuite is still broken.
As you can see below, the time for testsuites is 25.932, the time for testsuite are 25.127, 0.439, 0.366. But in your output, it shows something wrong.

<?xml version="1.0" encoding="UTF-8" ?> <testsuites disabled="0" errors="0" failures="0" tests="5" time="25.932"> <testsuite name="send create request" timestamp="2019-04-05T17:53:47" hostname="localhost" time="25.127" errors="0" tests="2" skipped="0" disabled="0" failures="0"> <testcase classname="send create request" name="Then get status code 201" time="0.003" /> <testcase classname="send create request" name="And the response body" time="0.003" /> </testsuite> <testsuite name="send get request" timestamp="2019-04-05T17:54:12" hostname="localhost" time="0.439" errors="0" tests="2" skipped="0" disabled="0" failures="0"> <testcase classname="send get request" name="Then get status code 200" time="0.001" /> <testcase classname="send get request" name="And the response body" time="0.001" /> </testsuite> <testsuite name="send delete request" timestamp="2019-04-05T17:54:13" hostname="localhost" time="0.366" errors="0" tests="1" skipped="0" disabled="0" failures="0"> <testcase classname="send delete request" name="Then get status code 204" time="0" /> </testsuite> </testsuites>

No apology needed :) I'm sorry for the troubles. This script counts total duration based on the sum of each individual test case, in this case, your times are:
0.003, 0.003, 0.439, 0.001, 0.0010.366 and 0

where do you get the testsuite times? Could there be some kind of "beforeClass" and "afterClass" ?

I am using Jasmine reporter to generate the junit format of testing report.
The way the tests are organized is kind of spec nest into another spec , in my case, I am more interested into the duration for the whole testsuites and each testsuite,

Ok, so I've made it optional and released new version 1.1.2. Description is here https://github.com/ladariha/junitxml-to-javascript#use-time-attribute-from-test-suite-instead-of-making-sum-of-test-cases-for-duration

Could you please give it a try?

Thank you, I have just tried. It is pretty close to what I need with only one minor issue.
The information for the testsuites is missing in the output. in this case
<testsuites disabled="0" errors="0" failures="0" tests="5" time="25.932">, can you please double check ?

Do you mean the overall numbers from testsuites element? Could you please paste here your desired output?

yes, exactly.
As you can see the xml file, the top level element testsuites which presents the information for the overall numbers, but this piece of information ( time, disabled, errors ... etc) is missing from your output