From 87f3e7a9a4ec8e055c59a4b977f8518bd0a82a40 Mon Sep 17 00:00:00 2001 From: Chris Holt Date: Sun, 7 Sep 2014 21:09:44 -0500 Subject: [PATCH] canopy performance improvements --- Dojo/Canopy2048/Canopy2048.fsproj | 10 +++++----- Dojo/Canopy2048/Interactions.fs | 17 +++++++++++++---- Dojo/Canopy2048/Program.fs | 3 +++ Dojo/Canopy2048/packages.config | 10 +++++----- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Dojo/Canopy2048/Canopy2048.fsproj b/Dojo/Canopy2048/Canopy2048.fsproj index 9031d76..3916054 100644 --- a/Dojo/Canopy2048/Canopy2048.fsproj +++ b/Dojo/Canopy2048/Canopy2048.fsproj @@ -39,7 +39,7 @@ - packages\canopy.0.9.8\lib\canopy.dll + packages\canopy.0.9.14\lib\canopy.dll True @@ -47,11 +47,11 @@ True - packages\Newtonsoft.Json.5.0.1\lib\net40\Newtonsoft.Json.dll + packages\Newtonsoft.Json.6.0.5\lib\net40\Newtonsoft.Json.dll True - packages\SizSelCsZzz.0.3.35.0\lib\SizSelCsZzz.dll + packages\SizSelCsZzz.0.3.36.0\lib\SizSelCsZzz.dll True @@ -59,11 +59,11 @@ - packages\Selenium.WebDriver.2.41.0\lib\net40\WebDriver.dll + packages\Selenium.WebDriver.2.42.0\lib\net40\WebDriver.dll True - packages\Selenium.Support.2.41.0\lib\net40\WebDriver.Support.dll + packages\Selenium.Support.2.42.0\lib\net40\WebDriver.Support.dll True diff --git a/Dojo/Canopy2048/Interactions.fs b/Dojo/Canopy2048/Interactions.fs index 519274c..1b80015 100644 --- a/Dojo/Canopy2048/Interactions.fs +++ b/Dojo/Canopy2048/Interactions.fs @@ -5,13 +5,22 @@ open runner module Interactions = - let lost () = - match someElement ".game-message.game-over" with + let lostSelector = css ".game-message.game-over" + let winSelector = css ".game-message.game-won" + let gameOverSelector = css ".game-message.game-won, .game-message.game-over" + + let lost () = + match someElement <| lostSelector with + | None -> false + | Some(_) -> true + + let won () = + match someElement <| winSelector with | None -> false | Some(_) -> true - let won () = - match someElement ".game-message.game-won" with + let gameEnded () = + match someElement <| gameOverSelector with | None -> false | Some(_) -> true diff --git a/Dojo/Canopy2048/Program.fs b/Dojo/Canopy2048/Program.fs index d018fc0..1497bc5 100644 --- a/Dojo/Canopy2048/Program.fs +++ b/Dojo/Canopy2048/Program.fs @@ -39,6 +39,9 @@ open Interactions module program = + canopy.configuration.optimizeBySkippingIFrameCheck <- true + canopy.configuration.optimizeByDisablingCoverageReport <- true + "starting a game of 2048" &&& fun _ -> printfn "Game started." diff --git a/Dojo/Canopy2048/packages.config b/Dojo/Canopy2048/packages.config index d64cd98..1c8ffd4 100644 --- a/Dojo/Canopy2048/packages.config +++ b/Dojo/Canopy2048/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + \ No newline at end of file