hound v1.0.2 Hound.Matchers

Text and element matchers

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

Functions

element?(strategy, selector)

Specs

element?(Hound.Element.strategy, String.t) :: boolean

Returns true if an element is present.

element?(:class, "block")
element?(:id, "foo")
visible_in_element?(selector, pattern)

Specs

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.

visible_in_page?(pattern)

Specs

visible_in_page?(Regex.t) :: boolean

Returns true if text is found on the page.

visible_in_page?(~r/Paragraph/)