Interface ListAttributeAssert

All Superinterfaces:
AttributeAssert<org.assertj.core.api.ListAssert<String>>
All Known Implementing Classes:
FluentListAssert

public interface ListAttributeAssert extends AttributeAssert<org.assertj.core.api.ListAssert<String>>
Assertion interface for attribute validation within a list of elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.assertj.core.api.ListAssert<String>
    hasAttribute (String attribute)
    Checks if at least one of the elements in the list of elements has the given property.

    Methods inherited from interface io.fluentlenium.assertj.custom.AttributeAssert

    hasNotAttribute
  • Method Details

    • hasAttribute

      org.assertj.core.api.ListAssert<String> hasAttribute (String attribute)
      Checks if at least one of the elements in the list of elements has the given property.

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

      Examples:

      Validating the presence of an attribute on a FluentList:

       assertThat(fluentList).hasAttribute("class");
       

      Validating both the presence of an attribute on a fluent list, and the value of that attribute:

       assertThat(element).hasAttribute("class").containsAnyOf("some-class", "other-class");
       
      Specified by:
      hasAttribute in interface AttributeAssert<org.assertj.core.api.ListAssert<String>>
      Parameters:
      attribute - the attribute to find
      Returns:
      a new ListAssert object with the actual attribute values