Skip to content

Instantly share code, notes, and snippets.

@laojala
Created July 24, 2020 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laojala/086249b6435990896971d2a99ab0d1a4 to your computer and use it in GitHub Desktop.
Save laojala/086249b6435990896971d2a99ab0d1a4 to your computer and use it in GitHub Desktop.
*** Settings ***
Documentation Saves screen recording for failing tests.
... iPhone: requires ffmpeg installed on Mac where phones are conneted. Run: brew install ffmpeg
... Android: recording is not working in all phones (does not cause test failures if recording is not supported)
Library BuiltIn
Library OperatingSystem
Library AppiumLibrary
*** Keywords ***
Capture Screen Recording
${pass} Run Keyword And Return Status Start Screen Recording
Run Keyword Unless ${pass} Log Could not start screen recording
End Screen Recording
Run Keyword And Ignore Error Remove Screen Recording If Pass
Remove Screen Recording If Pass
${filename} Stop Screen Recording
Run Keyword If Test Passed Remove File ${filename}
Run Keyword If Test Passed Log Screen recording not saved because test execution passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment