SHARE
TWEET

Untitled

a guest Jun 27th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @pytest.fixture(scope="function")
  2. def driver(request, browser_options):
  3.     wd = webdriver.Remote(command_executor=f"http://{selenoid}/wd/hub", desired_capabilities=browser_options)
  4.     yield wd
  5.     if request.node.rep_call.failed:
  6.         allure.attach(wd.get_screenshot_as_png(), name="Screenshot", attachment_type=allure.attachment_type.PNG)
  7.     wd.quit()
  8.     if request.node.rep_call.failed:
  9.         video = urllib.request.urlopen(f"http://{selenoid}/video/{wd.session_id}.mp4")
  10.         allure.attach(body=video.read(), name="Video", attachment_type=allure.attachment_type.MP4)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top