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

Setting run name on the fly #21

Closed jmemmons closed 6 years ago

jmemmons commented 7 years ago

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).

elv1s42 commented 7 years ago

Hi @jmemmons,

I agree with you, this would be a useful feature. But I am not sure about implementation. This could be done if NUnit Console supported custom attributes, but it doesn't.

Do you have any ideas of implementation?

jmemmons commented 7 years ago

Sorry to respond so late, company I work for has a release rolling out soon so it's been hectic. The work around that I've been using is:

I use a custom AutomationConsoleRunner.exe that I made to loop through the roles as necessary and write to the GHP Reporter directory which is working beautifully. However, my employer wants to see screenshots which doesn't seem to work. The screenshots are not getting saved so that's a whole 'nother issue.

I feel like GHPReporter would be better, at least in my circumstance, if it were a .dll that could be included in the test project which would allow for more choices in customizations (custom names/folder locations for screenshots, etc). I'll do a pull of the project and see what's possible. I may create a fork if it ends up being an entire rework of the application.

elv1s42 commented 7 years ago

Hi @jmemmons , please let me know if I can help you somehow.

Regarding screenshots: there is some information here https://github.com/GHPReporter/Ghpr.NUnit#how-to-work-with-screenshots

Custom names/folder locations for screenshots is not very easy to implement, as all these names are used for links.

elv1s42 commented 6 years ago

Hi @jmemmons ! Can you please let me know if this is still required?

It will be possible to add extra method in the Core reposiroty codebase which will give an ability to set up custom run name during test run (from tests code, for example, inside [OneTimeSetUp] method)

Thank you

jmemmons commented 6 years ago

Hey, I wanted to let you know I was able to get what I needed to work. I wrote a script that figures out what the test name should be, then writes the test name to the Settings.json file before running the tests. I'm closing this since what I needed isn't really a feature for the tool. I love the tool by the way. The managers at the company I work for really like this report.