Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. def stop_rec_and_save_videoreport(mdriver, request):
  2.     b64_video = mdriver.stop_recording_screen()
  3.     # TODO: that's too much info!
  4.     # logging.info("Base64-encoded-screencast-for-test")
  5.     # logging.info(b64_video)
  6.     test_class_dir = video_reports_dir + os.sep + "/".join(pytest_current_test.split("::")[0:-1])
  7.     testname = pytest_current_test.split("::")[-1]\
  8.         .replace(" (teardown)", "") \
  9.         if "teardown" in pytest_current_test else pytest_current_test.split("::")[-1]
  10.     Path(test_class_dir).mkdir(parents=True, exist_ok=True)
  11.     with open(test_class_dir + os.sep + testname + ".mp4", "wb") as fh:
  12.         fh.write(base64.b64decode(b64_video))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement