module Bucky::Core::Report::ScreenShotGenerator

Public Instance Methods

generate_screen_shot(driver, test_case) click to toggle source

Save screen shot @param [Webdriver] driver @param [String] test_case e.g.) test_sample_app_pc_e2e_1_1

# File lib/bucky/core/report/screen_shot_generator.rb, line 13
def generate_screen_shot(driver, test_case)
  timestamp = Time.now.strftime('%Y%m%d_%H%M%S')
  driver.save_screenshot(
    Bucky::Utils::Config.instance[:screen_shot_path] + test_case << "_#{timestamp}.png"
  )
rescue StandardError => e
  Bucky::Core::Exception::BuckyException.handle(e)
end