Permalink
Browse files

Merge pull request #6 from ohhorob/master

iOS UIAutomation Shell Script Inspect Option
  • Loading branch information...
2 parents 3573dc8 + 9a3b6b0 commit c7563c08bcbacbb9047a9835fdfafd1a6014857b @baalexander committed Jan 19, 2012
Showing with 15 additions and 3 deletions.
  1. +14 −2 bin/ios/mother.sh
  2. +1 −1 lib/ios/mother.js
View
16 bin/ios/mother.sh
@@ -13,6 +13,7 @@
# -a Sample.app
# -o outputDir
# -t testFile.js
+# -i
# -v
#
# Discussion:
@@ -38,6 +39,9 @@
#
# The results of this script end up in the output directory under a
# timestamped subdirectory.
+#
+# Enabling the Inspect option (-i argument) will automatically open the
+# resulting trace document in Instruments.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -67,9 +71,10 @@ targetApp=""
traceTemplate=""
command="instruments"
verbose=0
+inspect=0
testFile=""
dateTime=$(date +%Y-%m-%dT%H.%M.%S)
-usage="Usage: ${0} -w <device ID> -a <app bundle> -o <output dir> -t <test file> [-v]"
+usage="Usage: ${0} -w <device ID> -a <app bundle> -o <output dir> -t <test file> [-i -v]"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -87,7 +92,7 @@ function getAbsolutePath {
}
function parseOptions {
- while getopts ":a:w:t:o:v" opt
+ while getopts ":a:w:t:o:iv" opt
do
case ${opt} in
a)
@@ -102,6 +107,9 @@ function parseOptions {
o)
outputDir="${OPTARG}/${dateTime}"
;;
+ i)
+ inspect=1
+ ;;
v)
verbose=1
;;
@@ -210,6 +218,10 @@ function runTest {
targetAppName=$(basename "${targetApp}")
finalTraceDocument="${outputDir}/${targetAppName}.trace"
mv "${tempTraceDocument}" "${finalTraceDocument}"
+ if (( ${inspect} > 0 ))
+ then
+ open "${finalTraceDocument}"
+ fi
done
# Cleans up
View
2 lib/ios/mother.js
@@ -62,7 +62,7 @@
}
if (mother.config.verbose) {
- UAITarget.localTarget().logElementTree();
+ UIATarget.localTarget().logElementTree();
}
}

0 comments on commit c7563c0

Please sign in to comment.