Sha256: c9f7e267f9f77f448c97cb875ab7314cd060f9c26a78a5ee60adc9f056b52aee

Contents?: true

Size: 531 Bytes

Versions: 5

Compression:

Stored size: 531 Bytes

Contents

def js_fill_in(field, val = {})
  val = val[:with]
  page.execute_script "$('##{field}').val('#{val}')"
end

def keydown(field, how_many = 1)
  how_many.times do |i|
    page.execute_script "$('##{field}').keydown()"
  end
end

def page!
  save_and_open_page
end

def wait_for_jquery(how_many = 1)
  how_many.times do |i|
    start = Time.now
    while true
      break if page.evaluate_script('$.active') == 0
      if Time.now > start + 5.seconds
        fail "wait_for_jquery failed"
      end
      sleep 0.1
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
meta_reports-0.1.3 spec/support/utilities.rb
meta_reports-0.1.2 spec/support/utilities.rb
meta_reports-0.1.1 spec/support/utilities.rb
meta_reports-0.1.0 spec/support/utilities.rb
meta_reports-0.0.5 spec/support/utilities.rb