anshooarora / extentreports-java

Community version of Extent API for Java has moved to https://github.com/extent-framework/
http://extentreports.com
Other
529 stars 318 forks source link

No computed duration for child tests #503

Open kenston opened 8 years ago

kenston commented 8 years ago

While the total duration is correct (4m), the duration for a child test does not seem to be computed (i.e., 0m):

image

anshooarora commented 8 years ago

The start and end times are the same..

kenston commented 8 years ago

@anshooarora Sorry, forgot to include the lower part in the screenshot. It seems that the end time was not updated based on the last entry (20:05:18) under that child node.

image

anshooarora commented 8 years ago

Looks like the child node is appended right after it is started. Use appendChild as you would use endTest, at the end.

kenston commented 8 years ago

Thanks for pointing that out. Read the code and it appears to be the case.

In my case, I do not know when my child test will end. Can we have logging methods do an update to the end time instead?

My current workaround is to just do an update from time to time (e.g., when doing a logging): extentTest.setEndedTime(new Date());

djangofan commented 8 years ago

I get the opposite of this (using 2.40.1 or 2.41.0) : The child duration is shown for each individual test in a suite but the suite duration (in this case TestNG suite) is shown as 0.00 seconds. If the child test shows that it took 30s or so, then why would the suite start and end time be the same?

As far as I can tell, my TestNG runs are reporting non-zero durations on the suite-level for my test runs. For example the output .xml might look like this: <suite name="Command line suite" duration-ms="1663" started-at="2016-06-07T22:55:51Z" finished-at="2016-06-07T22:55:53Z">

BUT, my Maven Surefire runs report duration like this, which Extent reports can't parse?? <testsuite name="TestSuite" time="477.14" tests="8" errors="0" skipped="1" failures="0">

screen shot 2016-06-08 at 11 01 29 am

Just some thoughts. Is suspect ExtentReports was tested with TestNG but not with the Surefire TestNG runner?