Module: Bucky::Core::Report::ScreenShotGenerator

Included in:
TestEquipment::Evidence::E2eEvidence
Defined in:
lib/bucky/core/report/screen_shot_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_screen_shot(driver, test_case) ⇒ Object

Save screen shot

Parameters:

  • driver (Webdriver)
  • test_case (String)

    e.g.) test_sample_app_pc_e2e_1_1



13
14
15
16
17
18
19
20
# 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