Class: CucumberHelper::Commons::DataHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber_helper/commons/user_data_helper.rb

Overview

use to get credential email and pass, used mostly on WEB automation

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ DataHelper

Returns a new instance of DataHelper.



5
6
7
# File 'lib/cucumber_helper/commons/user_data_helper.rb', line 5

def initialize(path)
  @db = YAML.load_file "features/config/#{path}.yml"
end

Instance Method Details

#prepare_credentials(user_details) ⇒ Object



9
10
11
12
# File 'lib/cucumber_helper/commons/user_data_helper.rb', line 9

def prepare_credentials(user_details)
  { 'email' => @db['credentials'][user_details]['email'],
    'password' => @db['credentials'][user_details]['password'] }
end

#user_information(user_details, key) ⇒ Object



14
15
16
# File 'lib/cucumber_helper/commons/user_data_helper.rb', line 14

def user_information(user_details, key)
  @db['credentials'][user_details][key]
end