anshooarora / extentreports-java

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

Issue in Report view #441

Open saikiran40cs opened 8 years ago

saikiran40cs commented 8 years ago

issue There are actually 2 BUGS in this.

  1. The total time taken for current run and overall is not working properly highlighted in colors when replacing the existing file is set to false.
  2. If the date format in the extent-config.xml is changed from yyyy-MM-dd to some other specified format the report works really wierd.

Could you please look into these issues. Also i am unable to print any exceptions in the exception tab even though it is thrown.

anshooarora commented 8 years ago

Is this Java or .NET?

Please provide more details, the information you have provided is not sufficient for me to better understand what is going on. You can:

  1. Attach your report
  2. Provide steps for me to reproduce, create a small POC etc
saikiran40cs commented 8 years ago

@anshooarora SampleReport.zip Please find the below required details

  1. Technology : Java
  2. Eclipse version in use: Eclipse Mars v 4.5.1
  3. Extent reports version : 2.40.2
  4. Selenium version: 2.53

Attached the test report for your reference

Steps to reproduce

  1. Run the same tests for about two or three times
  2. Use extent = new ExtentReports(filePath, replaceExisting as false --> append to the existing report everytime,NetworkMode.OFFLINE);
  3. After the run is complete the Total Time Taken (Current Run) and Total Time Taken (Overall) are miscalculated. for details check the attached document in tests view(timings don't match with the dashboard and tests view)
saikiran40cs commented 8 years ago

Please let me know if you need more information. And from the past few days i am trying to use the attached java file for instantiating the extent reports

I am calling the ExtentManager class instance in the main test method of another class in the different package. Attached are the class files ExtentManager.zip

From the attached file . Check the extent manager class where the variable replaceExisting=false is set then below is the stack trace occurs otherwise if the variable replaceExisting=true then there are NO issues. [TestNG] Running: C:\Temp\testng-eclipse--348817943\testng-customsuite.xml

Got Inside FAILED CONFIGURATION: @AfterTest tearDown java.lang.NullPointerException at com.google.regression.SampleTest.tearDown(SampleTest.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.TestRunner.afterRun(TestRunner.java:1023) at org.testng.TestRunner.run(TestRunner.java:628) at org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at org.testng.SuiteRunner.run(SuiteRunner.java:261) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215) at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) at org.testng.TestNG.run(TestNG.java:1048) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:112) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176)

FAILED: TC001 java.lang.NullPointerException at com.google.utilities.ExtentManager.getInstance(ExtentManager.java:21) at com.google.regression.SampleTest.TC001(SampleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:774) at org.testng.TestRunner.run(TestRunner.java:624) at org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at org.testng.SuiteRunner.run(SuiteRunner.java:261) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215) at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) at org.testng.TestNG.run(TestNG.java:1048) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:112) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176)

Default test
Tests run: 1, Failures: 1, Skips: 0
Configuration Failures: 1, Skips: 0

Default suite Total tests run: 1, Failures: 1, Skips: 0

Configuration Failures: 1, Skips: 0

[TestNG] Time taken by org.testng.reporters.jq.Main@5fdef03a: 86 ms [TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 6 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@77556fd: 18 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@14899482: 5 ms [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@16b3fc9e: 77 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter2@ed17bee: 7 ms extent-config.zip

Could you please help on this issue @anshooarora. Also added the config xml for reference

anshooarora commented 8 years ago

Thanks. I was able to reproduce this.

anshooarora commented 8 years ago

The 2nd one is sulimilar to #445

anshooarora commented 8 years ago

Can you try with the latest beta (beta-4) to see if the issue exists?

Stanlie commented 8 years ago

With current build downloaded yesterday I am getting a related bug.

anshooarora commented 8 years ago

Are you using the TestNG listener class or executing as a normal logger with annotation support?

saikiran40cs commented 8 years ago

Still the issue exists in extent reports v2.41

SamiranBanerjee commented 8 years ago

Hi Anshoo,

I have the same problem in the test ended time. Actually I am getting the correct time in console by getTime(result.getEndMillis()), same as the result xml. But, the setEndedTime method is giving the end time of the complete test, not each method. I am using Extent Report as the Listener in TestNG test. The version is 2.41.0. Attaching the screenshot of the console and the report.

image

image

saikiran40cs commented 8 years ago

@anshooarora The issue is there must be an extra variable which holds the value of earlier suits runtimes in report.java where currentSuiteRunDuration is calculated based on getSuiteStartTimestamp method where if the report was generated 2 days ago with report appending as true ,then the suite start time is considered as 2 days back which leads to calculation issue.

Could you please fix this issue.