diff --git a/basictests/Program.fs b/basictests/Program.fs index d6d510ed..c0e3f582 100644 --- a/basictests/Program.fs +++ b/basictests/Program.fs @@ -6,7 +6,7 @@ open runner open configuration open reporters -start phantomJS +start chrome let mainBrowser = browser elementTimeout <- 3.0 compareTimeout <- 3.0 @@ -390,6 +390,10 @@ context "other tests" !^ "http://lefthandedgoat.github.io/canopy/testpages/notDisplayed" notDisplayed "#notDisplayed") +"notDisplayed test for element that is not on the screen" &&& (fun _ -> + !^ "http://lefthandedgoat.github.io/canopy/testpages/notDisplayed" + notDisplayed "#nalsjdfalfalsdjfalsjfaljsflsjf") + "count test" &&& (fun _ -> !^ "http://lefthandedgoat.github.io/canopy/testpages/count" count ".number" 5) diff --git a/canopy/canopy.fs b/canopy/canopy.fs index 60ca3f07..a61b000f 100644 --- a/canopy/canopy.fs +++ b/canopy/canopy.fs @@ -474,7 +474,7 @@ let displayed cssSelector = let notDisplayed cssSelector = try - wait compareTimeout (fun _ -> not(shown cssSelector)) + wait compareTimeout (fun _ -> (elements cssSelector |> List.isEmpty) || not(shown cssSelector)) () with | :? WebDriverTimeoutException -> raise (CanopyNotDisplayedFailedException(sprintf "notDisplay checked for %s failed." cssSelector));