Skip to content

Commit

Permalink
Fixed for some tests not showing up in html reporter #127
Browse files Browse the repository at this point in the history
  • Loading branch information
lefthandedgoat committed Jan 27, 2014
1 parent d6d751b commit 5958cd6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
9 changes: 9 additions & 0 deletions basictests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
<assemblyIdentity name="WebDriver.Support" publicKeyToken="1c2bd1631853048f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.32.0.0" newVersion="2.32.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.0.0" />
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.0.0" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
3 changes: 2 additions & 1 deletion basictests/basictests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<RootNamespace>basictests</RootNamespace>
<AssemblyName>basictests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<Name>basictests</Name>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
Expand Down
2 changes: 1 addition & 1 deletion canopy/canopy.fs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let sleep seconds =

let puts text =
reporter.write text
let escapedText = text.Replace("'", @"\'")
let escapedText = System.Web.HttpUtility.JavaScriptStringEncode(text)
let info = "
var infoDiv = document.getElementById('canopy_info_div');
if(!infoDiv) { infoDiv = document.createElement('div'); }
Expand Down
1 change: 1 addition & 0 deletions canopy/canopy.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="WebDriver">
<HintPath>..\packages\Selenium.WebDriver.2.38.0\lib\net40\WebDriver.dll</HintPath>
Expand Down
8 changes: 6 additions & 2 deletions canopy/reporters.fs
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@ type LiveHtmlReporter(browser : BrowserStartMode, driverPath : string) =

interface IReporter with
member this.pass () =
this.swallowedJS (sprintf "addToContext('%s', 'Pass', '%s', '%s');" context test "")
let escapedContext = System.Web.HttpUtility.JavaScriptStringEncode(context)
let escapedTest = System.Web.HttpUtility.JavaScriptStringEncode(test)
this.swallowedJS (sprintf "addToContext('%s', 'Pass', '%s', '%s');" escapedContext escapedTest "")
consoleReporter.pass ()

member this.fail ex id ss =
this.swallowedJS (sprintf "addToContext('%s', 'Fail', '%s', '%s');" context test (Convert.ToBase64String(ss)))
let escapedContext = System.Web.HttpUtility.JavaScriptStringEncode(context)
let escapedTest = System.Web.HttpUtility.JavaScriptStringEncode(test)
this.swallowedJS (sprintf "addToContext('%s', 'Fail', '%s', '%s');" escapedContext escapedTest (Convert.ToBase64String(ss)))
consoleReporter.fail ex id ss

member this.describe d =
Expand Down

0 comments on commit 5958cd6

Please sign in to comment.