Package dev.comfast.cf.common.conditions
Class Conditions
java.lang.Object
dev.comfast.cf.common.conditions.Conditions
Predefined conditions and factory methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ConditionPass if element is visible.static ConditionPass if element can be clicked. i.e. it exists, visible and enabledstatic ConditionPass if element is disabledstatic ConditionPass if element is enabledstatic ConditionPass if element is not visible.static ConditionPass if element exist in DOM. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Conditionstatic Conditioncondition(String name, Function<CfFoundLocator, Boolean> testFunc) Condition that pass if given testFunction pass.static ConditioncontainText(String expectedText) static ConditionhasAttribute(String name) static ConditionhasAttribute(String name, String expectedValue) static ConditionhasCssClass(String expectedClass) static Conditionstatic ConditionhaveCount(int expectedCount) static Conditionstatic Condition
-
Field Details
-
exists
Pass if element exist in DOM. Doesn't check visibility. -
appear
Pass if element is visible. -
disappear
Pass if element is not visible. -
beDisabled
Pass if element is disabled -
beEnabled
Pass if element is enabled -
beClickable
Pass if element can be clicked. i.e. it exists, visible and enabled
-
-
Constructor Details
-
Conditions
public Conditions()
-
-
Method Details
-
condition
Condition that pass if given testFunction pass.- Parameters:
name- of conditiontestFunc- function that will be executed against element- Returns:
- Condition implementation
-
not
- Returns:
- new Condition that negates given one. New name will have prefix: 'not '
- See Also:
-
not
- Returns:
- new Condition that negates given one.
- See Also:
-
allMatch
- Returns:
- new Condition that pass if all given conditions pass
-
hasAttribute
- Returns:
- Condition that will pass if element have given attribute not null
- See Also:
-
hasAttribute
- Returns:
- Condition that will pass if element have given attribute equals expectedValue
- See Also:
-
hasText
- Returns:
- Condition that will pass if element have exact given text
- See Also:
-
containText
- Returns:
- Condition that will pass if element have exact given text
- See Also:
-
hasCssClass
- Returns:
- Condition that will pass if element have given css class
- See Also:
-
haveCount
- Returns:
- Condition that will pass if matched element have given count.
- See Also:
-