Class: TestSteps::Handlers::InsertValueConfig

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/handlers/insert_value_config.rb

Instance Method Summary collapse

Methods inherited from Base

#login_button, #login_check, #login_process, #mem_word_check, #open_url_process, perform, #portal_mem_word, register

Instance Method Details

#perform(step_attributes) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/functions/handlers/insert_value_config.rb', line 8

def perform(step_attributes)
  box = step_attributes[:testvalue]
  locate = step_attributes[:locate]
  value = step_attributes[:testvalue2]
  value = ENV[value.to_s]

  Browser.b.text_field(:"#{locate}" => box).wait_until.set value
  (Browser.b.text_field(:"#{locate}" => box).value == value)
  MyLog.log.info("Textbox: #{box} has correct value: #{value}")
  true
rescue StandardError
  MyLog.log.warn("Textbox: #{box} has the incorrect value: #{value}")
  false
rescue StandardError
  MyLog.log.warn("Textbox: #{box} does not exist")
  false
end