Emailable Report incorrect when using DataProvider and some tests pass, others fail for one testcase

14 views
Skip to first unread message

TerriM

unread,
Apr 25, 2018, 3:18:12 AM4/25/18
to testng-users
I have figured out that the issue seems to be with getMethodSet.  You have it adding the ALL test methods that match the name, but it matches it regardless of Pass/Fail.  So then it adds to the report the total number of that test case run.  Notice in the image attached that tc030_login shows 4 entries in Failed and 4 in Passed, when in reality 3 Failed and 1 Passed.  The number shown is correct, but the number of lines is incorrect.  It boils down to how you  " // Add all the invoked methods".  Which honestly is a little confusing as to why.  When using a DataProvider, it doesn't make sense to do this.  


If you simply comment out that for loop, you get a much cleaner Summary.  Each test case is still listed in the report, but the summary would at least be accurate.




Another issue is that the links under Method never link to the proper place in the document.  Even if you don't comment out that for loop, it still doesn't go to correct location in page.



 

TerriM

unread,
Apr 25, 2018, 3:25:54 PM4/25/18
to testng-users
For anyone interested, attached is a modified version of the file that gets rid of the duplication in summary list, and fixes the numbers in the Summary table at very top.
EmailableReport.java

TerriM

unread,
Apr 25, 2018, 6:08:57 PM4/25/18
to testng-users
And I modified it one more time.  It now shows number of Scenarios run (@Test methods) as well as the number of Iterations (@Test with DataProvider running multiple iterations of same scenario).
EmailableReport.java
Reply all
Reply to author
Forward
0 new messages