Package com.codeborne.selenide
Class CollectionCondition
- java.lang.Object
-
- com.codeborne.selenide.CollectionCondition
-
- All Implemented Interfaces:
com.google.common.base.Predicate<java.util.List<org.openqa.selenium.WebElement>>,java.util.function.Predicate<java.util.List<org.openqa.selenium.WebElement>>
- Direct Known Subclasses:
AllMatch,AnyMatch,ExactTexts,ListSize,NoneMatch,SizeGreaterThan,SizeGreaterThanOrEqual,SizeLessThan,SizeLessThanOrEqual,SizeNotEqual
public abstract class CollectionCondition extends java.lang.Object implements com.google.common.base.Predicate<java.util.List<org.openqa.selenium.WebElement>>
-
-
Field Summary
Fields Modifier and Type Field Description static CollectionConditionemptyprotected java.lang.Stringexplanation
-
Constructor Summary
Constructors Constructor Description CollectionCondition()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CollectionConditionallMatch(java.lang.String description, java.util.function.Predicate<org.openqa.selenium.WebElement> predicate)Checks if ALL elements of this collection match the provided predicatestatic CollectionConditionanyMatch(java.lang.String description, java.util.function.Predicate<org.openqa.selenium.WebElement> predicate)Checks if ANY elements of this collection match the provided predicateabstract booleanapplyNull()CollectionConditionbecause(java.lang.String explanation)Should be used for explaining the reason of conditionstatic CollectionConditionexactTexts(java.lang.String... expectedTexts)Checks that given collection has given texts (each collection element EQUALS TO corresponding text)static CollectionConditionexactTexts(java.util.List<java.lang.String> expectedTexts)Checks that given collection has given texts (each collection element EQUALS TO corresponding text)abstract voidfail(WebElementsCollection collection, java.util.List<org.openqa.selenium.WebElement> elements, java.lang.Exception lastError, long timeoutMs)static CollectionConditionnoneMatch(java.lang.String description, java.util.function.Predicate<org.openqa.selenium.WebElement> predicate)Checks if NONE elements of this collection match the provided predicatestatic CollectionConditionsize(int expectedSize)Checks that collection has the given sizestatic CollectionConditionsizeGreaterThan(int expectedSize)static CollectionConditionsizeGreaterThanOrEqual(int expectedSize)static CollectionConditionsizeLessThan(int expectedSize)static CollectionConditionsizeLessThanOrEqual(int size)static CollectionConditionsizeNotEqual(int expectedSize)static CollectionConditiontexts(java.lang.String... expectedTexts)Checks that given collection has given texts (each collection element CONTAINS corresponding text)static CollectionConditiontexts(java.util.List<java.lang.String> expectedTexts)Checks that given collection has given texts (each collection element CONTAINS corresponding text)static CollectionConditiontextsInAnyOrder(java.lang.String... expectedTexts)Checks that given collection has given texts in any order (each collection element CONTAINS corresponding text)static CollectionConditiontextsInAnyOrder(java.util.List<java.lang.String> expectedTexts)Checks that given collection has given texts in any order (each collection element CONTAINS corresponding text)
-
-
-
Field Detail
-
explanation
protected java.lang.String explanation
-
empty
public static CollectionCondition empty
-
-
Method Detail
-
fail
public abstract void fail(WebElementsCollection collection, java.util.List<org.openqa.selenium.WebElement> elements, java.lang.Exception lastError, long timeoutMs)
-
size
public static CollectionCondition size(int expectedSize)
Checks that collection has the given size
-
sizeGreaterThan
public static CollectionCondition sizeGreaterThan(int expectedSize)
-
sizeGreaterThanOrEqual
public static CollectionCondition sizeGreaterThanOrEqual(int expectedSize)
-
sizeLessThan
public static CollectionCondition sizeLessThan(int expectedSize)
-
sizeLessThanOrEqual
public static CollectionCondition sizeLessThanOrEqual(int size)
-
sizeNotEqual
public static CollectionCondition sizeNotEqual(int expectedSize)
-
texts
public static CollectionCondition texts(java.lang.String... expectedTexts)
Checks that given collection has given texts (each collection element CONTAINS corresponding text)NB! Ignores multiple whitespaces between words
-
texts
public static CollectionCondition texts(java.util.List<java.lang.String> expectedTexts)
Checks that given collection has given texts (each collection element CONTAINS corresponding text)NB! Ignores multiple whitespaces between words
-
textsInAnyOrder
public static CollectionCondition textsInAnyOrder(java.lang.String... expectedTexts)
Checks that given collection has given texts in any order (each collection element CONTAINS corresponding text)NB! Ignores multiple whitespaces between words
-
textsInAnyOrder
public static CollectionCondition textsInAnyOrder(java.util.List<java.lang.String> expectedTexts)
Checks that given collection has given texts in any order (each collection element CONTAINS corresponding text)NB! Ignores multiple whitespaces between words
-
exactTexts
public static CollectionCondition exactTexts(java.lang.String... expectedTexts)
Checks that given collection has given texts (each collection element EQUALS TO corresponding text)NB! Ignores multiple whitespaces between words
-
exactTexts
public static CollectionCondition exactTexts(java.util.List<java.lang.String> expectedTexts)
Checks that given collection has given texts (each collection element EQUALS TO corresponding text)NB! Ignores multiple whitespaces between words
-
anyMatch
public static CollectionCondition anyMatch(java.lang.String description, java.util.function.Predicate<org.openqa.selenium.WebElement> predicate)
Checks if ANY elements of this collection match the provided predicate- Parameters:
description- The description of the given predicatepredicate- thePredicateto match
-
allMatch
public static CollectionCondition allMatch(java.lang.String description, java.util.function.Predicate<org.openqa.selenium.WebElement> predicate)
Checks if ALL elements of this collection match the provided predicate- Parameters:
description- The description of the given predicatepredicate- thePredicateto match
-
noneMatch
public static CollectionCondition noneMatch(java.lang.String description, java.util.function.Predicate<org.openqa.selenium.WebElement> predicate)
Checks if NONE elements of this collection match the provided predicate- Parameters:
description- The description of the given predicatepredicate- thePredicateto match
-
because
public CollectionCondition because(java.lang.String explanation)
Should be used for explaining the reason of condition
-
applyNull
public abstract boolean applyNull()
-
-