Interface ListAttributeAssert
- All Superinterfaces:
AttributeAssert<org.assertj.core.api.ListAssert<String>>
- All Known Implementing Classes:
FluentListAssert
-
Method Summary
Modifier and TypeMethodDescriptionorg.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
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 interfaceAttributeAssert<org.assertj.core.api.ListAssert<String>>
- Parameters:
attribute
- the attribute to find- Returns:
- a new
ListAssert
object with the actual attribute values
-