Created
March 24, 2017 08:25
-
-
Save mingyuan-xia/2970fb00ef598ea5d4212bb383808da5 to your computer and use it in GitHub Desktop.
Test the visual difference caused by replay with appetizer-toolkit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PKG=com.paijwar.drawithme # the package name of the app to be launched | |
| WAITTIME=3 # seconds to wait after starting the app | |
| REPEAT=2 # number of replays | |
| DEVICE=xxxxxx # device serialno | |
| echo 'Make sure you have ImageMagick' | |
| ./appetizer devices control $DEVICE launch_pkg $PKG | |
| sleep $WAITTIME | |
| echo '1. When recording starts, perform some complicated gestures, type exit to finish' | |
| ./appetizer trace record --device $DEVICE mytrace.trace | |
| ./appetizer devices screenshot base.jpg --device $DEVICE | |
| ./appetizer devices control $DEVICE shell am force-stop $PKG | |
| echo "2. Repeat replaying for $REPEAT times" | |
| for (( i=1; i<=$REPEAT; i++ )) | |
| do | |
| ./appetizer devices control $DEVICE launch_pkg $PKG | |
| sleep $WAITTIME | |
| ./appetizer trace replay mytrace.trace $DEVICE | |
| ./appetizer devices screenshot "$i.jpg" --device $DEVICE | |
| compare base.jpg "$i.jpg" "$i-diff.jpg" | |
| ./appetizer devices control $DEVICE shell am force-stop $PKG | |
| echo "$i replay done" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment