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

Blank report is generated #16

Closed mcopjan closed 7 years ago

mcopjan commented 7 years ago

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

image

elv1s42 commented 7 years ago

Hi @mcopjan ! Thank you for this issue. Sorry, but I don't see the attached report. Please load it again, I beleive it was not attached.

By the way, are you following this short (https://github.com/GHPReporter/Ghpr.NUnit#view-report-locally) instruction about viewing report locally?

mcopjan commented 7 years ago

Hi @elv1s42 , thanks for your quick response! To be honest I have tried to open the report in Chrome and IE and ignored that note about Firefox (as I did not have it installed don my PC). When I tried to open the report in Firefox with described settings, all seem to be good. Is there a way how to open this report in Chrome/IE please?

elv1s42 commented 7 years ago

Yeah, I will provide some steps after the next release, it will be tomorrow I think. The main idea is to let your browser load data from local files, this feature is blocked by default for all browsers.

Another way is to use local server, where you can put the report.

In any case I will let you know when new release is available.

mcopjan commented 7 years ago

Thank you @elv1s42 I do like this reporting tool. Well done!

elv1s42 commented 7 years ago

Hi @mcopjan ! I have updated 'View report locally' instruction. Instructions for Chrome are added.

Also new version is released, v 0.4.5, I would suggest you using this new version.

elv1s42 commented 7 years ago

@mcopjan please note, that if you will run tests and generate report into the folder where report already exists, you will need to delete all three index.html files and ghpr.controller.js file before test run (they will appear again during test run).

mcopjan commented 7 years ago

Hi @elv1s42, I tried to open a freshly generated report in Chrome with the parameter you suggested but the report still appears. All good in Firefox. Have you managed to display the report in Chrome?

elv1s42 commented 7 years ago

Hello @mcopjan ! Yes, it worked for me fine. Can you try to close all instances of Chrome (also you can check that there are no chrome.exe processes running) and after that try to run it with --allow-file-access-from-files option?

cold-flame commented 7 years ago

@mcopjan, The best way to open a report in Chrome is to deploy it on the site (not as a local file)

mcopjan commented 7 years ago

@elv1s42 I have closed all instances of Chrome and no chrome processes are running, yet the report is opened as blank >_> C:\Program Files (x86)\Google\Chrome\Application>.\chrome.exe --allow-file-access-from-files file:///C:/_GHPReporter_NUnit_Report4/index.html

@cold-flame thanks, it is definitely way to go in future but at the moment people would use GHPR locally, meaning they would have to deploy report html to local IIS which is overkill when all you want to do is just display an html file...

elv1s42 commented 7 years ago

Hi @mcopjan ! I've check it again and it worked for me. I've prepared a short instuction that you can use.

Please try the following steps:

  1. Close all running Chrome apps
  2. Make sure there are no processes 'Chrome.exe' running on your machine
  3. Launch 'cmd': 2017-04-04 11_02_26-run
  4. Run Chrome like this (using full path to exe file): 2017-04-04 12_14_28-select c__windows_system32_cmd exe
  5. Insert full path to index.html file of your report: 2017-04-04 12_15_36-
  6. View report locally: 2017-04-04 12_17_49-ghp report run page
mcopjan commented 7 years ago

@elv1s42 thanks man, i have done literally the same steps before with no effect then I checked version of my Chrome and noticed it is not the most up to date version. I am on version 57.0.2987.133 now and all good!

elv1s42 commented 7 years ago

Good, I've added link to my comment in README file (just in case anyone will need it in the future).

@mcopjan, thanks for confirmation that provided solution worked for you.

arnonra-tr commented 5 years ago

Hi @elv1s42 Thanks for all your work.

As to opening the report, I would recommend running a small http server locally, as per this response, running the server from where the report was generated.

Cheers..