GHPReporter / Ghpr.NUnit

Adapter for NUnit 3 (generate HTML report for NUnit 3)
http://ghpreporter.github.io/
MIT License
35 stars 14 forks source link
addin html nuget nunit nunit-console nunit3 qa qa-automation-test qatools quality-assurance quality-control report reporting screenshot test-automation

Project icon

Some Links:
Core | MSTest | MSTestV2 | NUnit | SpecFlow | Console | Site Repo

Build status NuGet Version Codacy Badge CodeFactor FOSSA Status

Ghpr.NUnit

Usage:

With installed NUnit 3 Console

With NUnit 3 ConsoleRunner NuGet package

How to publish the report in Jenkins

Please, read this 'How to publish the report in Jenkins' instruction.

How to work with screenshots

If you want to add screenshots to your report, you need to implement your own method of taking screenshot as byte[]. This is needed because there is no way to take screenshot which will work on any testing framework or CI tool (such as Jenkins or TeamCity). If you are using WebDriver, you can take screenshot using WebDriver. Also NUnit attachments are supported.

[Test]
public void TestMethod()
{
    var bytes = TakeScreenshot(); //your implementation
    //all you need to do is to pass byte[] to ScreenHelper:
    ScreenHelper.SaveScreenshot(bytes);
}

If you want to be able to take screenshots for failed tests, you can take a look at this approach:

[TearDown]
public void TakeScreenIfFailed()
{
    var res = TestContext.CurrentContext.Result.Outcome;
    if (res.Equals(ResultState.Failure) || res.Equals(ResultState.Error))
    {
        ScreenHelper.SaveScreenshot(TakeScreenshot());
    }
}

Demo Report

You can view Demo report on our site

View report locally

Please read Core instructions or this comment about opening report in Chrome

Contributing

Anyone contributing is welcome. Write issues, create pull requests.

Release notes

You can find it here for all packages.

License

FOSSA Status