Class: QAT::Web::Elements::Base

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL, Logger, Config, Selector
Defined in:
lib/qat/web/elements/base.rb

Overview

Web Element wrapper base class

Since:

  • 1.0.0

Direct Known Subclasses

Collection, Element

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Config

#valid_config?

Methods included from Configuration

last_access, #last_access, last_access=, #parse_configuration

Constructor Details

#initialize(elements, *args) ⇒ Base

New instance and the second an optional configuration. If none is given, it will be automatically loaded from the loaded configuration by the element name

Parameters:

  • elements (Hash)

    Page Object related elements configuration

  • args (Array)

    One or two arguments are expected. The first argument is the element name

Since:

  • 1.0.0



22
23
24
25
# File 'lib/qat/web/elements/base.rb', line 22

def initialize(elements, *args)
  get_element_info(elements, *args)
  @selector = extract_selector(@config)
end

Instance Attribute Details

#configObject (readonly)

Since:

  • 1.0.0



15
16
17
# File 'lib/qat/web/elements/base.rb', line 15

def config
  @config
end

#nameObject (readonly)

Since:

  • 1.0.0



15
16
17
# File 'lib/qat/web/elements/base.rb', line 15

def name
  @name
end

#selectorObject (readonly)

Since:

  • 1.0.0



15
16
17
# File 'lib/qat/web/elements/base.rb', line 15

def selector
  @selector
end