-
Notifications
You must be signed in to change notification settings - Fork 315
Test And Test Steps counts are same in the Extent report 3.0.1 #756
Comments
I see 2 tests. How many logs does each toggle have? |
Actually I am running 3 classes Class 1 - has 6 tests Result after running : Tests run: 35, Failures: 6, Errors: 0, Skipped: 23 Questions :
|
Can you check if the issue persists with version 3.0.3? Also, if it does, can you share a small sample that I can use to repro? Thanks. |
Yes. I'm using 3.0.3 version. I have a GenerateExtentReport class then createTest for parentTest then assign the Test Suite as Category then I call the method for the Test Steps:
I have a method getResults where I pass if the Test Step is a Pass or Fail.
|
Please attach a project. Its going to be difficult and time-consuming for me to fill in all the missing details and recreate the project from scratch. With that being said, the 2 counts you have shown may not necessarily match. That is because:
|
Hi, |
I really think that there's something wrong with the counts, please create a small project and create steps and tests and see if the counts are the same. maybe the Dashboard test count points to the Step counts as well. Thanks for the help. |
@RodNepoLNRisk if you assign the category to the child tests are well, this issue will go away. The report will not automatically mark the childNodes with the same category as the parent test which is why you are seeing this issue. As I had mentioned in the 1st bullet above:
For the above, version 2 has several differences in comparison to 3 which is why you see this behavior.. |
I'll try your suggestion for version 3, but for version 2, how can I see the Summary Totals for the Category section? |
I did what you asked and assigned the Category to the child tests and the totals are no longer correct and the Categories view displayed the Steps together with the Tests instead of having it as a drilldown. |
This is the method that I call for Pass, Fail, Skip.
|
Thanks. This (the counts) doesn't make sense but I am also not able to repro in any of my tests. Will it be possible to share your report? You can email me at anshooarora at gmail dot com. |
Hi Anshoo, I'd like to ask if you were able to check the Test counts and if there's really a possibility that it copies the Steps count or maybe Tests Count and Steps Count are the same, meaning same variable was used? Btw, one more thing, is it ok if we also have Row and Column Totals for the Category section? Thanks. |
Hi Anshoo, I'd like to follow up if you were able to verify the Test count issue? |
Rod, there are way too many tests in the package for me to run through them all and check. I would just like to see the report if possible. |
Hi, I've attached 2 classes that call the Extent Reports. |
Can you attach the report output if possible? |
Sorry I wasn't clear. Can you attach the HTML file itself? I want to view some internals as well.. |
In version 2, you can select the type of counts you are looking for. If you select childTests and parentTests, you will see a different count there. Coming to version 3, in your report, I see:
The counts look correct. Not all tests (eg: 01 - ADR_4_History of All Accounts) have categories assigned to them which is why the counts are not matching up correctly. Its not required for the categories and tests count to match. |
my concern is the passed tests vs passed steps, how come they're both the same all the time. They both have 29, that's odd because there are some tests with multiple steps, like for the one that failed it had 6 steps and one failed that's why that test failed, but it had 5 other steps that passed. I really think that Passed Tests and Passed Steps might be pointing at the same counter. |
They are same in this case because for every passed test, there is a passed step. There are other steps as well, for example Also, I think we're both talking about the same items but seeing it differently. From the report standpoint, each toggle is a test. The log inside the toggle is a step. Parent -> Nodes (toggles) -> Logs (steps) |
Hi @anshooarora, I am able to reproduce the issue reported here. For example, consider the following code: public static void main(String[] args) {
// start reporters
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");
// create ExtentReports and attach reporter(s)
ExtentReports extent = new ExtentReports();
extent.attachReporter(htmlReporter);
ExtentTest parentTest = extent.createTest("Parent Test");
// creates a toggle for the given test, adds all log events under it
ExtentTest test = parentTest.createNode("MyFirstTest", "Sample description");
test.info("This step shows usage of info(details)");
test.fail(new RuntimeException("First test failed"));
ExtentTest test1 = parentTest.createNode("MySecondTest", "Sample description");
test1.fail(new IllegalStateException("Second test failed"));
extent.flush();
} Here I have 1 Parent Test and 2 Child tests. Refer the following screenshot: The |
The childTests show up under the Tests section. The logs show up under the Steps section. ParentTest in such cases is treated as a class so not really a test, but contains tests, such as MyFirstTest and MySecondTest. For clarity, I can add a similar section as BDD where there are: Features, Scenarios and Steps. So we can have:
|
Yes, ideally people treat the hierarchy this way, at least in the TestNG world:
There is another case where people wanted to include classes also as follows:
|
Would it be possible to test with the latest commit? It has a new logic to account for class, test, step counts for both standard and bdd style tests. |
How can I use the latest commit? Is there a new version like 3.0.4? |
You can download the files and compile the project; https://github.com/anshooarora/extentreports-java/tree/92758f5e467ee8f29975120e71dd7aa4f65edf65 |
It's ok now. I was able to generate the .jar |
So are you using version 3.0.3? The latest commit can be removed? |
Yes. I'm using v3.0.3. The commit can be removed. |
I will provide an option to choose either strategy, so the default is |
I'll test this commit tonight and update here with my observations.
…On 28 March 2017 at 18:45, Anshoo Arora ***@***.***> wrote:
I will provide an option to choose either strategy, so the default is TEST
and the new one from the latest commit is CLASS. Either can be chosen for
the report as there will be users as per @email2vimalraj
<https://github.com/email2vimalraj>'s reply who may want to see this view.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#756 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABKI3gADkbsigFauvcTxVelK6Z_ayDEnks5rqQf9gaJpZM4LygQ->
.
|
usage: extent.setAnalysisStrategy(AnalysisStrategy.CLASS); extent.setAnalysisStrategy(AnalysisStrategy.TEST);
made a few updates today, now you will be able to select an AnalysiStrategy:
|
@anshooarora : I'm running the following code public static void main(String[] args) {
// start reporters
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");
// create ExtentReports and attach reporter(s)
ExtentReports extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.setAnalysisStrategy(AnalysisStrategy.CLASS);
ExtentTest parentTest = extent.createTest("Parent Test");
ExtentTest test = parentTest.createNode("MyFirstTest", "Sample description");
ExtentTest test1 = test.createNode("MySecondTest", "Sample description");
test1.fail(new IllegalStateException("Second test failed"));
ExtentTest test2 = test.createNode("Test 3", "Sample description");
test2.pass("Passed");
extent.flush();
} My
However what I have observed is as follows: Here not sure whether the Also if you see here: The tile cards' title are mismatching. The count of I guess we need to introduce another strategy called Suite, this should have the following hierarchy:
The current
|
@anshooarora : Is it possible to give the user an ability to decide which node has to be a parent, child and grand child? We can limit the levels to be max 4, because I can't think any use case beyond 4. So the levels should be:
User can set which node can be a parent and so on. If any level is not found, the respective chart and other information should not be shown. What is your view on it? |
Steps = Logs From your example above, I see:
Does it make sense? So depending upon how the reporting is being used, ideally, in this strategy, the left side must contain all the classes that are being tested. The interesting thing is, TestNG also implements a concept of suite which is going to throw this strategy out because it adds another level. Due to this, we can rename:
Does it sound correct? |
Yeah, that is why I'm proposing another level called Let me see whether I can add another level to it. |
Add a minor change to make the labels dynamic for the chosen AnalysisStategy. |
Can some one please generate a .jar file with the latest changes and provide link for download. |
@naveenru - latest 3.0.4 is now available. Also closing this ticket as ER is now complete. |
I also get this same concern. I suggest can we Change the name of "Steps" in the result? Honestly it's very confused for the users |
@liu02124091 : Which version of ExtentReport are you using? This issue had been solved from starting 3.0.4. The current release version is 3.0.5. Could you please upgrade to the latest version and try? If something is not working as expected, feel free to comment back with steps to reproduce. |
Hi @anshooarora / @email2vimalraj , I have the same concern in this regard. I have one class under which there are 16 TCs. Below is the report which got generated. In a way its hard to understand for other users that how many TC exactly executed and how many are pass or fail. Can we display number of TC Pass / Fail infront of test name itself because it marked complete Test as fail even though 14 TC are passing and only 2 got failed. I am open to any other suggestion by which we can display it in a much better way. Please help ! |
Dear @anshooarora Tried to search lot but couldnt find anywhere |
I have used extent 3.0.1 version
Issue :Test and Test steps count are same always . Test and test Step count are 2 always . Please help .
Expected result : Test = 1 , Test steps = 2
Test Suite : TS1
Test Cases : tc1 ,tc2
Implementation :
public class ExtentTestNGReportBuilder {
}
public class ExtentManager {
}

The text was updated successfully, but these errors were encountered: