Package com.shaft.validation
Class WebDriverElementValidationsBuilder
java.lang.Object
com.shaft.validation.WebDriverElementValidationsBuilder
-
Constructor Summary
ConstructorDescriptionWebDriverElementValidationsBuilder
(com.shaft.validation.ValidationEnums.ValidationCategory validationCategory, org.openqa.selenium.WebDriver driver, org.openqa.selenium.By locator, StringBuilder reportMessageBuilder) -
Method Summary
Modifier and TypeMethodDescriptionattribute
(ValidationEnums.ElementAttribute elementAttribute) Deprecated.Use 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.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.text()
Use this to check against the provided elements text attribute
-
Constructor Details
-
WebDriverElementValidationsBuilder
public WebDriverElementValidationsBuilder(com.shaft.validation.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- 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- 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- 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.- 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- 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.- 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- Parameters:
elementAttribute
- the target element attribute that will be checked against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
attribute
@Deprecated public NativeValidationsBuilder attribute(ValidationEnums.ElementAttribute elementAttribute) Deprecated.Use this to check against a certain element attribute- Parameters:
elementAttribute
- the target element attribute 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- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isChecked
Use this to check against the provided elements checked attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isVisible
Use this to check against the provided elements hidden attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isEnabled
Use this to check against the provided elements disabled attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isNotSelected
Use this to check against the provided elements selected attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isNotChecked
Use this to check against the provided elements checked attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isHidden
Use this to check against the provided elements hidden attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
isDisabled
Use this to check against the provided elements disabled attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
text
Use this to check against the provided elements text attribute- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
cssProperty
Use this to check against a certain element attribute- Parameters:
elementCssProperty
- the target element css property that will be checked against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-