Module: CapybaraObjects::ScopedFinders
- Extended by:
- ActiveSupport::Concern
- Included in:
- ComponentObject, PageObject
- Defined in:
- lib/capybara_objects/scoped_finders.rb
Instance Method Summary collapse
-
#get_component(ctype, *args) ⇒ CapybaraObjects::ComponentObject
Fetch a component from within this component.
- #root_node ⇒ Object
-
#scoped_find(*args) ⇒ Capybara::Node
Finds a node within the scope of this component.
Instance Method Details
#get_component(ctype, *args) ⇒ CapybaraObjects::ComponentObject
Fetch a component from within this component
12 13 14 15 16 17 |
# File 'lib/capybara_objects/scoped_finders.rb', line 12 def get_component(ctype, *args) registry.lookup_ctype(ctype).new(*args).tap do |comp| comp.scope = full_scope comp.validate! end end |
#root_node ⇒ Object
19 20 21 22 23 |
# File 'lib/capybara_objects/scoped_finders.rb', line 19 def root_node within_parent_scope do find(*locator) end end |
#scoped_find(*args) ⇒ Capybara::Node
Finds a node within the scope of this component
28 29 30 31 32 |
# File 'lib/capybara_objects/scoped_finders.rb', line 28 def scoped_find(*args) within_my_scope do find(*args) end end |