Fixed error due to file name

This commit is contained in:
butomo1989 2017-10-27 21:02:00 +02:00
parent 95adfd1fbd
commit fcffca21ff

View file

@ -2,20 +2,18 @@
function start() { function start() {
mkdir -p $VIDEO_PATH mkdir -p $VIDEO_PATH
sw=$(($SCREEN_WIDTH - 1)) name="$(date '+%d_%m_%Y_%H_%M_%S').mp4"
sh=$(($SCREEN_HEIGHT - 1))
name="$DEVICE-$BROWSER-$(date '+%d/%m/%Y-%H:%M:%S')"
echo "Start video recording" echo "Start video recording"
ffmpeg -video_size $swx$sh -framerate 15 -f x11grab -i ${DISPLAY} $VIDEO_PATH/$name -y ffmpeg -video_size 1599x899 -framerate 15 -f x11grab -i $DISPLAY $VIDEO_PATH/$name -y
} }
function stop() { function stop() {
echo "Stop video recording" echo "Stop video recording"
kill $(ps -ef | grep ffmpeg) kill $(ps -ef | grep ffmpeg | awk '{print $2}')
} }
function auto_record() { function auto_record() {
if [ ! -z $AUTO_RECORD ]; then if [ $AUTO_RECORD ]; then
if [ ${AUTO_RECORD,,} = true ]; then if [ ${AUTO_RECORD,,} = true ]; then
echo "Auto recording is enable. It will record the video automatically as soon as appium receive test scenario!" echo "Auto recording is enable. It will record the video automatically as soon as appium receive test scenario!"
@ -23,7 +21,7 @@ function auto_record() {
no_test=true no_test=true
while $no_test; do while $no_test; do
task=$(curl -s localhost:4723/wd/hub/sessions | jq -r '.value') task=$(curl -s localhost:4723/wd/hub/sessions | jq -r '.value')
if [ -n "$task" ]; then if [ -n $task ]; then
sleep .5 sleep .5
else else
no_test=false no_test=false
@ -34,7 +32,7 @@ function auto_record() {
# Check if test is finished # Check if test is finished
while [ $no_test = false ]; do while [ $no_test = false ]; do
task=$(curl -s localhost:4723/wd/hub/sessions | jq -r '.value') task=$(curl -s localhost:4723/wd/hub/sessions | jq -r '.value')
if [ -n "$task" ]; then if [ -n $task ]; then
stop stop
else else
sleep .5 sleep .5
@ -42,4 +40,6 @@ function auto_record() {
done done
fi fi
fi fi
} }
$@