@world.absorb
def capture_screenshot(image_name):
 output_dir = '{}/log/auto_screenshots'.format(settings.TEST_ROOT)
 image_name = '{}/{}.png'.format(output_dir, image_name.replace(' ', '_'))
 try:
  world.browser.driver.save_screenshot(image_name)
 except WebDriverException:
  LOGGER.error("Could not capture a screenshot '{}'".format(image_name))

@ world . absorb def capture_screenshot ( image_name ) : output_dir = '{}/log/auto_screenshots' . format ( settings . TEST_ROOT ) image_name = '{}/{}.png' . format ( output_dir , image_name . replace ( ' ' , '_' ) ) try : world . browser . driver . save_screenshot ( image_name ) except WebDriverException : LOGGER . error ( "Could not capture a screenshot '{}'" . format ( image_name ) )
capture a screenshot outputting it to a defined directory .