4

I'm working on a presentation demoing Canopy and I am trying to get the LiveHtmlReporter to work, but have not been successful. So far, I've been able to get it to open a browser that displays the Template and to save the report to disk, but the report never updates with the results of the test run. Both the browser and the saved report contain the default 0 Passed 0 Failed 0 Todo 0 Skipped. The console runner displays

0 minutes 3 seconds to execute
2 passed
0 failed
Not saving report
Not saving report

I have the following code

open types
open configuration
open reporters

reporter <- new LiveHtmlReporter(Firefox) :> IReporter

let liveHtmlReporter = reporter :?> LiveHtmlReporter
liveHtmlReporter.reportTemplateUrl <- @"http://localhost:56295/content/reporttemplate.html"
liveHtmlReporter.saveReportHtml @"C:\Code\CanopyDemo\" "report"

// Code for actual tests here 

I figure I'm missing something simple, but I'm not familiar enough with either Canopy or F# yet to spot what I'm missing.

Hamman359
  • 1,052
  • 2
  • 14
  • 27
  • 2
    Sorry I didnt see this earlier. I think there is a bug where it won't work if you dont define a context. Try adding 'context "tests"' above your test definitions and see if it works. You can also look at the source and there is a suite of tests that use the reporter and see if it works for you there. – lefthandedgoat Aug 15 '14 at 15:12

1 Answers1

1

There is similar question

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