Module: Capybara::Node::Matchers
- Included in:
- Capybara::Node
- Defined in:
- lib/capybara/node/matchers.rb
Instance Method Summary collapse
- #has_button?(locator) ⇒ Boolean
- #has_checked_field?(locator) ⇒ Boolean
- #has_content?(content) ⇒ Boolean
- #has_css?(path, options = {}) ⇒ Boolean
- #has_field?(locator, options = {}) ⇒ Boolean
- #has_link?(locator) ⇒ Boolean
- #has_no_button?(locator) ⇒ Boolean
- #has_no_content?(content) ⇒ Boolean
- #has_no_css?(path, options = {}) ⇒ Boolean
- #has_no_field?(locator, options = {}) ⇒ Boolean
- #has_no_link?(locator) ⇒ Boolean
- #has_no_select?(locator, options = {}) ⇒ Boolean
- #has_no_table?(locator, options = {}) ⇒ Boolean
- #has_no_xpath?(path, options = {}) ⇒ Boolean
- #has_select?(locator, options = {}) ⇒ Boolean
- #has_table?(locator, options = {}) ⇒ Boolean
- #has_unchecked_field?(locator) ⇒ Boolean
- #has_xpath?(path, options = {}) ⇒ Boolean
Instance Method Details
#has_button?(locator) ⇒ Boolean
56 57 58 |
# File 'lib/capybara/node/matchers.rb', line 56 def (locator) has_xpath?(XPath.(locator)) end |
#has_checked_field?(locator) ⇒ Boolean
72 73 74 |
# File 'lib/capybara/node/matchers.rb', line 72 def has_checked_field?(locator) has_xpath?(XPath.field(locator, :checked => true)) end |
#has_content?(content) ⇒ Boolean
40 41 42 |
# File 'lib/capybara/node/matchers.rb', line 40 def has_content?(content) has_xpath?(XPath.content(content)) end |
#has_css?(path, options = {}) ⇒ Boolean
32 33 34 |
# File 'lib/capybara/node/matchers.rb', line 32 def has_css?(path, ={}) has_xpath?(XPath.from_css(path), ) end |
#has_field?(locator, options = {}) ⇒ Boolean
64 65 66 |
# File 'lib/capybara/node/matchers.rb', line 64 def has_field?(locator, ={}) has_xpath?(XPath.field(locator, )) end |
#has_link?(locator) ⇒ Boolean
48 49 50 |
# File 'lib/capybara/node/matchers.rb', line 48 def has_link?(locator) has_xpath?(XPath.link(locator)) end |
#has_no_button?(locator) ⇒ Boolean
60 61 62 |
# File 'lib/capybara/node/matchers.rb', line 60 def (locator) has_no_xpath?(XPath.(locator)) end |
#has_no_content?(content) ⇒ Boolean
44 45 46 |
# File 'lib/capybara/node/matchers.rb', line 44 def has_no_content?(content) has_no_xpath?(XPath.content(content)) end |
#has_no_css?(path, options = {}) ⇒ Boolean
36 37 38 |
# File 'lib/capybara/node/matchers.rb', line 36 def has_no_css?(path, ={}) has_no_xpath?(XPath.from_css(path), ) end |
#has_no_field?(locator, options = {}) ⇒ Boolean
68 69 70 |
# File 'lib/capybara/node/matchers.rb', line 68 def has_no_field?(locator, ={}) has_no_xpath?(XPath.field(locator, )) end |
#has_no_link?(locator) ⇒ Boolean
52 53 54 |
# File 'lib/capybara/node/matchers.rb', line 52 def has_no_link?(locator) has_no_xpath?(XPath.link(locator)) end |
#has_no_select?(locator, options = {}) ⇒ Boolean
84 85 86 |
# File 'lib/capybara/node/matchers.rb', line 84 def has_no_select?(locator, ={}) has_no_xpath?(XPath.select(locator, )) end |
#has_no_table?(locator, options = {}) ⇒ Boolean
92 93 94 |
# File 'lib/capybara/node/matchers.rb', line 92 def has_no_table?(locator, ={}) has_no_xpath?(XPath.table(locator, )) end |
#has_no_xpath?(path, options = {}) ⇒ Boolean
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/capybara/node/matchers.rb', line 18 def has_no_xpath?(path, ={}) wait_conditionally_until do results = all(:xpath, path, ) if [:count] results.size != [:count] else results.empty? end end rescue Capybara::TimeoutError return false end |
#has_select?(locator, options = {}) ⇒ Boolean
80 81 82 |
# File 'lib/capybara/node/matchers.rb', line 80 def has_select?(locator, ={}) has_xpath?(XPath.select(locator, )) end |
#has_table?(locator, options = {}) ⇒ Boolean
88 89 90 |
# File 'lib/capybara/node/matchers.rb', line 88 def has_table?(locator, ={}) has_xpath?(XPath.table(locator, )) end |
#has_unchecked_field?(locator) ⇒ Boolean
76 77 78 |
# File 'lib/capybara/node/matchers.rb', line 76 def has_unchecked_field?(locator) has_xpath?(XPath.field(locator, :unchecked => true)) end |
#has_xpath?(path, options = {}) ⇒ Boolean
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/capybara/node/matchers.rb', line 4 def has_xpath?(path, ={}) wait_conditionally_until do results = all(:xpath, path, ) if [:count] results.size == [:count] else results.size > 0 end end rescue Capybara::TimeoutError return false end |