Giter Club home page Giter Club logo

extentreports-java's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extentreports-java's Issues

[Feature] Quick Test Summary - Show only Headers which have at least 1 count

Feature request from Cags:

I understand that the summary table contains the same labels as with the LogStatus (Passed, Failed, etc...) and I guess I will just need to define when to use them. Is there a way to configure using or (not using some of them and still retain the report's calculations? Ex. I only need 4 - Passed, Failed, Fatal and Error so that the summary table (and graphs) do not show the other status (Warning, Info, Skp, and Unknown).

When a testng suite time-out is hit, the report isn't generated and we get the following:

[selenium:testng] Total tests run: 0, Failures: 0, Skips: 0
[selenium:testng] ===============================================
[selenium:testng]
[selenium:testng] [TestNG] Reporter ExtentReporterNG@5318a0ac failed
[selenium:testng] java.lang.NullPointerException
[selenium:testng] at com.relevantcodes.extentreports.ExtentReports.removeChildTests(ExtentReports.java:169)
[selenium:testng] at com.relevantcodes.extentreports.ExtentReports.flush(ExtentReports.java:145)
[selenium:testng] at ExtentReporterNG.generateReport(ExtentReporterNG.java:58)
[selenium:testng] at org.testng.TestNG.generateReports(TestNG.java:1115)
[selenium:testng] at org.testng.TestNG.run(TestNG.java:1074)
[selenium:testng] at org.testng.TestNG.privateMain(TestNG.java:1364)
[selenium:testng] at org.testng.TestNG.main(TestNG.java:1333)

[Feature] Support for CDI

Hi,

could you please add support for CDI, so that an injection into the test classes would be possible?

Greets

[Feature] Ability to filter by category and test status at the same time

From Tony: http://www.ontestautomation.com/creating-html-reports-for-your-selenium-tests-using-extentreports/#comment-49495

.. is there a way to get the filters in the Detail section to work in tandem (e.g. filter by Result AND Category)? Currently the tests can only be filtered by the latest filter selection. It would be useful for me to only see tests that meet both criteria (i.e. ‘Errors’ in the ‘Internet Exploder’ category).

[Feature] Show Child test's step counts in Quick Test Summary

Feature request from Cags:

Is there a workaround on getting the correct parent log status count indicated in the quick summary table even if we do not actually log the status? This would match the steps (child log steps) with the Steps view graph and also match the Tests view graph.

Bug while counting fatal step count in Google pie chart JS Code

Problem: If a test has failed steps, then while report generation we count the failed steps as fatal steps also. As a result for a test with only two steps (1 fail, 1 Info) we get 3 steps (1 fail, 1 info, 1 fatal).

I debugged the issue and found that its in the JS component of the final report. We have done this there

            var failedSteps = $('td.status.fail').length;
            var fatalSteps = $('td.status.fail').length;

fatalSteps also take value from $(td.status.fail)

It seems like a bug to me. So logging as a bug. Meanwhile sending you a pull request also

Downloaded jar from Maven contains only META-INF directory

Hello Anshoo,
I added extentreport dependency to pom.xml of the my project as instructed on documentation. However, the downloaded jar file from Maven server does not have any compiled .class files. It contains only the META-INF directory. Below is how I added the dependency to pom.xml

  <dependency>
            <groupId>com.relevantcodes</groupId>
            <artifactId>extentreports</artifactId>
            <version>1.2</version>
  </dependency>

Could you please look into this?

Feature Request: Requirements-level BDD

It would be great if this API reports Requirements-level BDD for tools such as JBehave, Cucumber…
Reporting not only on how the tests did but also what requirements have been tested and what requirements haven’t.

Let me know your thoughts on this.

Regards
Madhu RJ

When are you releasing Version 2.xx?

Hi Anshoo,

We have used your extentreports 1.XX in our framework. Now that we have added multi threading capabilities to the framework, we would like to use version 2. Assuming that is made for multi threading purpose.

Any dates for that? Or if you have a private jar? We would like to test it out and include in our framework.

Thanks
Virender

New feature request for Email-able report - User should be able to insert the URL into Emailable report

UAC

1.User should be able to insert the URL
(Extent report ) into Email-able report .
2.When user click on the URL , they should be navigated to the URL they hit .

Description -
This feature will be nice to have , and all the recipient of the report can click on the link provided on the report to look onto the extent report or Testing Application URL

For example

Click on the link given below to view detail report (or some meaningful message)
Report Link -http://10.98.1.62:8181/extentreport/IAPTestingReport.html#!

Testing Application Link - https://www.googlee.com

Maybe not an issue, but I didn't see a way to do this...

I'd like to push ALL failed tests to the top of the summary report. Is this available by default?

I'm using this a listener against a suite of tests.

The tests show up, but I see

Fail,
pass
pass
pass
Fail

I'd like to be able to show
FAIL,
FAIL,
pass
pass etc

And sort by default on FAIL (top of list)

Relative Reference to Screenshot in Report

In my opinion there is a problem with the screenshots, which are included in the report (html).

Method addScreenCapture(String imgPath) of ExtentTest returns "file:///screenshots/abc.png" for files which do have a relative path like "screenshots/abc.png".

[2.0] Multiple entries in summary

Using:
Extenreports 2.0
Junit 4.12.

start tests in the @before with

test = extent.startTest(name.getMethodName());

end tests in @after with

extent.endTest(test);
extent.flush();

Getting multiple entries of same tests in the summary. (looks like it writes them on every flush.)

summary example:
test01
test01
test02
test01
test02
test03
test01
test02
test03
test04

Issue with Image in Report

Hi,

If I am opening an image from the report then the lightbox does not work. It is not showing the resized image.
This problem happens to me in Chrome and Firefox (Safari is working fine). Can you please validate, if this happens also to you?

Regards

Can we load images from relative path?

This is the great library to generate test reports. Thank you for a wonderful job. I have one suggestion to make.
Currently html tag for images loads the source images using "fill:///" protocol. (i.e "file:///" is prefixed to the image path of src)
As I noticed, we need to pass full absolute path of the image to load it correctly on report. When we pass a relative path images are not loaded from the report.
Passing relative path is very helpful when we want to share the report with others. So it is great if you can enable this capability.

standalone/offline extentreports

Hi,
I understand that there is a problme with the issue because of the visualization library of google that doesn't support offline usage, i would really appreciate it if you could try creating something like that or even tell me how to do it by myself and where do i need to chagne the code of the extentreports.
I'm using java

[Feature] Redesign Category View details to support larger test case counts

Feature request from Charlie:

I feel like the summary is great for small amount of test cases but when 1k++ test cases it can get really messy.

For Example: If Test Class A has 10 test cases
Test Class B has another 10 and so on ...

At the end the summary will list so many test cases it will become hard to follow.

Is it possible for you implement an easier organization for the summary page where it will list:

Test Class A
Test Class B
Test Class C
....

and when user click any of the test classes it will expand all the test cases within it. This can almost be achieved with Category parent + child node test

Is it possible to group methods by test name?

Hi Anshoo,

I'm running my tests with TestNG xml that contains few tests. each test contains few methods.
ExtentReports ver: 2.01
@BeforeSuite i'm calling: report = ReportManager.getInstance();
@BeforeMethod i'm calling: test = report.startTest(method.getName());
@AfterMethod i'm calling: report.endTest(test);
@AfterSuite I'm calling: report.flush();

In the result report I see all the methods that run in one big list.
How to group them by test name in one report file?
For example:

Test 1

Method 1
Method 2
Method 3

Test 2

Method 1
Method 2
Method 3

Moving and removing of widgets, disable unused feature such as categories etc.

Most developers won't look at top widgets. Managers might, but not developers. I'd like to move that to the bottom of the report and have the Failed/ Passed tests show up on top.

Also, a toggle to turn off the Steps View if it's not being used (the way our tests are written, Steps and Tests are coming up with the same counts...) -- test.log(status,blah) = a 'STEP' so if a test has 1 test.log(FAIL, blah) entry, then test counts and step counts are the same... (If this is the case, why show both on the report?)

Next, if there are no categories configured, could the report remove the link to categories (avoids confusion)

Could we force auto collapse on the Details view for "Failed" tests?

Finally, since we don't really care about passed tests, could we default to the Details view if a test has failed, with failed tests fully collapsed?

Sorry for the boat load of info here :)

addScreenShot to ExtentTest is not read while creating the report

Problem: In v2 we have moved screenshot to ExtentTest class. I am using addScreenshot to add a particular screenshot. There are two issues that I am facing

  • addScreenshot adds the image html in the ArrayList of ScreenCapture, however it does not add this html in the final html generated. In TestBuilder I dont see any step replacement for ScreenShots or ScreenCasts. As a result if we have simple dont ExtentTest.addScreenshot(), it will not appear in the report.
  • In v1 we had attachScreenShot which used to take the path to the screen and also used to take a message. In V2 its only addScreenshot which doesnt take a message.

I am not sure if these are design or a bug. In v2 addScreenshot returns you the HTML of screenshot. This way we can write following code to add a screenshot
''''Java
String ScreenShotHtml = reporter.addScreenCapture(takeScreenShot());
reporter.log(LogStatus.INFO, ScreenShotHtml);
''''

Manually updated test times (start / end time report issues)

When you use extent reports as a listener, the report is generated at the end of the run

When this occurs I'm seeing:

2015-07-29 15:43:422015-07-29 15:43:420h 0m 0s (for all Failed and Passed tests)

I do see differences in the actual result data though:

Maybe a manually setter for the start/ end times on a given test?

import java.io.File;
import java.util.List;
import java.util.Map;
import org.testng.IReporter;
import org.testng.IResultMap;
import org.testng.ISuite;
import org.testng.ISuiteResult;
import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.xml.XmlSuite;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

public class ExtentReporterNG implements IReporter {
private ExtentReports extent;

@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
    extent = new ExtentReports(outputDirectory + File.separator + "Extent.html", true);

    for (ISuite suite : suites) {
        Map<String, ISuiteResult> result = suite.getResults();

        for (ISuiteResult r : result.values()) {
            ITestContext context = r.getTestContext(); 
            buildTestNodes(context.getFailedTests(), LogStatus.FAIL, r);
            buildTestNodes(context.getSkippedTests(), LogStatus.SKIP, r);
            buildTestNodes(context.getPassedTests(), LogStatus.PASS, r);
            System.out.println("ISuiteResult " + r.toString() + " - " + r.getTestContext().getSuite().getName());
            System.out.println("ITestContext " + context.getName());
        }
    }
    System.out.println("Hit Method: generateReport ");
    extent.flush();
}

private void buildTestNodes(IResultMap tests, LogStatus status, ISuiteResult suiteResult) {

    ExtentTest test;

    if (tests.size() > 0) {
        System.out.println("Hit Method: buildTestNodes (size > 0)");
        for (ITestResult result : tests.getAllResults()) {
            System.out.println("Result Start - " + result.getStartMillis());
            System.out.println("Result End - " + result.getEndMillis());
            System.out.println("Result String Rep... " + result.toString());
            test = extent.startTest(suiteResult.getTestContext().getSuite().getName());
            String message = "Test " + status.toString().toLowerCase() + "ed"; 
            if (result.getThrowable() != null)
                message = result.getThrowable().getMessage(); 
            test.log(status, message);
            extent.endTest(test);
        }
    }        
}

}

[selenium:testng] Result Start - 1438264421634
[selenium:testng] Result End - 1438264513124

Enhancement suggestion: can add comparison feature to decide pass / fail

Hi Ansoo,

I am using ExtentReports 2.X version, and was thinking if you could add the compare functionality like, send 4 parameters to result, 1. description 2.expected value 3. actual value 4. compare operator (like = / > / <) and,
Your code will decide logstatus.pass and logstatus.fail depend on the operator evaluation
Then print the description, expected, actual result along with status.
I am working on such kind of functionality, but its just printing to a simple html page, I saw same kind of post on Bas's site http://www.ontestautomation.com/create-your-own-html-report-from-selenium-tests/,
Wondering if this could mix up with your ExtentReport, thanks!

LogStatus.INFO overrides LogStatus.SKIP in report

Hi there! First of all, thank you for the great framework! It's really wonderful!

Probably, I found a bug when LogStatus.INFO overrides LogStatus.SKIP and marks test as Passed:

@Test(priority = 0,enabled=true, description = "Skip this test")
public void skipThisTest() throws InterruptedException {

    test = extent
            .startTest("skipThisTest", "skipThisTest");

    test.log(LogStatus.INFO,"SKIP");

    test.log(LogStatus.SKIP,"SKIP");
    skipThisTest("SKIP"); // throw new SkipException(message);
}

2015-08-07_9-55-08

Without test.log(LogStatus.INFO,"SKIP"); test appeared as skipped in the report. Would you please take a look on it.

Now I have to use LogStatus.ERROR instead of LogStatus.SKIP as ERROR status can't be overridden by INFO.

Hierarchical Display of Results

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

If Test Step name is missing from very first log event

These statements in TestBuilder
stepSrc = StepHtml.getSrc(2);
if (node.log.get(0).stepName != "") {
stepSrc = StepHtml.getSrc(0);
}

will make sure that the tests never have a TestStep name if the very first test log has no test name specified. Is this by design?

Question about adding screen captures and screen casts

I initially thought the test.addScreenCapture(...) method would take the screen shot and add it to the report. However, it looks like it simply adds the path of the screen shot to the report. Taking the screen shot must be done programmatically. Is the code below the right approach? If so, what would be a good approach for using the test.addScreencast(...)?

test.log(LogStatus.INFO, "Snapshot below: " + test.addScreenCapture(takeScreenshot("./beforeLogin")));

protected String takeScreenshot(String name) {
    String path = "./screenshots/" + name + ".png";
    try {
        File screenshotFile = ((TakesScreenshot) getDriver()).getScreenshotAs(OutputType.FILE);
        FileUtils.copyFile(screenshotFile, new File(path));
    } catch (Exception e) {
        LOG.log(Level.SEVERE, e.getMessage(), e);
    }
    return path;
}

How to initiate when using multiple suite files?

testng.xml contains:
suite name="All Browsers" parallel="tests" thread-count="10"
suite-files
suite-file path="StoragePoolsWidgetAutomationTest.xml"
suite-file path="SystemCapacityWidgetAutomationTest.xml"
/suite-files
/suite

Each file initiates my test class (which extends a base class)

BeforeSuite is called 2 times in this situation.
BeforeClass is called 4 times since there are 2 browser entries in each "suite-file" mentioned above.

[selenium:testng] About to begin executing Suite StoragePoolsWidgetAutomationTest @ 10:32:42:421
[selenium:testng] About to begin executing Suite SystemCapacityWidgetAutomationTest @ 10:32:42:421
[selenium:testng] About to begin executing Suite StoragePoolsWidgetAutomationTest @ 10:32:42:421
[selenium:testng] About to begin executing Suite SystemCapacityWidgetAutomationTest @ 10:32:42:421
[selenium:testng] Before Suite...
[selenium:testng] Before Suite...
[selenium:testng] Start executing test Chrome-WINDOWS-7 @ 10:32:42:433
[selenium:testng] Start executing test Chrome-WINDOWS-7 @ 10:32:42:433
[selenium:testng] Start executing test Firefox-WINDOWS-7 @ 10:32:42:434
[selenium:testng] Start executing test Firefox-WINDOWS-7 @ 10:32:42:434
[selenium:testng] Before Class...
[selenium:testng] Before Class...
[selenium:testng] Before Class...
[selenium:testng] Before Class...

Thoughts?

Thanks!

Chris

Feature Request - ExtentReports Merge Tool

I saw in the ExtentReport it has an option to append the later execution:
new ExtentReports (reportFile, false)

This feature is good for appending the report. I think it will be great if you can provide another feature to merge the reports instead of just appending them.

For Example:
If I execute test Class A and B with test cases A1, A2, B1, B2. And then both test Classes again but with different test cases A3, A4, B3, B4 but without setting the flag to false for appending.

Is it possible for ExtentReport to provide a feature to merge the reports together by just calling a method like: merge(report1.html, report2.html) or from command line: ExtendReport report1.html report2.html to provide the final report that including all the reports? When we merge the report, we should sort the test cases in the test class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.