Module: Howitzer::Web::SectionDsl::ClassMethods
- Defined in:
- lib/howitzer/web/section_dsl.rb
Overview
This module holds section dsl class methods
Defined Under Namespace
Classes: SectionScope
Instance Method Summary collapse
-
#section(name, *args, &block) ⇒ Object
DSL method which defines named or anonymous section within a page or a section.
Instance Method Details
#section(name, *args, &block) ⇒ Object
Note:
This method generates following dynamic methods:
section_name_section - equals capybara #find(…) method
section_name_sections - equals capybara #all(…) method
section_name_sections.first - equals capybara #first(…) method
has_section_name_section? - equals capybara #has_selector(…) method
has_no_section_name_section? - equals capybara #has_no_selector(…) method
Note:
It is possible to use nested anonymous sections
DSL method which defines named or anonymous section within a page or a section
112 113 114 115 116 117 118 |
# File 'lib/howitzer/web/section_dsl.rb', line 112 def section(name, *args, &block) scope = SectionScope.new(name, *args, &block) define_section_method(scope.section_class, name, scope.finder_args) define_sections_method(scope.section_class, name, scope.finder_args) define_has_section_method(name, scope.finder_args) define_has_no_section_method(name, scope.finder_args) end |