class CongressForms::Actions::FillIn

Public Instance Methods

perform(browser, params={}) click to toggle source
# File lib/congress_forms/actions.rb, line 78
def perform(browser, params={})
  if placeholder_value?
    value = params[self.value]&.gsub("\t", "    ") || ""

    maxl = options["max_length"]
    value = value[0, (0.95 * maxl).floor] if maxl
  else
    value = self.value
  end

  browser.find(selector).set(value)
end