@world.absorb
def capture_screenshot_before_after(func):
 def inner(*args, **kwargs):
  prefix = round((time.time() * 1000))
  world.capture_screenshot('{}_{}_{}'.format(prefix, func.func_name, 'before'))
  ret_val = func(*args, **kwargs)
  world.capture_screenshot('{}_{}_{}'.format(prefix, func.func_name, 'after'))
  return ret_val
 return inner

@ world . absorb def capture_screenshot_before_after ( func ) : def inner ( * args , ** kwargs ) : prefix = round ( ( time . time ( ) * 1000 ) ) world . capture_screenshot ( '{}_{}_{}' . format ( prefix , func . func_name , 'before' ) ) ret_val = func ( * args , ** kwargs ) world . capture_screenshot ( '{}_{}_{}' . format ( prefix , func . func_name , 'after' ) ) return ret_val return inner
a decorator that will take a screenshot before and after the applied function is run .