Class ValidationsBuilder

java.lang.Object
com.shaft.validation.ValidationsBuilder

public class ValidationsBuilder extends Object
  • Constructor Details

    • ValidationsBuilder

      public ValidationsBuilder(com.shaft.validation.ValidationEnums.ValidationCategory validationCategory)
  • Method Details

    • object

      public NativeValidationsBuilder object(Object actualValue)
      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

      public NumberValidationsBuilder number(Number actualValue)
      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 webdriver
      locator - the locator of the webElement under test (By xpath, id, selector, name ...etc)
      Returns:
      a WebDriverElementValidationsBuilder object to continue building your validation
    • browser

      public WebDriverBrowserValidationsBuilder browser(org.openqa.selenium.WebDriver driver)
      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

      public RestValidationsBuilder response(Object 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

      public FileValidationsBuilder file(String folderRelativePath, String fileName)
      Build a file validation to check against the target file
      Parameters:
      folderRelativePath - relative path to the targetDirectory
      fileName - target fileName
      Returns:
      a FileValidationsBuilder object to continue building your validation
    • forceFail

      public ValidationsExecutor forceFail()
      Force fails the current validation
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation