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

Hierarchical Display of Results #29

Closed BeyMelamed closed 9 years ago

BeyMelamed commented 9 years ago

I love Extent report and am trying to use it in my own QA Automation project.

The essence of my project is getting input from external text provider (e.g., Excel, XML, etc.), parse this input (it has its own dialect) and run Selenium WebDriver to follow the 'commands' from the input source.

I downloaded and integrated Extent with no problem (both, on Windows and Ubuntu).

One issue I was unable to resolve is using child tests.

My project provides for any test step to be defined as a test case (containing multiple steps - each of which can be a 'step' or collection of those.) - so, there is a natural nesting within my framework that would be super if i could get ExtentReports to display the results in the original test hierarchy.

The ability to use Child tests is extremely appealing but i was unable to achieve what i expected. I was able to nest tests but the results showed the nested tests duplicated on more than one level and the nesting did not present the 'depth' my sample test case dis (I got only two levels of nesting while my test case was 4 deep)

I assume it is more likely to be my bug, but just to make sure, suppose i set everything correctly, can i expect to create and display the results in a structure similar to file explorer (some nodes deeper than others and no limit on the depth? Within reason, of course)

PLEASE NOTE: I changed the extension of the attached file to .png (originally, and html file). This is a sample report file created by my project. So, Please rename it to .html to see the effect i am trying to describe.
In particular, note test named VMTurbo.003 that represents a test with 34 steps. Also, note (last) step Demo.001 which actually 'contains' the rest of the steps. Thanks,

Avraham Melamed

ddttestresults

anshooarora commented 9 years ago

Avraham,

No bugs in your implementation :)

By design, you can go as deep as a single child node, which is what you are also seeing. That is because the currently markup makes it very difficult to read as you drill down and the entire layout looks too chaotic as you go deeper.

I am working on a slightly different layout which should hopefully make it easier to support multiple nodes without impacting readability as much. From the Java side of things, the syntax would be exactly the same though.

BeyMelamed commented 9 years ago

Thanks so much for the quick and clear response. I already accommodated for two modes (nested and default) in my own project so, when you finish your implementation, i will be ready for it (of course, with commensurate code changes if needed.) Initially, i thought it was the timing of .endTest() invocation. I think Extent is an excellent add-on - it saved me a huge and steep learning curve to do something similar using (say) Angular (I would need to learn it first but this was my first thought) Thanks again for a wonderful add-on with a neat, lightweight interface. My biggest problem (as my project is not your 'normal' jUnit compliant project, is to represent the results hierarchically to follow the structure of the test harness (which is totally user determined.)

anshooarora commented 9 years ago

Avraham

Sure thing!

Let's use this ticket to track updates for this upcoming feature, for which I will keep the issue open until the functionality becomes available.

Cheers, Anshoo

BeyMelamed commented 9 years ago

Terrific! I was thinking that, conceptually, the hierarchical display should emulate a 'TreeView' control using available controls (are there any that are ubiquitous enough?) Not being a web developer, I cannot add anything of significance to the technical details but I would explore ways to leverage the wonderful features you already provided with an existing widget that has the built-in functionality of node management (during the run that creates the tree - e.g. add node, etc) with expansion / collapsing during the view phase of the completed report. I hope this makes sense...

anshooarora commented 9 years ago

Thanks Avraham. I am thinking to create a nestable list:

view

This ways, you have to perform less clicks and go straight to the item that you want to check (so less time spend viewing results).. What do you think?

*EDIT - If we go the tree-view route, it will be something like this, for which we will have to perform a few clicks to go deep. See this for example: http://www.jstree.com/demo/.

Coding out either structure shouldn't be too complicated but the recursion aspect of Java code will be so I will be having some fun building this out :)

anshooarora commented 9 years ago

Avraham, this feature is ready.. would you like to test it and let me know if it works?

anshooarora commented 9 years ago

Avraham

This feature is now part of 2.04, launched today. No changes will be required to your code and will build multiple levels.

anshooarora commented 9 years ago

This FR is part of ad6b91d. Closing ticket.

CharlieThach commented 9 years ago

Appending Child works beautifully! Great Job Buddy!