Class: NodeFindError
- Inherits:
-
Capybara::ElementNotFound
- Object
- Capybara::ElementNotFound
- NodeFindError
- Defined in:
- lib/cucumber/pickles/errors/node_find_error.rb
Instance Method Summary collapse
- #_need_index_message ⇒ Object
- #_not_found_at_all_message ⇒ Object
- #_not_found_by_index_message ⇒ Object
-
#initialize(text, index, nodes) ⇒ NodeFindError
constructor
A new instance of NodeFindError.
- #message ⇒ Object
Constructor Details
#initialize(text, index, nodes) ⇒ NodeFindError
Returns a new instance of NodeFindError.
3 4 5 6 7 |
# File 'lib/cucumber/pickles/errors/node_find_error.rb', line 3 def initialize(text, index, nodes) @text = text @index = index @nodes = nodes end |
Instance Method Details
#_need_index_message ⇒ Object
33 34 35 |
# File 'lib/cucumber/pickles/errors/node_find_error.rb', line 33 def end |
#_not_found_at_all_message ⇒ Object
28 29 30 31 |
# File 'lib/cucumber/pickles/errors/node_find_error.rb', line 28 def "Element with text #{@text}[#{@index}] was not found on the page; " \ "Maybe used incorrect text?" end |
#_not_found_by_index_message ⇒ Object
23 24 25 26 |
# File 'lib/cucumber/pickles/errors/node_find_error.rb', line 23 def "Element with text #{@text}[#{@index}] was not found on the page, " \ "but #{@text}[0] found; Maybe used incorrect index?" end |
#message ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cucumber/pickles/errors/node_find_error.rb', line 9 def if @nodes.empty? else if @index.present? else if @nodes.length > 1 end end end end |