- Notifications
You must be signed in to change notification settings - Fork14
Adapter for NUnit 3 (generate HTML report for NUnit 3)
License
GHPReporter/Ghpr.NUnit
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Some Links:
Core |MSTest |MSTestV2 |NUnit |SpecFlow |Console |Site Repo
With installedNUnit 3 Console
- Check you have thelatest version installed
- Download the latest version of Ghpr.NUnit (using NuGet)
- Add relative path to
Ghpr.NUnit.dll
from build folder of your tests (example:addins/../../../Users/Evgeniy_Kosjakov/Documents/GitHub/Ghpr.NUnit.Examples/build/Ghpr.NUnit.dll) intonunit.bundle.addins
file (file located in[nunit_console_location]/addins). Also make sure that your build contains such libraries and files asGhpr.Core.dll
,Ghpr.NUnit.dll
,Ghpr.LocalFileSystem.dll
,Ghpr.NUnit.Settings.json
andNewtonsoft.Json.dll
: - Run your tests via NUnit Console
- Check you have thelatest NuGet package installed
- Download the latest version of Ghpr.NUnit (using NuGet)
- Add relative path to
Ghpr.NUnit.dll
located in your build folder intonunit.nuget.addins
in tools directory of NUnit.ConsoleRunner.3.10.0. Also make sure that your build contains such libraries and files asGhpr.Core.dll
,Ghpr.NUnit.dll
,Ghpr.LocalFileSystem.dll
,Ghpr.NUnit.Settings.json
andNewtonsoft.Json.dll
. - Run your tests via NUnit Console Runner
Please, readthis'How to publish the report in Jenkins'
instruction.
If you want to add screenshots to your report, you need to implement your own method of taking screenshot asbyte[]
. 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]publicvoidTestMethod(){varbytes=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]publicvoidTakeScreenIfFailed(){varres=TestContext.CurrentContext.Result.Outcome;if(res.Equals(ResultState.Failure)||res.Equals(ResultState.Error)){ScreenHelper.SaveScreenshot(TakeScreenshot());}}
You can viewDemo report on oursite
Please readCore instructions orthis comment about opening report in Chrome
Anyone contributing is welcome. Writeissues, createpull requests.
You can find ithere for all packages.
About
Adapter for NUnit 3 (generate HTML report for NUnit 3)