1*288bf522SAndroid Build Coastguard Worker# Script to automate the following sequence: 2*288bf522SAndroid Build Coastguard Worker# - Open Feedly 3*288bf522SAndroid Build Coastguard Worker# - Open an article 4*288bf522SAndroid Build Coastguard Worker# - Scroll to bottome 5*288bf522SAndroid Build Coastguard Worker# - Open the same article in Chrome 6*288bf522SAndroid Build Coastguard Worker# - Scroll the article 7*288bf522SAndroid Build Coastguard Worker# - Back to Feely (should still be in memory) 8*288bf522SAndroid Build Coastguard Worker# - Home screen 9*288bf522SAndroid Build Coastguard Worker# ---- repeat ---- 10*288bf522SAndroid Build Coastguard Worker# 11*288bf522SAndroid Build Coastguard Worker# Currently works on volantis only (verticle orientation) 12*288bf522SAndroid Build Coastguard Worker# 13*288bf522SAndroid Build Coastguard Worker 14*288bf522SAndroid Build Coastguard WorkerCMDDIR=$(dirname $0 2>/dev/null) 15*288bf522SAndroid Build Coastguard WorkerCMDDIR=${CMDDIR:=.} 16*288bf522SAndroid Build Coastguard Worker. $CMDDIR/defs.sh 17*288bf522SAndroid Build Coastguard Worker 18*288bf522SAndroid Build Coastguard Workercase "$DEVICE" in 19*288bf522SAndroid Build Coastguard Worker(volantis) 20*288bf522SAndroid Build Coastguard Worker echo volantis... 21*288bf522SAndroid Build Coastguard Worker feedlyArticle="500 700" 22*288bf522SAndroid Build Coastguard Worker feedlyOptions="1480 100" 23*288bf522SAndroid Build Coastguard Worker feedlyBrowserSelect="1350 650" 24*288bf522SAndroid Build Coastguard Worker feedlyArticleSwipeUp="700 700 700 50 50" 25*288bf522SAndroid Build Coastguard Worker feedlyArticleSwipeDown="700 200 700 700 50" 26*288bf522SAndroid Build Coastguard Worker chromeSwipe="700 700 700 50 50" 27*288bf522SAndroid Build Coastguard Worker ;; 28*288bf522SAndroid Build Coastguard Worker(shamu|*) 29*288bf522SAndroid Build Coastguard Worker echo shamu... 30*288bf522SAndroid Build Coastguard Worker feedlyArticle="676 500" 31*288bf522SAndroid Build Coastguard Worker feedlyOptions="1327 207" 32*288bf522SAndroid Build Coastguard Worker feedlyBrowserSelect="1278 1191" 33*288bf522SAndroid Build Coastguard Worker feedlyArticleSwipeUp="700 1847 700 400 50" 34*288bf522SAndroid Build Coastguard Worker feedlyArticleSwipeDown="700 400 700 1847 50" 35*288bf522SAndroid Build Coastguard Worker chromeSwipe="700 1847 700 400 50" 36*288bf522SAndroid Build Coastguard Worker ;; 37*288bf522SAndroid Build Coastguard Worker(hammerhead|*) 38*288bf522SAndroid Build Coastguard Worker echo "Error: No feedly screen geometry information available for $DEVICE" 39*288bf522SAndroid Build Coastguard Worker exit 1;; 40*288bf522SAndroid Build Coastguard Workeresac 41*288bf522SAndroid Build Coastguard Worker 42*288bf522SAndroid Build Coastguard WorkerfeedlySwitchToTime=600 43*288bf522SAndroid Build Coastguard Worker 44*288bf522SAndroid Build Coastguard Worker# start feedly, if not installed, error out 45*288bf522SAndroid Build Coastguard Workert=$(forceStartActivity feedly) 46*288bf522SAndroid Build Coastguard WorkercheckIsRunning feedly "initial start of feedly" 47*288bf522SAndroid Build Coastguard Workerecho Feedly start time = ${t}ms 48*288bf522SAndroid Build Coastguard Worker 49*288bf522SAndroid Build Coastguard Worker# start chrome, if not installed, error out 50*288bf522SAndroid Build Coastguard Workert=$(forceStartActivity chrome) 51*288bf522SAndroid Build Coastguard WorkercheckIsRunning chrome "initial start of chrome" 52*288bf522SAndroid Build Coastguard Workerecho Chrome start time = ${t}ms 53*288bf522SAndroid Build Coastguard Workersleep 1 54*288bf522SAndroid Build Coastguard Worker 55*288bf522SAndroid Build Coastguard WorkerfeedlyStartTimes=0 56*288bf522SAndroid Build Coastguard Worker 57*288bf522SAndroid Build Coastguard Workercur=1 58*288bf522SAndroid Build Coastguard Workerwhile [ $cur -le $iterations ] 59*288bf522SAndroid Build Coastguard Workerdo 60*288bf522SAndroid Build Coastguard Worker echo ======================================= 61*288bf522SAndroid Build Coastguard Worker echo Iteration $cur of $iterations 62*288bf522SAndroid Build Coastguard Worker echo ======================================= 63*288bf522SAndroid Build Coastguard Worker startInstramentation 64*288bf522SAndroid Build Coastguard Worker t=$(startActivity feedly) 65*288bf522SAndroid Build Coastguard Worker if [ $(checkStartTime "$t" $feedlySwitchToTime) != true ]; then 66*288bf522SAndroid Build Coastguard Worker handleError Feedly took too long to start: $t v $feedlySwitchToTime: $? 67*288bf522SAndroid Build Coastguard Worker # for now, not fatal 68*288bf522SAndroid Build Coastguard Worker # exit 1 69*288bf522SAndroid Build Coastguard Worker fi 70*288bf522SAndroid Build Coastguard Worker sleep 2 71*288bf522SAndroid Build Coastguard Worker ((feedlyStartTimes=feedlyStartTimes+t)) 72*288bf522SAndroid Build Coastguard Worker echo feedly started in ${t}ms 73*288bf522SAndroid Build Coastguard Worker checkIsRunning chrome "switch back to feedly" 74*288bf522SAndroid Build Coastguard Worker checkIsRunning googlequicksearchbox "switch back to feedly" 75*288bf522SAndroid Build Coastguard Worker 76*288bf522SAndroid Build Coastguard Worker # click on first article 77*288bf522SAndroid Build Coastguard Worker doTap $feedlyArticle 78*288bf522SAndroid Build Coastguard Worker sleep 2 79*288bf522SAndroid Build Coastguard Worker 80*288bf522SAndroid Build Coastguard Worker # scroll through article 81*288bf522SAndroid Build Coastguard Worker doSwipe $feedlyArticleSwipeUp 82*288bf522SAndroid Build Coastguard Worker sleep 5 83*288bf522SAndroid Build Coastguard Worker checkIsRunning chrome "feedly swipe" 84*288bf522SAndroid Build Coastguard Worker checkIsRunning googlequicksearchbox "feedly swipe" 85*288bf522SAndroid Build Coastguard Worker 86*288bf522SAndroid Build Coastguard Worker # scroll back to top 87*288bf522SAndroid Build Coastguard Worker doSwipe $feedlyArticleSwipeDown 88*288bf522SAndroid Build Coastguard Worker sleep 2 89*288bf522SAndroid Build Coastguard Worker 90*288bf522SAndroid Build Coastguard Worker # switch to chrome 91*288bf522SAndroid Build Coastguard Worker # 1. click on menu bar 92*288bf522SAndroid Build Coastguard Worker doTap $feedlyOptions 93*288bf522SAndroid Build Coastguard Worker sleep 1 94*288bf522SAndroid Build Coastguard Worker # 2. click on browser 95*288bf522SAndroid Build Coastguard Worker doTap $feedlyBrowserSelect 96*288bf522SAndroid Build Coastguard Worker sleep 10 97*288bf522SAndroid Build Coastguard Worker 98*288bf522SAndroid Build Coastguard Worker checkIsRunning feedly "switch to chrome" 99*288bf522SAndroid Build Coastguard Worker checkIsRunning googlequicksearchbox "switch to chrome" 100*288bf522SAndroid Build Coastguard Worker 101*288bf522SAndroid Build Coastguard Worker # Now we're back in chrome, swipe to bottom of article 102*288bf522SAndroid Build Coastguard Worker doSwipe $chromeSwipe 103*288bf522SAndroid Build Coastguard Worker sleep 2 104*288bf522SAndroid Build Coastguard Worker checkIsRunning feedly "swiped chrome" 105*288bf522SAndroid Build Coastguard Worker stopInstramentation 106*288bf522SAndroid Build Coastguard Worker ((cur=cur+1)) 107*288bf522SAndroid Build Coastguard Workerdone 108*288bf522SAndroid Build Coastguard Worker((feedlyAve=feedlyStartTimes/iterations)) 109*288bf522SAndroid Build Coastguard Workerecho Avg start times: feedly: ${feedlyAve}ms 110*288bf522SAndroid Build Coastguard Worker 111*288bf522SAndroid Build Coastguard WorkerdoKeyevent HOME 112