Package com.shaft.validation
Class ValidationsBuilder
java.lang.Object
com.shaft.validation.ValidationsBuilder
-
Constructor Summary
ConstructorDescriptionValidationsBuilder
(com.shaft.validation.ValidationEnums.ValidationCategory validationCategory) -
Method Summary
Modifier and TypeMethodDescriptionbrowser
(org.openqa.selenium.WebDriver driver) Build a webdriver browser validation to check against the target browserelement
(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By locator) Build a webdriver element validation to check against the target elementBuild a file validation to check against the target fileForce fails the current validationBuild a number validation to check against the target numberBuild a native validation to check against the target objectBuild an API response validation to check against the target API response
-
Constructor Details
-
ValidationsBuilder
public ValidationsBuilder(com.shaft.validation.ValidationEnums.ValidationCategory validationCategory)
-
-
Method Details
-
object
Build a native validation to check against the target object- Parameters:
actualValue
- the actual object that will be compared against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
number
Build a number validation to check against the target number- Parameters:
actualValue
- the actual number that will be compared against- Returns:
- a NumberValidationsBuilder object to continue building your validation
-
element
public WebDriverElementValidationsBuilder element(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By locator) Build a webdriver element validation to check against the target element- Parameters:
driver
- the current instance of Selenium webdriverlocator
- the locator of the webElement under test (By xpath, id, selector, name ...etc)- Returns:
- a WebDriverElementValidationsBuilder object to continue building your validation
-
browser
Build a webdriver browser validation to check against the target browser- Parameters:
driver
- the current instance of Selenium webdriver- Returns:
- a WebDriverBrowserValidationsBuilder object to continue building your validation
-
response
Build an API response validation to check against the target API response- Parameters:
response
- the target API response object- Returns:
- a RestValidationsBuilder object to continue building your validation
-
file
Build a file validation to check against the target file- Parameters:
folderRelativePath
- relative path to the targetDirectoryfileName
- target fileName- Returns:
- a FileValidationsBuilder object to continue building your validation
-
forceFail
Force fails the current validation- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-