Interface AttributeAssert<T>

Type Parameters:
T - the type of AssertJ assert to return
All Known Subinterfaces:
ElementAttributeAssert, ListAttributeAssert
All Known Implementing Classes:
FluentListAssert, FluentWebElementAssert

public interface AttributeAssert<T>
Base assertion interface for attribute validation within a single attribute value or a list of attribute values.
  • Method Summary

    Modifier and Type
    Method
    Description
    T
    hasAttribute (String attribute)
    Checks if the element, or at least one element in a list of elements, has the given property.
    org.assertj.core.api.AbstractAssert
    hasNotAttribute (String attribute)
    Checks if the element doesn't have, or no element in a list of elements has, the given property.
  • Method Details

    • hasAttribute

      T hasAttribute (String attribute)
      Checks if the element, or at least one element in a list of elements, has the given property.

      It allows users to do not just presence validation but to apply chained assertions to further validate the attribute values.

      Parameters:
      attribute - the attribute to find
      Returns:
      a new assert object with the actual attribute value
    • hasNotAttribute

      org.assertj.core.api.AbstractAssert hasNotAttribute (String attribute)
      Checks if the element doesn't have, or no element in a list of elements has, the given property.
      Parameters:
      attribute - attribute to find the absence of
      Returns:
      this assertion object.