Module: QAT::Web::Elements

Includes:
Selector, Waiters
Included in:
Page, Page
Defined in:
lib/qat/web/elements.rb,
lib/qat/web/elements/base.rb,
lib/qat/web/elements/config.rb,
lib/qat/web/elements/element.rb,
lib/qat/web/elements/waiters.rb,
lib/qat/web/elements/selector.rb,
lib/qat/web/elements/collection.rb

Overview

Helper methods to define elements and load configurations. Auxiliary methods for the elements are also defined here.

Since:

  • 1.0.0

Defined Under Namespace

Modules: Config, Selector, Waiters Classes: Base, Collection, Element

Instance Method Summary collapse

Methods included from Waiters

#timeouts, #timeouts_config, #timeouts_file, #wait_until, #wait_until_not_present, #wait_until_not_visible, #wait_until_present, #wait_until_visible

Methods included from Config

#valid_config?

Methods included from Selector

#selector

Methods included from Configuration

last_access, #last_access, last_access=, #parse_configuration

Instance Method Details

#load_elements_file(file_path) ⇒ Hash

Loads a configuration file

Parameters:

  • file_path (String)

    configuration file path

Returns:

  • (Hash)

Since:

  • 1.0.0



18
19
20
21
22
23
24
25
26
# File 'lib/qat/web/elements.rb', line 18

def load_elements_file(file_path)
  begin
    config = YAML::load(ERB.new(File.read(file_path)).result)
  rescue Psych::SyntaxError
    log.error "Failed to load file '#{file_path}'."
    raise
  end
  config
end