Module: Capybara::UI::WidgetParts::Container

Includes:
Capybara::UI
Included in:
Document, Capybara::UI::Widget
Defined in:
lib/capybara/ui/widgets/parts/container.rb

Constant Summary

Constants included from Capybara::UI

VERSION

Instance Method Summary collapse

Methods included from Capybara::UI

#deprecate

Methods included from Constructors

#Decimal, #Integer, #Widget

Instance Method Details

#has_widget?(name, *args) ⇒ Boolean Also known as: widget?

Returns:

  • (Boolean)

7
8
9
10
# File 'lib/capybara/ui/widgets/parts/container.rb', line 7

def has_widget?(name, *args)
  deprecate('has_widget? and its alias widget?', 'visible?')
  widget_class(name).present_in?(self, *args)
end

#not_visible?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)

18
19
20
# File 'lib/capybara/ui/widgets/parts/container.rb', line 18

def not_visible?(name, *args)
  widget_class(name).not_present_in?(self, *args)
end

#visible?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/capybara/ui/widgets/parts/container.rb', line 14

def visible?(name, *args)
  widget_class(name).present_in?(self, *args)
end

#widget(name, *args) ⇒ Object


22
23
24
25
26
# File 'lib/capybara/ui/widgets/parts/container.rb', line 22

def widget(name, *args)
  first, rest = [*name, *args]

  widget_class(first).find_in(self, *rest)
end

#widgets(name, *args) ⇒ Object


28
29
30
31
32
# File 'lib/capybara/ui/widgets/parts/container.rb', line 28

def widgets(name, *args)
  first, rest = [*name, *args]

  widget_class(first).find_all_in(self, *rest)
end