Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #6 from ohhorob/master

iOS UIAutomation Shell Script Inspect Option
  • Loading branch information...
commit c7563c08bcbacbb9047a9835fdfafd1a6014857b 2 parents 3573dc8 + 9a3b6b0
Brandon Alexander authored

Showing 2 changed files with 15 additions and 3 deletions. Show diff stats Hide diff stats

  1. +14 2 bin/ios/mother.sh
  2. +1 1  lib/ios/mother.js
16 bin/ios/mother.sh
@@ -13,6 +13,7 @@
13 13 # -a Sample.app
14 14 # -o outputDir
15 15 # -t testFile.js
  16 +# -i
16 17 # -v
17 18 #
18 19 # Discussion:
@@ -38,6 +39,9 @@
38 39 #
39 40 # The results of this script end up in the output directory under a
40 41 # timestamped subdirectory.
  42 +#
  43 +# Enabling the Inspect option (-i argument) will automatically open the
  44 +# resulting trace document in Instruments.
41 45 #
42 46 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 47
@@ -67,9 +71,10 @@ targetApp=""
67 71 traceTemplate=""
68 72 command="instruments"
69 73 verbose=0
  74 +inspect=0
70 75 testFile=""
71 76 dateTime=$(date +%Y-%m-%dT%H.%M.%S)
72   -usage="Usage: ${0} -w <device ID> -a <app bundle> -o <output dir> -t <test file> [-v]"
  77 +usage="Usage: ${0} -w <device ID> -a <app bundle> -o <output dir> -t <test file> [-i -v]"
73 78
74 79
75 80 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -87,7 +92,7 @@ function getAbsolutePath {
87 92 }
88 93
89 94 function parseOptions {
90   - while getopts ":a:w:t:o:v" opt
  95 + while getopts ":a:w:t:o:iv" opt
91 96 do
92 97 case ${opt} in
93 98 a)
@@ -102,6 +107,9 @@ function parseOptions {
102 107 o)
103 108 outputDir="${OPTARG}/${dateTime}"
104 109 ;;
  110 + i)
  111 + inspect=1
  112 + ;;
105 113 v)
106 114 verbose=1
107 115 ;;
@@ -210,6 +218,10 @@ function runTest {
210 218 targetAppName=$(basename "${targetApp}")
211 219 finalTraceDocument="${outputDir}/${targetAppName}.trace"
212 220 mv "${tempTraceDocument}" "${finalTraceDocument}"
  221 + if (( ${inspect} > 0 ))
  222 + then
  223 + open "${finalTraceDocument}"
  224 + fi
213 225 done
214 226
215 227 # Cleans up
2  lib/ios/mother.js
@@ -62,7 +62,7 @@
62 62 }
63 63
64 64 if (mother.config.verbose) {
65   - UAITarget.localTarget().logElementTree();
  65 + UIATarget.localTarget().logElementTree();
66 66 }
67 67 }
68 68

0 comments on commit c7563c0

Please sign in to comment.
Something went wrong with that request. Please try again.