has_attr() checks that an element's attribute matches a value, while
attr_contains() checks that an element's attribute contains a value.
has_value() is a shortcut for has_attr("value"): it checks that an
element's value matches a string or number.
See also
Other conditions:
has_css_property(),
has_length(),
has_name(),
has_text(),
is_enabled(),
is_present(),
is_visible()
Examples
html <- "
<input class='myclass' value='1.0' data-customattr='Custom attribute text'>
"
session <- minimal_selenider_session(html)
has_attr(s("input"), "class", "myclass")
has_attr(s("input"), "value", 1)
has_value(s("input"), 1)
attr_contains(s("input"), "data-customattr", "Custom attribute")