ghpreporter / ghpr.nunit Goto Github PK
View Code? Open in Web Editor NEWAdapter for NUnit 3 (generate HTML report for NUnit 3)
Home Page: http://ghpreporter.github.io/
License: MIT License
Adapter for NUnit 3 (generate HTML report for NUnit 3)
Home Page: http://ghpreporter.github.io/
License: MIT License
add new target
Hi,
I have tried to implement Ghpr report and followed all the steps as mentioned in readme file....however I am not able to generate a report. Below are the steps which I have followed
-> I couldn't find any folder with name addins, so i have created a new folder under ".nuget\packages\nunit.consolerunner\3.8.0\addins" and added all required dlls into it.
-> There is no "nunit.engine.addins" file available, so manually created a file under ".nuget\packages\nunit.consolerunner\3.8.0\tools" and added the path as "../../addins/Ghpr.NUnit.dll"
Please find the dll's versions I have used:
Nunit : 3.9.0
Newtonsoft.Json : 10.0.3
NUnit Console : 3.8.0
Ghpr.NUnit : 0.8.0.2
Could you please help me on resolving this issue
Regards,
Sathish Kumar Mani
While I find the logs from each test-case output node useful within the report, it would be even more useful to include the test-suite output as well. The test-suite output can potentially be added to the Output tab for each test or to a new Output tab when clicking on what is now the collapsible links in the test list. The first approach needs to keep in mind that suites can be nested as found below, and will need to contain only the test-suite output for the suite(s) they are a part of. The second approach allows for a hierarchical view of what was executed where (minus the OneTimeTearDown as its output is lumped in with the output from OneTimeSetUp).
What is currently found:
<test-case ...>
...
<output><![CDATA[2018-06-06 13:27:50.419 T12 Start Test - TestRunId: , TestCaseId: , NUnitName: 'TestScripts.ServicePortalTests.TestDownloadToAllDevicesInCampus'
2018-06-06 13:27:55.532 T12 Event Navigated to xxxxx:55555/
Additional detail: Current URL is http://xxxxx:55555/login
2018-06-06 13:27:55.547 T12 Info Logging into ServicePortal
Additional detail: user: 'xxxxx', password: 'xxxxx', expectEror: False
2018-06-06 13:28:08.101 T12 Exceptions logged during test 1-1018:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
...
2018-06-06 13:28:08.101 T12
********************************************************************************
End Test - Status: 'Failed', TestRunId: , TestCaseId: , NUnitName: 'TestScripts.ServicePortalTests.TestDownloadToAllDevicesInCampus'
1 tests run; 0 passed; 1 failed; 0 skipped
********************************************************************************
]]></output>
</test-case>
What I'd like to see added:
<test-suite ...>
...
<output><![CDATA[2018-06-06 13:27:45.736 T9 Start Run; NUnit parameters: { 'e': 'xxxxx', 'r': 'false', 'c': 'false', 'l': 'Info', 'o': 'C:\Program Files (x86)\Jenkins\workspace\Test\test-output' }.
2018-06-06 13:28:08.191 T9 End Run; passed: 0, failed: 1, skipped: 2.
]]></output>
...
<test-suite ...>
...
<output><![CDATA[2018-06-06 13:27:45.778 T12 Start Suite - ServicePortalTests.
2018-06-06 13:27:45.802 T12 Info Fixture 'TestScripts.ServicePortalTests' will run in environment 'xxxxx'.
2018-06-06 13:28:08.185 T11 End Suite - ServicePortalTests; passed: 0, failed: 1, skipped: 2.
]]></output>
...
</test-suite>
</test-suite>
Please see TestResult.zip for a small example of the XML generated from an NUnit run.
Hi elv1s42,
Thank you for this good report.
I don't know why, but when I set up the "TakeScreenshotAfterFail" parameter to True, the tests failed don't appear in the report.
Is it a bug ?
Thank you to help me.
Yannick
I've got some NUnit tests that run multiple times with different parameters and I need a way to distinguish the runs in the HTML reporter, like:
[Role] - [Facility] - [Date]
instead of the default
[StartTime] - [EndTime]
The only thing I've been able to do so far is to read the Ghpr.NUnit.Settings.json
file and write the runName I want into the file (not desirable).
Describe the bug
First of all I'd like to say thank you for your project!
Unfortunately, I failed to integrate GHPReporter into my project (.Net Core Nunit test project). I didn't receive a generated file.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A HTML report should be generated. I checked the root of C drive, project root folder, 'bin', 'obj' folders.
Versions
.Net Core 3.1
GHPReporter 0.9.10,
Nunit 3.12.0,
Nunit.ColsoleRunner 3.11.1,
Using the new NUnit TextFixtureSource
attribute AND feeding in complex objects as structured data-driven test input, the results as displayed in GHPReporter on the run-test-list
page.
Instead of displaying the real test namespace hierarchy, GHPReporter is using the namespace of the input objects as well.
Hello,
Please review the exception we have, here is the stacktrace:
...
TearDown : System.TypeInitializationException : The type initializer for 'Ghpr.NUnit.Extensions.GhprEventListener' threw an exception.
----> System.NullReferenceException : Object reference not set to an instance of an object.
--TearDown
at Ghpr.NUnit.Extensions.GhprEventListener.get_OutputPath()
at Ghpr.NUnit.Utils.ScreenHelper.SaveScreenshot(Byte[] screenBytes)
...
Setup is Specflow + Selenium. Exception does not appear on all dev's computers. Running version 0.5.0.2 of both Core&NUnit.
If more information is needed please request so I can deliver.
Regards,
I have installed Nunit Console Runner 3.6.0 and set up with libraries as described:
Then run my TestProject_Ghpr.dll containing a test.
Console output window:
c:\Program Files (x86)\NUnit.org\nunit-console>nunit3-console.exe "c:\Users\MartinCo.MGSOPS\Documents\Visual Studio 2015\Projects\TestProject_Ghpr\TestProject_Ghpr\bin\Debug\TestProject_Ghpr.dll"
NUnit Console Runner 3.6.0
Copyright (C) 2017 Charlie Poole
Runtime Environment
OS Version: Microsoft Windows NT 10.0.10586.0
CLR Version: 4.0.30319.42000
Test Files
c:\Users\MartinCo.MGSOPS\Documents\Visual Studio 2015\Projects\TestProject_Ghpr\TestProject_Ghpr\bin\Debug\TestProject_Ghpr.dll
=> TestProject_Ghpr.Class1.Test1
Inside test
Run Settings
DisposeRunners: True
WorkDirectory: c:\Program Files (x86)\NUnit.org\nunit-console
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.5.2
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
NumberOfTestWorkers: 4
Test Run Summary
Overall result: Passed
Test Count: 1, Passed: 1, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2017-02-21 13:37:58Z
End time: 2017-02-21 13:38:00Z
Duration: 2.398 seconds
Results (nunit3) saved as TestResult.xml
Report is created at the location from Ghpr.NUnit.Settings.json (c:_GHPReporter_NUnit_Report\index.html) but when you open the report it is blank. Am I missing something?
I am attaching report in zip file.
https://1drv.ms/u/s!AldGQH625sV0mQp2tsSaHkVDj1zi
Hi ,
We are using the framework 4.6.2 and looking for instructions on how we can use the tool through command line
version:NUnit.ConsoleRunner.3.7.0
Regards
RP
Dependabot couldn't find a Ghpr.Core.csproj for this project.
Dependabot requires a Ghpr.Core.csproj to evaluate your project's current Dotnet dependencies. It had expected to find one at the path: /Ghpr.Core/Ghpr.Core/Ghpr.Core.csproj
.
If this isn't a Dotnet project, or if it is a library, you may wish to disable updates for it from within Dependabot.
You can mention @dependabot in the comments below to contact the Dependabot team.
Describe the bug
In the latest Nunit Console install package, the file 'nunit.engine.addins' has changed it's name and path.
Which means, https://github.com/GHPReporter/Ghpr.NUnit this readme doc is out dated.
It confused me a while before I realized what wrong was it.
Old Name: nunit.engine.addins
Old Path: \YOURLOCATION\NUnit.org\nunit-console\addins
New Name: nunit.bundle.addins
New Path: \YOURLOCATION\NUnit.org\nunit-console
To Reproduce
Steps to reproduce the behavior:
NUnit.Console-3.9.0.msi
Expected behavior
In the Nunit readme file: https://github.com/GHPReporter/Ghpr.NUnit, we should change these places accordingly:
Desktop (please complete the following information):
Additional context
I have tried, modify the new nunit.bundle.addins file will generate the result report.
Hello,
There is new version of Newtonsoft.Json
When I put the new version .dll I got the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeI
nitializationException: The type initializer for 'Ghpr.NUnit.Extensions.GhprEventListener' threw an exception. ---> Syst
em.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicK
eyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
at Ghpr.Core.Helpers.ReporterHelper.GetSettingsFromFile(String fileName)
...
Please, if possible, update to the new version of Newtonsoft.Json
Dependabot couldn't find a Ghpr.Core.csproj for this project.
Dependabot requires a Ghpr.Core.csproj to evaluate your project's current Dotnet dependencies. It had expected to find one at the path: /Ghpr.Core/Ghpr.Core/Ghpr.Core.csproj
.
If this isn't a Dotnet project, or if it is a library, you may wish to disable updates for it from within Dependabot.
You can mention @dependabot in the comments below to contact the Dependabot team.
Hi,
There's is a new version of NUnit.Engine (3.9.0) and I have found out that report does not get generated with this version. Workaround is to roll back NUnit.Engine to 3.8.0.
Environment:
Ghpr.Console {0.9.2}
Ghpr.Core {0.9.2}
Ghpr.LocalFileSystem {0.9.2}
Ghpr.MSTest {0.9.2.1}
Ghpr.NUnit {0.9.2}
Newtonsoft.Json {11.0.2}
NUnit {3.10.1}
NUnit.Console {3.9.0}
NUnit.ConsoleRunner {3.9.0}
NUnit.Engine {3.8.0}
Steps To Reproduce:
Result:
Folder defined in Ghpr.NUnit.Settings.json does not get created and report is not generated
With recent releases of NUnit, AddTestAttachment(string filePath, string description = null);
allows screenshots to now be mapped to the test case: https://github.com/nunit/docs/wiki/TestContext.
<test-case>
<output>...</output>
<attachments>
<attachment description="This is a description of this screenshot.">
<filePath></filePath>
</attachment>
<attachment description="This is a description of this screenshot.">
<filePath></filePath>
</attachment>
</attachments>
</test-case>
This would reduce the need for ScreenHelper.
We need a new package which will be automatically detected by NUnit Engine.
Related issue: nunit/nunit-console#487
Hi!
We updated our NUnit version today from 3.7.1 to version 3.9.0 which was released two days ago.
https://github.com/nunit/nunit/releases/tag/3.9
Unfortunately we have now troubles getting Screenshots for our GHPReports.
This is the error message we get:
System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' at Ghpr.NUnit.Utils.ScreenHelper.SaveScreenshot(Byte[] screenBytes)
We figured out, that there is still a reference to NUnit 3.7.1.
Would you mind updating it to the latest version and plan a release for GHPReporter?
Steps to reproduce
Add screenshot to NUnit TestContext via AddtestAttachment method
Expected behavior
Screenshot should only be displayed once
Desktop (please complete the following information):
Describe the bug
I am trying to add screenshots to the GHP report by using Nunit Test Attachments. The attachment is in the test result xml file, but it is not showing up in the html report.
Here is the screenshot code. This occurs in [TearDown]:
var screenshot = ((ITakesScreenshot)Driver.Get()).GetScreenshot();
string fileName = CurrentTestNameToJPG();
screenshot.SaveAsFile(fileName);
TestContext.AddTestAttachment(fileName, "Failure Screenshot");
And here is the attachment in the xml file:
<attachments> <attachment> <filePath>C:\Screenshots\TQAA1271_SuccessfulStudentLogin_20190506_16-47-15.jpeg</filePath> <description> <![CDATA[Failure Screenshot]]> </description> </attachment> </attachments>
Expected behavior
The screenshot should show up in the GHP report under "Screenshots"
GHPR Version - 0.8.0.2
NUnit 3 Console - 3.7
Hi, I have a problem with report generation. I run my tests with ConsoleRunner (or Console - the same result) and after the tests finished, the folder with a report is generated but looks empty
The strange thing is the screenshot, as well as TestResult.xml file, is placed in the working directory, not in the report folder.
Here is my Ghpr.NUnit.Settings.json (default values):
Build folder
report folder:
_GHPReporter_Core_Report.zip
my ConsoleRunner:
NUnit.ConsoleRunner.3.11.1.zip
Screenshot is added by this method: TestContext.AddTestAttachment(screenShotPath);
Thak you for help in advance.
I downloaded the https://github.com/GHPReporter/Ghpr.NUnit.Examples
1 When I use NuGet to download the Ghpr.Console and compile the Ghpr.NUnit.Examples. It will display error that "Console.WriteLine()" can't parsed in .cs files. I need to use System.Console.Write() in .cs files to pass the build.
So could someone update the Ghpr.Console plug-in to mitigate the build error?
In fact, there is no nunit.bundle.addins files in the package of NUnit.ConsoleRunner.3.10.0. It only has nunit.nuget.addins in tools directory of NUnit.ConsoleRunner.3.10.0.
I added below content in
../../../../build/Ghpr.NUnit.dll
So could someone update the instruction?
After I modify the Ghpr.NUnit.Settings.json to latest version and copy it to the generated build directory of Ghpr.NUnit.Examples.
Then I use nunit3-console to generate .xml file and use ghph.console to generate html format file successfully.
Prepare the release by updating .nuspec
file and adding support for .NET Core 3.0
Ghpr.NUnit.Settings.json could not be read
Hello,
There is new version of Newtonsoft.Json: v11
Upgrading to it causes the following error:
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ----> System.TypeInitializationException : The type initializer for 'Ghpr.NUnit.Extensions.GhprEventListener' threw an exception. ----> System.IO.FileNotFoundException : Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependenci es. The system cannot find the file specified.
It would be much appreciated if you cold update and add the support for new version.
Thanks in advance!
Describe the bug
Looking at the NUNIT log, the tests ran from:
start-time="2019-10-07 02:51:57Z"
end-time="2019-10-07 07:10:49Z"
duration="15532.193087"
But the report is displaying:
Start datetime: 2019-10-06 22:51:58
Finish datetime: 2019-10-07 03:10:49
Duration: 04:18:51.00
Start datetime has the wrong day and time!
Expected behavior
Was expecting to see something along the lines of:
Start datetime: 2019-10-07 02:51:57
Finish datetime: 2019-10-07 07:10:49
The NuGet packages I'm using are the latest:
Hello,
I followed the steps from the github tutorial, but everytime i run my tests (2 selenium tests, nunit, c#) via the console runner, the generated json files are created with 0 results.
{"testRunFiles":[],"runInfo":{"guid":"2a45c56d-7034-4004-b110-415ec14891a3","start":"2017-10-09T13:29:37.3339941+02:00","finish":"2017-10-09T13:30:26.2869285+02:00","fileName":"run_2a45c56d-7034-4004-b110-415ec14891a3.json"},"sprint":"","name":"","summary":{"total":0,"success":0,"errors":0,"failures":0,"inconclusive":0,"ignored":0,"unknown":0}}
Regards,
Kais
Screenshot is not displaying in the GHPReport
From a Selenium Test, I'm adding creating a screen shot and adding it to the NUNIT log:
TestContext.AddTestAttachment("C:\temp\emailName.JPG");
Generated XML looks something like:
To generate the GHPReport, I'm including NuGet packages:
I'm expecting to see the .jpg in the Screenshots link, but it does not display:
The test_20191023_191447000.json look like:
{
"name": "ParallelTest_A_00",
"fullName": "AutomationTests.ParallelTests.ParallelTest_A.ParallelTest_A_00",
"description": null,
"duration": 0.262805,
"testStackTrace": " at AutomationTests.Base.BaseTest.ExecuteTest(Action action, DriverType driverType, String strTestName) in C:\TFS\QAAutomation\AutomationTests\Base\BaseTest.cs:line 71\r\n at AutomationTests.ParallelTests.ParallelTest_A.ParallelTest_A_00() in C:\TFS\QAAutomation\AutomationTests\ParallelTest_A.cs:line 106",
"testMessage": "System.Exception : Retries Exceeded. Exception: NUnit.Framework.AssertionException: Expected: True\r\n But was: False\r\n\r\n at NUnit.Framework.Assert.ReportFailure(String message) in D:\a\1\s\src\NUnitFramework\framework\Assert.cs:line 394\r\n at NUnit.Framework.Assert.That[TActual](TActual actual, IResolveConstraint expression, String message, Object[] args) in D:\a\1\s\src\NUnitFramework\framework\Assert.That.cs:line 241\r\n at AutomationTests.ParallelTests.ParallelTest_A.<>c.<ParallelTest_A_00>b__2_0() in C:\TFS\QAAutomation\AutomationTests\ParallelTest_A.cs:line 104\r\n at AutomationTests.Base.BaseTest.ExecuteTest(Action action, DriverType driverType, String strTestName) in C:\TFS\QAAutomation\AutomationTests\Base\BaseTest.cs:line 46 1) Expected: True\r\n But was: False\r\n\r\n",
"result": "Failed: Error",
"testType": null,
"output": {
"itemName": "test_output_20191023_191447000.json",
"date": "2019-10-23T19:14:47Z"
},
"priority": null,
"categories": [
"P22"
],
"testInfo": {
"guid": "493c9583-7c24-0582-5194-66ed161b96b3",
"start": "2019-10-23T19:14:46Z",
"finish": "2019-10-23T19:14:47Z",
"itemName": "test_20191023_191447000.json"
},
"runGuid": "651dc1f6-0ead-4436-b808-1998debd6979",
"screenshots": [],
"events": [],
"testData": [],
"FailedOrBroken": true,
"TestResult": 2
}
Desktop (please complete the following information):
It appears that my test results are not being properly written to the reporting tool. When viewing the report, I see the number of runs, and dates for those runs, but upon drilling into the individual runs, the main statistics and test list show that no tests were run.
Attached is my TestResults.xml files and the report generated from this run. The report uses the example data provided. TestResult.zip
Do you have any suggestions as to what I may have missed during the initial installation? Any help would be appreciated.
We need to create a new console application to generate the report from NUnit .xml test result file
Hi,
Files are generated when I ran the Nunit console application but when i open the index file and navigating further not showing any data. it is just showing empty values
Please help me on this.
Regards,
Nagarjuna
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.