Class: Capybara::UI::Widget::NodeFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/ui/widgets/widget/node_filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*selector) ⇒ NodeFilter

Returns a new instance of NodeFilter.


7
8
9
# File 'lib/capybara/ui/widgets/widget/node_filter.rb', line 7

def initialize(*selector)
  @selector = selector.flatten
end

Instance Attribute Details

#selectorObject (readonly)

Returns the value of attribute selector


5
6
7
# File 'lib/capybara/ui/widgets/widget/node_filter.rb', line 5

def selector
  @selector
end

Instance Method Details

#node(parent_widget, *args) ⇒ Object


11
12
13
# File 'lib/capybara/ui/widgets/widget/node_filter.rb', line 11

def node(parent_widget, *args)
  parent_widget.root.find(*capybara_selector(*args))
end

#node?(parent_widget, *args) ⇒ Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/capybara/ui/widgets/widget/node_filter.rb', line 15

def node?(parent_widget, *args)
  parent_widget.root.has_selector?(*capybara_selector(*args))
end

#nodeless?(parent_widget, *args) ⇒ Boolean

Returns:

  • (Boolean)

19
20
21
# File 'lib/capybara/ui/widgets/widget/node_filter.rb', line 19

def nodeless?(parent_widget, *args)
  parent_widget.root.has_no_selector?(*capybara_selector(*args))
end

#nodes(parent_widget, *args) ⇒ Object


23
24
25
# File 'lib/capybara/ui/widgets/widget/node_filter.rb', line 23

def nodes(parent_widget, *args)
  parent_widget.root.all(*capybara_selector(*args))
end