diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b18082d6..78fb7ed6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -150,4 +150,7 @@ * Updated to Selenium 2.46 #### 0.9.28 - June 16 2015 -* Fix broken link to html reporter introduced in 0.9.27 \ No newline at end of file +* Fix broken link to html reporter introduced in 0.9.27 + +#### 0.9.29 - June 17 2015 +* Fix issue 203, using canopy for unit tests [Issue #203](https://github.com/lefthandedgoat/canopy/issues/203) \ No newline at end of file diff --git a/src/canopy/AssemblyInfo.fs b/src/canopy/AssemblyInfo.fs index b70f8663..5274705c 100644 --- a/src/canopy/AssemblyInfo.fs +++ b/src/canopy/AssemblyInfo.fs @@ -4,9 +4,9 @@ open System.Reflection [] [] [] -[] -[] +[] +[] do () module internal AssemblyVersionInformation = - let [] Version = "0.9.28" + let [] Version = "0.9.29" diff --git a/src/canopy/runner.fs b/src/canopy/runner.fs index ac5736ce..1909d295 100644 --- a/src/canopy/runner.fs +++ b/src/canopy/runner.fs @@ -74,11 +74,12 @@ let fail (ex : Exception) id = // Don't fail the runner itself, but report it. reporter.write (sprintf "Error during fail reporting: %s" (failExc.ToString())) reporter.fail ex id Array.empty +let safelyGetUrl () = if browser = null then "no browser = no url" else browser.Url let failSuite (ex: Exception) (suite : suite) = let reportFailedTest (ex: Exception) (test : Test) = reporter.testStart test.Id - fail ex test.Id browser.Url + fail ex test.Id <| safelyGetUrl() reporter.testEnd test.Id suite.Tests |> List.iter (fun test -> reportFailedTest ex test) @@ -104,7 +105,7 @@ let run () = pass() with | ex when failureMessage <> null && failureMessage = ex.Message -> pass() - | ex -> fail ex test.Id browser.Url + | ex -> fail ex test.Id <| safelyGetUrl() reporter.testEnd test.Id failureMessage <- null @@ -172,4 +173,4 @@ let runFor browsers = once (fun _ -> switchTo browser) suites <- suites @ currentSuites) | _ -> raise <| Exception "I dont know what you have given me" - run () \ No newline at end of file + \ No newline at end of file