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

Add Output from OneTimeSetup and OneTimeTearDown Methods #36

Closed seanhotaling closed 6 years ago

seanhotaling commented 6 years ago

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.

elv1s42 commented 6 years ago

Hi @sean-hotaling, Thank you for this issue. I'll try to investigate both of the solutions and come back to discuss what solution would be more useful.

Thank you

elv1s42 commented 6 years ago

Hi @sean-hotaling !

I think this should be implemented as a separate tab on test run page. There is a plan to move each test output into separate file: https://github.com/GHPReporter/Ghpr.Core/issues/40 This file should also include output from test-suite. Adding test-suite output to collapsible test list will slow down loading of this list because we will have to load output of each test.

Can you please let me know if it makes sense to you?

Thank you

seanhotaling commented 6 years ago

@elv1s42, yes. That makes sense to me.

elv1s42 commented 6 years ago

All additional output will be stored under a separate tab like this: image

elv1s42 commented 6 years ago

Hi @sean-hotaling Works fine for your .xml file (tested locally):

image

I'll include this in the next release

seanhotaling commented 6 years ago

@elv1s42, awesome. I will look for the next release then. Thanks.

elv1s42 commented 6 years ago

This now has been released. Please see the release notes here

seanhotaling commented 6 years ago

@elv1s42, this works great. Thanks!