Class: Howitzer::Web::Section

Inherits:
BaseSection show all
Defined in:
lib/howitzer/web/section.rb

Overview

This class uses for named sections which possible to reuse in different pages

Constant Summary

Constants included from CapybaraMethodsProxy

CapybaraMethodsProxy::PROXIED_CAPYBARA_METHODS

Instance Attribute Summary

Attributes inherited from BaseSection

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseSection

#initialize

Methods included from CapybaraMethodsProxy

#click_alert_box

Methods included from IframeDsl

included

Methods included from CapybaraContextHolder

#capybara_context

Methods included from SectionDsl

included

Methods included from ElementDsl

#convert_arguments, #extract_lambda_args, included, #pop_options_from_array, #proc_to_selector

Constructor Details

This class inherits a constructor from Howitzer::Web::BaseSection

Class Method Details

.me(*args, **options) ⇒ Object

DSL method which specifies section container selector represented by HTML element. Any elements described in sections will start in this HTML element.

Examples:

class MenuSection < Howitzer::Web::Section
  me :xpath, ".//*[@id='panel']",
end

Parameters:

  • args (Array)

    original Capybara arguments. For details, see ‘Capybara::Node::Finders#all.

  • options (Array)

    original Capybara options. For details, see ‘Capybara::Node::Finders#all.

Raises:

  • (ArgumentError)

    if no arguments were passed



28
29
30
31
32
33
34
# File 'lib/howitzer/web/section.rb', line 28

def me(*args, **options)
  raise ArgumentError, 'Finder arguments are missing' if args.blank?

  @default_finder_args = args
  @default_finder_options = options
  self
end

Instance Method Details

#metaMeta::Entry

Provides access to meta information about entities in section

Returns:



10
11
12
# File 'lib/howitzer/web/section.rb', line 10

def meta
  @meta ||= Meta::Entry.new(self)
end