Module: QAT::Web::Finders
- Includes:
- Configuration
- Included in:
- ProjectName::Web::Pages::Base
- Defined in:
- lib/qat/web/finders.rb
Overview
Module with custom finders based on configuration since 1.0.0
Instance Method Summary collapse
-
#find_from_configuration(config) ⇒ Capybara::Session
Alias to Capybara::Node::Finders#find method with parameter loading from configuration.
-
#page ⇒ Capybara::Session
Alias to Capybara::DSL base method.
-
#within_from_configuration(config, &block) ⇒ Capybara::Session
Alias to Capybara::Node::Finders#within method with parameter loading from configuration.
Methods included from Configuration
last_access, #last_access, last_access=, #parse_configuration
Instance Method Details
#find_from_configuration(config) ⇒ Capybara::Session
Alias to Capybara::Node::Finders#find method with parameter loading from configuration. An Hash
should be provided to calculate the correct parameters to pass to the original find
method.
19 20 21 22 |
# File 'lib/qat/web/finders.rb', line 19 def find_from_configuration config type, value, opts = parse_configuration config page.find type, value, opts end |
#page ⇒ Capybara::Session
Alias to Capybara::DSL base method
41 42 43 |
# File 'lib/qat/web/finders.rb', line 41 def page Capybara.current_session end |
#within_from_configuration(config, &block) ⇒ Capybara::Session
Alias to Capybara::Node::Finders#within method with parameter loading from configuration. An Hash
should be provided to calculate the correct parameters to pass to the original within
method.
33 34 35 36 |
# File 'lib/qat/web/finders.rb', line 33 def within_from_configuration config, &block type, value, opts = parse_configuration config page.within type.to_sym, value, opts, &block end |