hound v1.1.1 Hound.Matchers View Source

Text and element matchers

Link to this section Summary

Functions

Returns true if an element is present

Returns true if text is found on the page inside an element

Returns true if text is found on the page

Link to this section Functions

Link to this function

element?(strategy, selector) View Source

Returns true if an element is present.

element?(:class, "block")
element?(:id, "foo")
Link to this function

visible_in_element?(selector, pattern) View Source
visible_in_element?(Hound.Element.selector(), Regex.t()) :: boolean()

Returns true if text is found on the page inside an element.

visible_in_element?({:class, "block"}, ~r/Paragraph/)
visible_in_element?({:id, "foo"}, ~r/paragraph/iu)

If the element matching the selector itself is a hidden element, then the match will return true even if the text is not hidden.

Link to this function

visible_in_page?(pattern) View Source
visible_in_page?(Regex.t()) :: boolean()

Returns true if text is found on the page.

visible_in_page?(~r/Paragraph/)