You should be able to drop this into your Cucumber 'hooks' directory, and the magic video-record-on-failure will kick in.
On Mac, this needs https://gist.github.com/sleekweasel/1aee7b339f3f6319dda0 too.
#!/bin/bash | |
# Logs to stdout, maintaining an xmessage based status. | |
# Messages starting with space are appended. | |
# Magic { & } 2>/dev/null stuff is to suppress job control noise. | |
xlog() { | |
[ -n "$XM_PID" ] && { kill $XM_PID && wait $XM_PID ; } 2>/dev/null | |
XM_STATE="$(uptime)" | |
echo === ${XM_STATE} "$*" | |
case "$*" in (' '*) XM_MESSAGE+=" |
2016-07-19 12:52:19:487 - info: [Appium] Welcome to Appium v1.5.3 (REV 62d39fdb5ec180e37b10f5dd95b647001b9b02f7) | |
2016-07-19 12:52:19:488 - info: [Appium] Non-default server args: | |
2016-07-19 12:52:19:489 - info: [Appium] port: 1235 | |
2016-07-19 12:52:19:490 - info: [Appium] sessionOverride: true | |
2016-07-19 12:52:19:490 - info: [Appium] log: '/tmp/appiumj.log' | |
2016-07-19 12:52:19:490 - info: [Appium] loglevel: 'error:debug' | |
2016-07-19 12:52:19:490 - info: [Appium] logNoColors: true | |
2016-07-19 12:52:19:537 - info: [Appium] Appium REST http interface listener started on 0.0.0.0:1235 | |
2016-07-19 12:52:30:335 - info: [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"ios","platformVersion":"9.3","deviceName":"iPhone 6","app":"/tmp/janebumble.app","autoAcceptAlerts":false,"bundleId":"com.moxco.bumble","newCommandTimeout":305,"showIOSLog":false,"fullReset":true}} | |
2016-07-19 12:52:30:336 - info: [MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"ios","pla... |
echo This task runs after the reboot task, as a buffer between the reboot script and the real reboot. | |
echo That is, THIS task will get all the INTERRUPTED errors, not the real scripts. | |
# Note: This script depends on the host machine's reboot process removing the 'rebooting=true' line from the buildAgent.properties | |
# See the plist in this gist, or add it to your rc.local. | |
echo Uptime: | |
uptime | |
echo Infinite loop until machine reboot, unless reboot is already complete: |
You should be able to drop this into your Cucumber 'hooks' directory, and the magic video-record-on-failure will kick in.
On Mac, this needs https://gist.github.com/sleekweasel/1aee7b339f3f6319dda0 too.
CLI video capture for iOS: the applescript uses the clickdrag tool to select the given window.
Used by https://gist.github.com/sleekweasel/227315961b0b102e82d9 for automatic recording of test execution in cucumber.
Probably, if I renamed 'videocapture.scpt' to 'videocapture.applescript' and put a #!env osascript line at the start, it would be better.
# Indices for int[4] rectangles. | |
X0 ||= 0 | |
Y0 ||= 1 | |
X1 ||= 2 | |
Y1 ||= 3 | |
# Calculate clipped and obscured areas based on lists of orthogonal rectangles. | |
class Bounds | |
def initialize(r) |