Method: Capybara::Node::Matchers#has_content?
- Defined in:
- lib/capybara/node/matchers.rb
#has_text?(type, text, **options) ⇒ Boolean #has_text?(text, **options) ⇒ Boolean
Checks if the page or current node has the given text content, ignoring any HTML tags.
By default it will check if the text occurs at least once, but a different number can be specified.
page.has_text?('lorem ipsum', between: 2..4)
This will check if the text occurs from 2 to 4 times.
741 742 743 |
# File 'lib/capybara/node/matchers.rb', line 741 def has_text?(*args, **) make_predicate() { assert_text(*args, **) } end |