简体   繁体   中英

F# canopy - how to use LiveHtmlReporter?

I am trying to get F# and canopy to log tests in html files.

So here it says that all I need to do is:

open configuration
open reporters
reporter <- new LiveHtmlReporter() :> IReporter

This didn't work for me. I managed to start the LiveHtmlReporter by using Chrome to start it. Now I am struggling to make it save the reports after tests are finished.

When I try to use:

reporter <- new LiveHtmlReporter(Chrome, "C:\\") :> IReporter
let liveHtmlReporter = reporter :?> LiveHtmlReporter
liveHtmlReporter.saveReportHtml @"C:\" "report"

It throws an InvalidOperationException was unhandled error at me before it get to the tests and doesn't save anything. Besides that, when the tests run - I can see only context titles, and test names are not printed - just Pass or Fail without test name.

Another thing is taking screenshot on error - it also doesn't happen.

I think I am doing wrong at the very bottom of my code. What is going wrong?

I had the same problem. This should help.

reporter <- new LiveHtmlReporter(Chrome, configuration.chromeDir) :> IReporter
let liveHtmlReporter = reporter :?> LiveHtmlReporter
liveHtmlReporter.reportPath <- Some "reports/AutomationResults"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM