New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtentHtmlReporter.setAppendExisting(java.lang.Boolean b) not working in version 3.0.1 #744

Closed
mauropota opened this Issue Jan 18, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@mauropota

mauropota commented Jan 18, 2017

Hi,
in my view this function should allow to trace into a unique report test results from different executions. This is true only for test cases list but not for charts.
In particular, when this function is enabled (set to true) and I use the same report file to collect test results of new executions, tests are appended correctly but charts are not updated according to new results. I expect that at least the chart representing the number of pass/skip/fail test is updated.
If charts are not updated according to all the stored test cases, they are completely wrong.

@mauropota

This comment has been minimized.

Show comment
Hide comment
@mauropota

mauropota Jan 18, 2017

Hi again,
I noticed that charts are produced by the javascript:
(cdn.rawgit.com/anshooarora/extentreports-java/9fa70d0ed9c34a8ed445ceee3494d3d7de7f8918/dist/js/extent.js)
Is it possible to share it?

mauropota commented Jan 18, 2017

Hi again,
I noticed that charts are produced by the javascript:
(cdn.rawgit.com/anshooarora/extentreports-java/9fa70d0ed9c34a8ed445ceee3494d3d7de7f8918/dist/js/extent.js)
Is it possible to share it?

@mauropota

This comment has been minimized.

Show comment
Hide comment
@mauropota

mauropota Jan 18, 2017

Hi again,
the following method in class com.aventstack.extentreports.reporter.AbstractReporter:

public SessionStatusStats getStatusCount() {
      if (sc != null)
           return sc;

      sc = new SessionStatusStats();
      sc.refresh(testList);
      return sc;
}

is resposible to returns values plotted (number of exec. tests and steps) by charts.
To plot values about all the executed test cases (also those executed in previous executions) the instruction sc.refresh(testList) should be always called (also when sc is not null).

I hope this can help!

mauropota commented Jan 18, 2017

Hi again,
the following method in class com.aventstack.extentreports.reporter.AbstractReporter:

public SessionStatusStats getStatusCount() {
      if (sc != null)
           return sc;

      sc = new SessionStatusStats();
      sc.refresh(testList);
      return sc;
}

is resposible to returns values plotted (number of exec. tests and steps) by charts.
To plot values about all the executed test cases (also those executed in previous executions) the instruction sc.refresh(testList) should be always called (also when sc is not null).

I hope this can help!

@mauropota mauropota changed the title from ExtentHtmlReporter.setAppendExisting(java.lang.Boolean b) not working to ExtentHtmlReporter.setAppendExisting(java.lang.Boolean b) not working in version 3.0.1 Jan 18, 2017

@mauropota

This comment has been minimized.

Show comment
Hide comment
@mauropota

mauropota Jan 18, 2017

Hi again,
the workaround described in my previuos post suggested me that you can get the same results by just invoking the flush method two time instead that one time.
This workaround, calling the flush method two time, fix the problem of appending exsisting reports without modifying the code of the library.

I hope that also this can help!

TO DEVELOPERS: It would be great if chart plotting test cases steps points to each single test case. In this way, we I click on any test this chart show steps relative to the selected test.

mauropota commented Jan 18, 2017

Hi again,
the workaround described in my previuos post suggested me that you can get the same results by just invoking the flush method two time instead that one time.
This workaround, calling the flush method two time, fix the problem of appending exsisting reports without modifying the code of the library.

I hope that also this can help!

TO DEVELOPERS: It would be great if chart plotting test cases steps points to each single test case. In this way, we I click on any test this chart show steps relative to the selected test.

@anshooarora

This comment has been minimized.

Show comment
Hide comment
@anshooarora

anshooarora Jan 18, 2017

Owner

The method from AbstractReporter will not make any difference if we refresh each time because the information is passed from the report. The report itself will only gather information ..

See here:

https://github.com/anshooarora/extentreports-java/blob/master/src/main/java/com/aventstack/extentreports/Report.java#L206

I will look into this but your posts suggest varying issues with the library. Can you let me k ow which one issue pertains to this ticket?

Owner

anshooarora commented Jan 18, 2017

The method from AbstractReporter will not make any difference if we refresh each time because the information is passed from the report. The report itself will only gather information ..

See here:

https://github.com/anshooarora/extentreports-java/blob/master/src/main/java/com/aventstack/extentreports/Report.java#L206

I will look into this but your posts suggest varying issues with the library. Can you let me k ow which one issue pertains to this ticket?

@mauropota

This comment has been minimized.

Show comment
Hide comment
@mauropota

mauropota Jan 19, 2017

Hi anshooarora,
here I will try to better summarise the issue/ bug I experienced:

GOAL:
I want to collect in a global html report all data about test sessions.
For example consider this scenario: in Jenkins I set up a scheduled build that starts every day at midnight. The results about each build must be collected and shown in a global html report.

HOW TO REACH THE GOAL:
calling the method ExtentHtmlReporter.setAppendExisting(TRUE)

EXPECTED RESULT:
all test cases executed with each Jenkins build appear in the same report file. Charts show data about all the listed test cases

OBTAINED RESULT:
all test cases executed with each Jenkins build appear in the same report file. Charts show only data about the last executed build

FIRST WORKAROUND:
modifying the following the method com.aventstack.extentreports.reporter.AbstractReportergetStatusCount() as follow:
public SessionStatusStats getStatusCount() {
if (sc != null) {
sc.refresh(testList); //ADDED LINE
return sc;
}
sc = new SessionStatusStats();
sc.refresh(testList);
return sc;
}

SECOND WORKAROUND:
calling the method ExtentReports.flush() two time.

COMMENTS:
using one of the presented workarounds I can obtained my expected results, that is chats show results about all tests stored into my global html report.
To better improve the role of charts I propose the following improvement: chart showing test steps should refer to single test. A chart should be generated for each test stored into the global report and shown when the test is selected.

I hope this summary help. Please let me know!

ABOUT YOUR POST:
the problem is that when the "x.setStatusCount(stats);" is called "stats" contains only data about the current execution and do not consider older tests results stored in the global html report.

mauropota commented Jan 19, 2017

Hi anshooarora,
here I will try to better summarise the issue/ bug I experienced:

GOAL:
I want to collect in a global html report all data about test sessions.
For example consider this scenario: in Jenkins I set up a scheduled build that starts every day at midnight. The results about each build must be collected and shown in a global html report.

HOW TO REACH THE GOAL:
calling the method ExtentHtmlReporter.setAppendExisting(TRUE)

EXPECTED RESULT:
all test cases executed with each Jenkins build appear in the same report file. Charts show data about all the listed test cases

OBTAINED RESULT:
all test cases executed with each Jenkins build appear in the same report file. Charts show only data about the last executed build

FIRST WORKAROUND:
modifying the following the method com.aventstack.extentreports.reporter.AbstractReportergetStatusCount() as follow:
public SessionStatusStats getStatusCount() {
if (sc != null) {
sc.refresh(testList); //ADDED LINE
return sc;
}
sc = new SessionStatusStats();
sc.refresh(testList);
return sc;
}

SECOND WORKAROUND:
calling the method ExtentReports.flush() two time.

COMMENTS:
using one of the presented workarounds I can obtained my expected results, that is chats show results about all tests stored into my global html report.
To better improve the role of charts I propose the following improvement: chart showing test steps should refer to single test. A chart should be generated for each test stored into the global report and shown when the test is selected.

I hope this summary help. Please let me know!

ABOUT YOUR POST:
the problem is that when the "x.setStatusCount(stats);" is called "stats" contains only data about the current execution and do not consider older tests results stored in the global html report.

@anshooarora

This comment has been minimized.

Show comment
Hide comment
@anshooarora

anshooarora Jan 20, 2017

Owner

I believe this will have the same affect if this collection is not made null and refresh occurs after that:

https://github.com/anshooarora/extentreports-java/blob/master/src/main/java/com/aventstack/extentreports/reporter/ExtentHtmlReporter.java#L130

I will research this further and release fix in the upcoming version.

Owner

anshooarora commented Jan 20, 2017

I believe this will have the same affect if this collection is not made null and refresh occurs after that:

https://github.com/anshooarora/extentreports-java/blob/master/src/main/java/com/aventstack/extentreports/reporter/ExtentHtmlReporter.java#L130

I will research this further and release fix in the upcoming version.

@mauropota

This comment has been minimized.

Show comment
Hide comment
@mauropota

mauropota Jan 20, 2017

Thank you!

mauropota commented Jan 20, 2017

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment