Class: Taf::TestSteps::Handlers::WriteBoxdata
- Defined in:
- lib/taf/test_steps/handlers/base/write_box_data.rb
Overview
Write box data function.
Instance Method Summary collapse
Methods inherited from Base
#initialize, #login_check, #login_process, #mem_word_check, perform, #portal_mem_word, register
Constructor Details
This class inherits a constructor from Taf::TestSteps::Handlers::Base
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/taf/test_steps/handlers/base/write_box_data.rb', line 10 def perform txt = @value2 txt = ENV[txt.to_s] if ENV[txt.to_s] elms = i[textarea text_field iframe] found_box = elms.map do |elm| Taf::Browser.b.send(elm, "#{@locate}": @value).exists? end.compact raise 'Multiple matches' if found_box.select { |i| i }.empty? index = found_box.index(true) return unless index Taf::Browser.b.send(elms[index], "#{@locate}": @value) .wait_until(&:exists?).send_keys txt Taf::MyLog.log.info("Textbox: #{@value} has correct value: #{txt}") true rescue StandardError Taf::MyLog.log.warn("Textbox: #{@value} does not exist") false end |