Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Bug view not displayed #840

Closed
email2vimalraj opened this issue Apr 5, 2017 · 6 comments
Closed

Bug view not displayed #840

email2vimalraj opened this issue Apr 5, 2017 · 6 comments

Comments

@email2vimalraj
Copy link
Collaborator

Summary

From v3.0.4, the Bug View is not displayed even though there is a failure with throwable.

Expected Behavior

If there are any tests failed with throwable, the Bug view should be displayed in the report.

Current Behavior

Currently the Bug view is not displayed from v3.0.4.

Sample

ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");
ExtentReports reporter =  new ExtentReports();
reporter.attachReporter(htmlReporter);
ExtentTest parentSuite = reporter.createTest("Parent Suite");
ExtentTest childTest = parentSuite.createNode("Child Test");
childTest.createNode("Grand Child Test").fail(new RuntimeException("Some exception message"));
reporter.flush();

Environment Details

  • Extent report Version used: v3.0.4
  • Operating System and version: Mac OSx Sierra
  • JDK Version: 8
anshooarora added a commit that referenced this issue Apr 5, 2017
@anshooarora
Copy link
Owner

@email2vimalraj - does the latest commit work? I will quickly release this version if your tests also pass, this one is very high priority.

@email2vimalraj
Copy link
Collaborator Author

@anshooarora: I'm on it

@email2vimalraj
Copy link
Collaborator Author

@anshooarora : The bug tag is displayed now. However, there are few things which are not correct.

  1. The exception are being displayed even for the parent node

issue_1

  1. If you notice the above screenshot, the message for everything is the same even my test doesn't throw the same message. For example:
// start reporters
        ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");

        // create ExtentReports and attach reporter(s)
        ExtentReports extent = new ExtentReports();
        extent.attachReporter(htmlReporter);

        ExtentTest feature1 = extent.createTest("Feature 1");
        ExtentTest scenario1 = feature1.createNode(Scenario.class, "Scenario 1");
        scenario1.createNode(Given.class, "Step 1").pass("Passed");
        scenario1.createNode(When.class, "Step 2").fail(new IllegalStateException("Second test failed"));

        ExtentTest feature2 = extent.createTest("Feature 2");
        ExtentTest scenario2 = feature2.createNode(Scenario.class, "Scenario 2");
        scenario2.createNode(Given.class, "Step 1").pass("Passed");
        scenario2.createNode(When.class, "Step 2").pass("Passed");

        ExtentTest scenario3 = feature2.createNode(Scenario.class, "Scenario 3");
        scenario3.createNode(Given.class, "Step 1").pass("Passed");
        scenario3.createNode(When.class, "Step 2").fail(new IllegalStateException("Fail message"));

        extent.flush();

The exception type is same, however the message of the exception are different. In this case Second Test Failed and Fail message are two different messages.

@anshooarora
Copy link
Owner

With the latest commit, parentTest will not copy exception info from children..

@email2vimalraj
Copy link
Collaborator Author

email2vimalraj commented Apr 5, 2017

Yeah saw your commit, I've simplified your previous commit by refactoring few things. Kindly review my PR #841

@email2vimalraj
Copy link
Collaborator Author

Fixed in v3.0.5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants