Class: EasyAutomation::LoadData

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_automation/load_data.rb

Class Method Summary collapse

Class Method Details

.load_test_data(name, test_name, path) ⇒ Object

Loads test data based on test name.



16
17
18
19
# File 'lib/easy_automation/load_data.rb', line 16

def self.load_test_data(name, test_name, path)
  data      = YAML::load(File.read(File.join(path, 'data', "#{name}.yml")))
  DataElements.new(data[test_name])
end

.load_xpath_elements(name, path) ⇒ Object

Loads xpath elements based on page name.



27
28
29
# File 'lib/easy_automation/load_data.rb', line 27

def self.load_xpath_elements(name, path)
  DataElements.new(YAML::load(File.read(File.join(path, 'elements', "#{name.downcase}.yml"))))
end