Class AssertionSteps

java.lang.Object
com.shaft.cucumber.AssertionSteps

public class AssertionSteps extends Object
  • Constructor Details

  • Method Details

    • assertBrowserAttributeEquals

      @Then("I Assert that the {string} attribute of the browser, equals {string}") public void assertBrowserAttributeEquals(String browserAttribute, String expectedValue)
      Asserts browser attribute equals expectedValue. Supports CurrentUrl, PageSource, Title, WindowHandle, WindowPosition, WindowSize.
      Parameters:
      browserAttribute - the desired attribute of the browser window under test
      expectedValue - the expected value (test data) of this assertion
    • assertBrowserAttributeDoesNotEqual

      @Then("I Assert that the {string} attribute of the browser, does not equal {string}") public void assertBrowserAttributeDoesNotEqual(String browserAttribute, String expectedValue)
      Asserts browser attribute does not equal expectedValue. Supports CurrentUrl, PageSource, Title, WindowHandle, WindowPosition, WindowSize.
      Parameters:
      browserAttribute - the desired attribute of the browser window under test
      expectedValue - the expected value (test data) of this assertion
    • assertBrowserAttributeContains

      @Then("I Assert that the {string} attribute of the browser, contains {string}") public void assertBrowserAttributeContains(String browserAttribute, String expectedValue)
      Asserts browser attribute contains expectedValue. Supports CurrentUrl, PageSource, Title, WindowHandle, WindowPosition, WindowSize.
      Parameters:
      browserAttribute - the desired attribute of the browser window under test
      expectedValue - the expected value (test data) of this assertion
    • assertBrowserAttributeDoesNotContain

      @Then("I Assert that the {string} attribute of the browser, does not contain {string}") public void assertBrowserAttributeDoesNotContain(String browserAttribute, String expectedValue)
      Asserts browser attribute does not contain expectedValue. Supports CurrentUrl, PageSource, Title, WindowHandle, WindowPosition, WindowSize.
      Parameters:
      browserAttribute - the desired attribute of the browser window under test
      expectedValue - the expected value (test data) of this assertion
    • assertBrowserAttributeMatches

      @Then("I Assert that the {string} attribute of the browser, matches the regular expression {string}") public void assertBrowserAttributeMatches(String browserAttribute, String expectedValue)
      Asserts browser attribute matches expectedValue. Supports CurrentUrl, PageSource, Title, WindowHandle, WindowPosition, WindowSize.
      Parameters:
      browserAttribute - the desired attribute of the browser window under test
      expectedValue - the expected value (test data) of this assertion
    • assertBrowserAttributeDoesNotMatch

      @Then("I Assert that the {string} attribute of the browser, does not match the regular expression {string}") public void assertBrowserAttributeDoesNotMatch(String browserAttribute, String expectedValue)
      Asserts browser attribute does not match expectedValue. Supports CurrentUrl, PageSource, Title, WindowHandle, WindowPosition, WindowSize.
      Parameters:
      browserAttribute - the desired attribute of the browser window under test
      expectedValue - the expected value (test data) of this assertion
    • assertElementAttributeEquals

      @Then("I Assert that the {string} attribute of the element found by {string}: {string}, equals {string}") public void assertElementAttributeEquals(String elementAttribute, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement attribute equals expectedValue.
      Parameters:
      elementAttribute - the desired attribute of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementAttributeDoesNotEqual

      @Then("I Assert that the {string} attribute of the element found by {string}: {string}, does not equal {string}") public void assertElementAttributeDoesNotEqual(String elementAttribute, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement attribute does not equal expectedValue.
      Parameters:
      elementAttribute - the desired attribute of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementAttributeContains

      @Then("I Assert that the {string} attribute of the element found by {string}: {string}, contains {string}") public void assertElementAttributeContains(String elementAttribute, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement attribute contains expectedValue.
      Parameters:
      elementAttribute - the desired attribute of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementAttributeDoesNotContain

      @Then("I Assert that the {string} attribute of the element found by {string}: {string}, does not contain {string}") public void assertElementAttributeDoesNotContain(String elementAttribute, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement attribute does not contain expectedValue.
      Parameters:
      elementAttribute - the desired attribute of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementAttributeMatches

      @Then("I Assert that the {string} attribute of the element found by {string}: {string}, matches the regular expression {string}") public void assertElementAttributeMatches(String elementAttribute, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement attribute matches expectedValue.
      Parameters:
      elementAttribute - the desired attribute of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementAttributeDoesNotMatch

      @Then("I Assert that the {string} attribute of the element found by {string}: {string}, does not match the regular expression {string}") public void assertElementAttributeDoesNotMatch(String elementAttribute, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement attribute does not match expectedValue.
      Parameters:
      elementAttribute - the desired attribute of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementExists

      @Then("I Assert that the element found by {string}: {string}, does exist") public void assertElementExists(String locatorType, String locatorValue)
      Asserts that the webElement found using the provided driver and locator exists.
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementDoesNotExist

      @Then("I Assert that the element found by {string}: {string}, does not exist") public void assertElementDoesNotExist(String locatorType, String locatorValue)
      Asserts that the webElement found using the provided driver and locator does not exist.
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementCSSPropertyEquals

      @Then("I Assert that the {string} CSS property of the element found by {string}: {string}, equals {string}") public void assertElementCSSPropertyEquals(String elementCSSProperty, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement CSSProperty equals expectedValue.
      Parameters:
      elementCSSProperty - the target CSS property of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementCSSPropertyDoesNotEqual

      @Then("I Assert that the {string} CSS property of the element found by {string}: {string}, does not equal {string}") public void assertElementCSSPropertyDoesNotEqual(String elementCSSProperty, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement CSSProperty does not equal expectedValue.
      Parameters:
      elementCSSProperty - the target CSS property of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementCSSPropertyContains

      @Then("I Assert that the {string} CSS property of the element found by {string}: {string}, contains {string}") public void assertElementCSSPropertyContains(String elementCSSProperty, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement CSSProperty contains expectedValue.
      Parameters:
      elementCSSProperty - the target CSS property of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementCSSPropertyDoesNotContain

      @Then("I Assert that the {string} CSS property of the element found by {string}: {string}, does not contain {string}") public void assertElementCSSPropertyDoesNotContain(String elementCSSProperty, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement CSSProperty does not contain expectedValue.
      Parameters:
      elementCSSProperty - the target CSS property of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementCSSPropertyMatches

      @Then("I Assert that the {string} CSS property of the element found by {string}: {string}, matches the regular expression {string}") public void assertElementCSSPropertyMatches(String elementCSSProperty, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement CSSProperty matches expectedValue.
      Parameters:
      elementCSSProperty - the target CSS property of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementCSSPropertyDoesNotMatch

      @Then("I Assert that the {string} CSS property of the element found by {string}: {string}, does not match the regular expression {string}") public void assertElementCSSPropertyDoesNotMatch(String elementCSSProperty, String locatorType, String locatorValue, String expectedValue)
      Asserts webElement CSSProperty does not match expectedValue.
      Parameters:
      elementCSSProperty - the target CSS property of the webElement under test
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
      expectedValue - the expected value (test data) of this assertion
    • assertElementMatchesOpenCV

      @Then("I Assert that the element found by {string}: {string}, exactly matches with the expected reference image using Artificial Intelligence (OpenCV)") public void assertElementMatchesOpenCV(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementDoesNotMatchOpenCV

      @Then("I Assert that the element found by {string}: {string}, does not exactly match with the expected reference image using Artificial Intelligence (OpenCV)") public void assertElementDoesNotMatchOpenCV(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementMatchesExactEyes

      @Then("I Assert that the element found by {string}: {string}, exactly matches with the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementMatchesExactEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementDoesNotMatchExactEyes

      @Then("I Assert that the element found by {string}: {string}, does not exactly match with the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementDoesNotMatchExactEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementMatchesStrictEyes

      @Then("I Assert that the element found by {string}: {string}, strictly matches with the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementMatchesStrictEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementDoesNotMatchStrictEyes

      @Then("I Assert that the element found by {string}: {string}, does not strictly match with the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementDoesNotMatchStrictEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementMatchesContentEyes

      @Then("I Assert that the element found by {string}: {string}, matches the content of the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementMatchesContentEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementDoesNotMatchContentEyes

      @Then("I Assert that the element found by {string}: {string}, does not match the content of the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementDoesNotMatchContentEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementMatchesLayoutEyes

      @Then("I Assert that the element found by {string}: {string}, matches the layout of the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementMatchesLayoutEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator
    • assertElementDoesNotMatchLayoutEyes

      @Then("I Assert that the element found by {string}: {string}, does not match the layout of the expected reference image using Artificial Intelligence (Applitools Eyes)") public void assertElementDoesNotMatchLayoutEyes(String locatorType, String locatorValue)
      Asserts that the current image of the target element matches the expected reference image using the desired VisualValidationEngine if AssertionType is POSITIVE, or doesn't match it if AssertionType is NEGATIVE. Supports OpenCV natively, and Applitools Eyes. To use Eyes you need to configure your applitoolsApiKey in the path.properties file
      Parameters:
      locatorType - can be {id, tagname, classname, name, linktext, partiallinktext, cssselector, xpath}
      locatorValue - the value/expression of the desired element locator