|
| 1 | +<!DOCTYPE html> |
| 2 | + |
| 3 | +<html lang="en"> |
| 4 | + <head> |
| 5 | + <meta charset="utf-8"> |
| 6 | + <title>Spoon — Command line utility which aids in the deployment, execution, and aggregation of instrumentation tests across multiple devices.</title> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 | + <meta name="description" content="Command line utility which aids in the deployment, execution, and aggregation of instrumentation tests across multiple devices."> |
| 9 | + <link href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" rel="stylesheet" title="roboto"> |
| 10 | + <link href="static/bootstrap.min.css" rel="stylesheet"> |
| 11 | + <link href="static/bootstrap-responsive.min.css" rel="stylesheet"> |
| 12 | + <link href="static/prettify.css" rel="stylesheet"> |
| 13 | + <link href="static/app.css" rel="stylesheet"> |
| 14 | + </head> |
| 15 | + <body> |
| 16 | + <div class="container"> |
| 17 | + <div class="row"> |
| 18 | + <div class="span4 side"> |
| 19 | + <h1>Spoon</h1> |
| 20 | + <h2>Command line utility which aids in the deployment, execution, and aggregation of instrumentation tests across multiple devices.</h2> |
| 21 | + <p><a href="https://squareup.com/"><img src="static/square.png" alt="by Square, Inc."></a></p> |
| 22 | + </div> |
| 23 | + <div class="offset4 span8 main"> |
| 24 | + <div class="main-inner"> |
| 25 | + <h3 id="introduction">Introduction</h3> |
| 26 | + <p>Android's ever-expanding ecosystem of devices creates a unique challenge to testing applications. Spoon aims to simplify this task by distributing instrumentation test execution and displaying the results in a meaningful way.</p> |
| 27 | + |
| 28 | + <h3 id="usage">Usage</h3> |
| 29 | + <p>Instrumentation tests blah blah blah...</p> |
| 30 | + |
| 31 | + <h4 id="screenshots">Screenshots</h4> |
| 32 | + <p>In addition to simply running instrumentation tests, Spoon has the ability to snap screenshots at key points during your tests which are then included in the output. This allows for visual inspection of test executions across different devices.</p> |
| 33 | + <p>Taking screenshots requires that you include the <code>spoon-screenshot</code> JAR in your instrumentation app. In your tests call the <code>snap</code> method with a human-readable tag.</p> |
| 34 | + <pre class="prettyprint">Screenshot.snap(activity, "initial_state"); |
| 35 | +/* Normal test code... */ |
| 36 | +Screenshot.snap(activity, "after_login");</pre> |
| 37 | + <p>The tag specified will be used to identify and compare screenshots taken across multiple test runs.</p> |
| 38 | + <p>Screenshots are displayed in order for each test in the output:</p> |
| 39 | + <img src="..." alt="Sample output with screenshots"> |
| 40 | + <p>You can also view each test's screenshots as an animated GIF to guage the actual sequence of interaction.</p> |
| 41 | + |
| 42 | + <h3 id="execution">Execution</h3> |
| 43 | + <p>Spoon was designed to be run both as a standalone tool or directly as part of your build system.</p> |
| 44 | + |
| 45 | + <h4 id="cli">Command Line</h4> |
| 46 | + <p>You can run Spoon as a standalone tool with your application and instrumentation APKs.</p> |
| 47 | + <pre>java -jar spoon-1.0.0-jar-with-dependencies.jar \ |
| 48 | + --apk example-app.apk \ |
| 49 | + --test-apk example-tests.apk</pre> |
| 50 | + <p>You can control additional parameters of the execution using other flags.</p> |
| 51 | + <pre>Options: |
| 52 | + --apk Application APK |
| 53 | + --output Output path |
| 54 | + --sdk Path to Android SDK |
| 55 | + --test-apk Test application APK |
| 56 | + --title Execution title</pre> |
| 57 | + |
| 58 | + <h4 id="maven">Maven</h4> |
| 59 | + <p>If you are using Maven for compilation, a plugin is provided for easy execution. Declare the plugin in the <code>pom.xml</code> for the instrumentation test module.</p> |
| 60 | + <pre class="prettyprint"><plugin> |
| 61 | + <groupId>com.squareup.spoon</groupId> |
| 62 | + <artifactId>spoon-maven-plugin</artifactId> |
| 63 | + <version><em class="version">(insert latest version)</em></version> |
| 64 | + <executions> |
| 65 | + <execution> |
| 66 | + <phase>integration-test</phase> |
| 67 | + <goals> |
| 68 | + <goal>run</goal> |
| 69 | + </goals> |
| 70 | + </execution> |
| 71 | + </executions> |
| 72 | +</plugin></pre> |
| 73 | + <p>The plugin will look for an <code>apk</code> dependency for the corresponding application. Typically this is specified in parallel with the <code>jar</code> dependency on the application.</p> |
| 74 | + <pre class="prettyprint"><dependency> |
| 75 | + <groupId>com.example</groupId> |
| 76 | + <artifactId>example-app</artifactId> |
| 77 | + <version>${project.version}</version> |
| 78 | + <type>jar</type> |
| 79 | + <scope>provied</scope> |
| 80 | +</dependency> |
| 81 | +<dependency> |
| 82 | + <groupId>com.example</groupId> |
| 83 | + <artifactId>example-app</artifactId> |
| 84 | + <version>${project.version}</version> |
| 85 | + <type>apk</type> |
| 86 | + <scope>provied</scope> |
| 87 | +</dependency></pre> |
| 88 | + <p>The plugin will now run automatically when running phases such as <code>verify</code> or you can invoke it directly by running <code>mvn spoon:run</code>. The execution result will be placed in the <code>target/spoon-output/</code> folder.</p> |
| 89 | + <p>For a working example see the sample application and instrumentation tests in the <code>sample/</code> folder.</p> |
| 90 | + |
| 91 | + <h3 id="download">Download</h3> |
| 92 | + <p>...</p> |
| 93 | + |
| 94 | + <h3 id="example">Sample Output</h3> |
| 95 | + <p>...</p> |
| 96 | + |
| 97 | + <h3 id="contributing">Contributing</h3> |
| 98 | + <p>If you would like to contribute code to Spoon you can do so through GitHub by forking the repository and sending a pull request.</p> |
| 99 | + <p>When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also make sure your code compiles by running <code>mvn clean verify</code>. Checkstyle failures during compilation indicate errors in your style and can be viewed in the <code>checkstyle-result.xml</code> file.</p> |
| 100 | + <p>Before your code can be accepted into the project you must also sign the <a href="https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1">Individual Contributor License Agreement (CLA)</a>.</p> |
| 101 | + |
| 102 | + <h3 id="license">License</h3> |
| 103 | + <pre class="license">Copyright 2012 Square, Inc. |
| 104 | + |
| 105 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 106 | +you may not use this file except in compliance with the License. |
| 107 | +You may obtain a copy of the License at |
| 108 | + |
| 109 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 110 | + |
| 111 | +Unless required by applicable law or agreed to in writing, software |
| 112 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 113 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 114 | +See the License for the specific language governing permissions and |
| 115 | +limitations under the License.</pre> |
| 116 | + |
| 117 | + <a id="ribbon" href="https://github.com/square/spoon"><img src="static/ribbon.png" alt="Fork me on GitHub"></a> |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + </div> |
| 121 | + </div> |
| 122 | + <script src="static/prettify.js"></script> |
| 123 | + <script> prettyPrint();</script> |
| 124 | + </body> |
| 125 | +</html> |
0 commit comments