Method: Magnesium::Span#execute

Defined in:
lib/magnesium/elements/span.rb

#execute(action, data) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/magnesium/elements/span.rb', line 48

def execute(action,data)
  begin
    if action == 'send_keys'
      if Config.config["wait"]["isstart"] == "true"
        return @e.when_present(Config.config["wait"]["value"].to_i).send_keys data.to_s
      elsif Config.config["wait"]["isstart"] == "false"
        return @e.send_keys data.to_s
      else
#            error
        puts '...'
      end
    elsif action == 'exists'
      if Config.config["wait"]["isstart"] == "true"
        return @e.when_present(Config.config["wait"]["value"].to_i).exists?
      elsif Config.config["wait"]["isstart"] == "false"
        return @e.exists?
      else
        error
      end
    elsif action == 'wait_until_present'
      return @e.wait_until_present
    elsif action == 'wait_while_present'
      return @e.wait_while_present
    else
      puts 'M: I am sorry about the error.'
#          error
    end
  #rescue
  #  error
    #ensure
  end
end