module Helper

!/usr/bin/env ruby metodo para tira screenshot e imbutir no relatorio html

metodo para tira screenshot e imbutir no relatorio html

Public Instance Methods

finished_all_ajax_requests?() click to toggle source
# File lib/SkeletonWeb/features/support/helper.rb, line 19
def finished_all_ajax_requests?
  page.evaluate_script('jQuery.active').zero?
end
take_screenshot(file_name, result) click to toggle source
# File lib/SkeletonMobile/features/support/helper.rb, line 5
def take_screenshot(file_name, result)
  file_path = "results/screenshots/test_#{result}"
  screenshot = "#{file_path}/#{file_name}.png"
  @driver.screenshot(screenshot)
  embed(screenshot, 'image/png', 'Click here')
end
wait_for_ajax() click to toggle source
# File lib/SkeletonWeb/features/support/helper.rb, line 13
def wait_for_ajax
  Timeout.timeout(Capybara.default_max_wait_time) do
    loop until finished_all_ajax_requests?
  end
end