From 8b39af46272c728d1ecaa717b5730341ffe2b37c Mon Sep 17 00:00:00 2001 From: Chris Holt Date: Wed, 18 May 2016 17:29:50 -0600 Subject: [PATCH] add notContains for #263 --- src/canopy/canopy.fs | 4 ++++ src/canopy/types.fs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/canopy/canopy.fs b/src/canopy/canopy.fs index 7ce10b10..ddd5716c 100644 --- a/src/canopy/canopy.fs +++ b/src/canopy/canopy.fs @@ -470,6 +470,10 @@ let contains (value1 : string) (value2 : string) = if (value2.Contains(value1) <> true) then raise (CanopyContainsFailedException(sprintf "contains check failed. %s does not contain %s" value2 value1)) +let notContains (value1 : string) (value2 : string) = + if (value2.Contains(value1) = true) then + raise (CanopyNotContainsFailedException(sprintf "notContains check failed. %s does contain %s" value2 value1)) + let count cssSelector count = try wait compareTimeout (fun _ -> (unreliableElements cssSelector).Length = count) diff --git a/src/canopy/types.fs b/src/canopy/types.fs index 4481926b..cce94d16 100644 --- a/src/canopy/types.fs +++ b/src/canopy/types.fs @@ -20,6 +20,7 @@ type CanopyNotEqualsFailedException(message) = inherit CanopyException(message) type CanopyValueNotInListException(message) = inherit CanopyException(message) type CanopyValueInListException(message) = inherit CanopyException(message) type CanopyContainsFailedException(message) = inherit CanopyException(message) +type CanopyNotContainsFailedException(message) = inherit CanopyException(message) type CanopyCountException(message) = inherit CanopyException(message) type CanopyDisplayedFailedException(message) = inherit CanopyException(message) type CanopyNotDisplayedFailedException(message) = inherit CanopyException(message)