module CapybaraObjects::RSpec::Helpers::FeatureHelpers

Public Instance Methods

component_object_for(ctype, *args) click to toggle source

Fetches a component object instance by its alias @param [String] ctype The component object type to lookup @param [*] args Any extra params are passed to the instance of the looked up class @return [::CapybaraObjects::ComponentObject] A new component object instance

# File lib/capybara_objects/rspec/helpers/feature_helpers.rb, line 19
def component_object_for(ctype, *args)
  ::CapybaraObjects::RegistryInstance.instance.lookup_ctype(ctype, *args).tap do |instance|
    instance.validate!
  end
end
page_object_for(ptype, *args) click to toggle source

Fetches a page object instance by its alias @param [String] ptype The page object type to lookup @param [*] args Any extra params are passed to the instance of the looked up class @return [::CapybaraObjects::PageObject] A new page object instance

# File lib/capybara_objects/rspec/helpers/feature_helpers.rb, line 11
def page_object_for(ptype, *args)
  ::CapybaraObjects::RegistryInstance.instance.lookup_ptype(ptype).new(*args)
end