Skip to content
This repository has been archived by the owner. It is now read-only.

Fixed the exception view which was not displaying the results properly #841

merged 3 commits into from Apr 5, 2017


Copy link

@email2vimalraj email2vimalraj commented Apr 5, 2017

  • Fixed the exception view which was not displaying the results properly
  • Removed the duplicated exception for the parent node if the exception was raised by the child node
  • Minor enhancement in the style and the nav template
  • Updated the version number in the report template
Copy link
Collaborator Author

@email2vimalraj email2vimalraj commented Apr 5, 2017

The report now looks like as follows:

screen shot 2017-04-05 at 8 57 35 pm

The code used to test is as follows:

// start reporters
        ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");

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

        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"));


This comment has been minimized.


anshooarora Apr 5, 2017

The 2 methods:


were not sharing the code because one points to the test's attributes and the other for exception. Attributes of the test are author, category etc. Exception isn't a test's attribute because it is not something that you can assign, but it occurs due to an event, so its more of a runtime binding.

We can change the method name so its more clear to the user that here the test is computing all attributes and runtime events..

@anshooarora anshooarora merged commit 727a8f9 into master Apr 5, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants