Class WebDriverElementValidationsBuilder
java.lang.Object
com.shaft.validation.internal.WebDriverElementValidationsBuilder
- All Implemented Interfaces:
ElementAssertions
-
Constructor Summary
ConstructorsConstructorDescriptionWebDriverElementValidationsBuilder(ValidationEnums.ValidationCategory validationCategory, org.openqa.selenium.WebDriver driver, org.openqa.selenium.By locator, StringBuilder reportMessageBuilder) -
Method Summary
Modifier and TypeMethodDescriptionUse this to check against a certain element attributecssProperty(String elementCssProperty) Use this to check against a certain element attributeUse this to check that the target element does not existUse this to check that the target element does not match a reference image (using the Artificial Intelligence library OpenCV).doesNotMatchReferenceImage(ValidationEnums.VisualValidationEngine visualValidationEngine) Use this to check that the target element does not match a reference image.domAttribute(String domAttribute) domProperty(String domProperty) exists()Use this to check that the target element existsUse this to check against the provided elements checked attributeUse this to check against the provided elements disabled attributeUse this to check against the provided elements disabled attributeisHidden()Use this to check against the provided elements hidden attributeUse this to check against the provided elements checked attributeUse this to check against the provided elements selected attributeUse this to check against the provided elements selected attributeUse this to check against the provided elements hidden attributeUse this to check that the target element matches a reference image (using the Artificial Intelligence library SHUTTERBUG).matchesReferenceImage(ValidationEnums.VisualValidationEngine visualValidationEngine) Use this to check that the target element matches a reference image.Use this to check against a certain element attributetext()Use this to check against the provided elements text attributeUse this to check against the provided elements text attribute after it's trimmed (all leading and trailing space removed)
-
Constructor Details
-
WebDriverElementValidationsBuilder
public WebDriverElementValidationsBuilder(ValidationEnums.ValidationCategory validationCategory, org.openqa.selenium.WebDriver driver, org.openqa.selenium.By locator, StringBuilder reportMessageBuilder)
-
-
Method Details
-
exists
Use this to check that the target element exists- Specified by:
existsin interfaceElementAssertions- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotExist
Use this to check that the target element does not exist- Specified by:
doesNotExistin interfaceElementAssertions- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
matchesReferenceImage
Use this to check that the target element matches a reference image (using the Artificial Intelligence library SHUTTERBUG). On the first test run this method will take a screenshot of the target element and the test will pass, and on following runs the element will be compared against that reference image. The reference images are stored under src/test/resources/DynamicObjectRepository for later maintenance- Specified by:
matchesReferenceImagein interfaceElementAssertions- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
matchesReferenceImage
public ValidationsExecutor matchesReferenceImage(ValidationEnums.VisualValidationEngine visualValidationEngine) Use this to check that the target element matches a reference image.- Specified by:
matchesReferenceImagein interfaceElementAssertions- Parameters:
visualValidationEngine- the selected visualValidationEngine that will be used to perform the image comparison- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotMatchReferenceImage
Use this to check that the target element does not match a reference image (using the Artificial Intelligence library OpenCV). On the first test run this method will take a screenshot of the target element and the test will pass, and on following runs the element will be compared against that reference image. The reference images are stored under src/test/resources/DynamicObjectRepository for later maintenance- Specified by:
doesNotMatchReferenceImagein interfaceElementAssertions- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotMatchReferenceImage
public ValidationsExecutor doesNotMatchReferenceImage(ValidationEnums.VisualValidationEngine visualValidationEngine) Use this to check that the target element does not match a reference image.- Specified by:
doesNotMatchReferenceImagein interfaceElementAssertions- Parameters:
visualValidationEngine- the selected visualValidationEngine that will be used to perform the image comparison- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
attribute
Use this to check against a certain element attribute- Specified by:
attributein interfaceElementAssertions- Parameters:
attribute- the target element attribute that will be checked against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
domAttribute
- Specified by:
domAttributein interfaceElementAssertions
-
domProperty
- Specified by:
domPropertyin interfaceElementAssertions
-
property
Use this to check against a certain element attribute- Specified by:
propertyin interfaceElementAssertions- Parameters:
domProperty- the target element DOM property that will be checked against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isSelected
Use this to check against the provided elements selected attribute- Specified by:
isSelectedin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isChecked
Use this to check against the provided elements checked attribute- Specified by:
isCheckedin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isVisible
Use this to check against the provided elements hidden attribute- Specified by:
isVisiblein interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isEnabled
Use this to check against the provided elements disabled attribute- Specified by:
isEnabledin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isNotSelected
Use this to check against the provided elements selected attribute- Specified by:
isNotSelectedin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isNotChecked
Use this to check against the provided elements checked attribute- Specified by:
isNotCheckedin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isHidden
Use this to check against the provided elements hidden attribute- Specified by:
isHiddenin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isDisabled
Use this to check against the provided elements disabled attribute- Specified by:
isDisabledin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
text
Use this to check against the provided elements text attribute- Specified by:
textin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
textTrimmed
Use this to check against the provided elements text attribute after it's trimmed (all leading and trailing space removed)- Specified by:
textTrimmedin interfaceElementAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
cssProperty
Use this to check against a certain element attribute- Specified by:
cssPropertyin interfaceElementAssertions- Parameters:
elementCssProperty- the target element css property that will be checked against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-