/Ghpr.Core

Easy-to-use .NET Html QA Reporter

Primary LanguageTypeScriptMIT LicenseMIT

Project icon

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

Language Build status NuGet Version

Ghpr.Core

Easy-to-use .NET test reporting tool for several testing frameworks

Usage

Testing framework Repository Nuget version Examples Repository CI
Core Ghpr.Core NuGet Version - Build status
NUnit 3 Ghpr.NUnit NuGet Version View examples Build status
MSTest Ghpr.MSTest NuGet Version View examples Build status
SpecFlow Ghpr.SpecFlow NuGet Version View examples Build status

Demo Report

You can view Demo report on our site

About Settings file

Standard settings file is .json file with the following structure:

{
	"outputPath":"C:\\_GHPReporter_Core_Report",
	"sprint":"",
	"runName":"",
	"runGuid":"",
	"realTimeGeneration":"True",
	"runsToDisplay": "5",
	"testsToDisplay": "5"  
}

For Ghpr.Core it is called Ghpr.Core.Settings.json. This file is included in NuGet package. For different testing frameworks (MSTest, NUnit, SpecFlow) there are separate settings files. Separate files are needed to let Ghpr.Core use different settings for different testing frameworks.

Parameter runsToDisplay: if >0 the reporter will load only this specified number of the latest runs on test run page.

Parameter testsToDisplay: if >0 the reporter will load only this specified number of the latest test runs on test history page.

View report locally

Firefox

  • Go to about:config
  • Find security.fileuri.strict_origin_policy parameter
  • Set it to false

Chrome

  • Close your Chrome
  • Launch it with --allow-file-access-from-files option:
    • eg C:\PATH TO\chrome.exe --allow-file-access-from-files

How to publish the report in Jenkins

  • In the configuration of your job, in the "Post-build actions", you just have to add a "Publish HTML reports" with the correct informations.

Known Issues :

  • Due to the CSP (Content Security Policy), the report used for the functionals tests is not viewable on Jenkins with the default value defined for the CSP. So, for solving this issue, the CSP is automatically forced after each restart with a specific value. For that, a line is added in the C:\Program Files (x86)\Jenkins\jenkins.xml file, like this : ... -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle "-Dhudson.model.DirectoryBrowserSupport.CSP=" -jar -Dmail.smtp.starttls.enable=true "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war" ...

  • The screenshots generated with Selenium work only when there were made with browsers like Firefox or Chrome (Doesn't work with IE)

Contributing

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