Skip to content

Commit b34bbbc

Browse files
committed
Start documentation website.
1 parent 76a895c commit b34bbbc

10 files changed

+338
-0
lines changed

deploy_website.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
DIR=temp-clone
6+
7+
# Delete any existing temporary website clone
8+
rm -rf $DIR
9+
10+
# Clone the current repo into temp folder
11+
git clone [email protected]:square/spoon.git $DIR
12+
13+
# Move working directory into temp folder
14+
cd $DIR
15+
16+
# Checkout and track the gh-pages branch
17+
git checkout -t origin/gh-pages
18+
19+
# Delete everything
20+
rm -rf *
21+
22+
# Copy website files from real repo
23+
cp -R ../website/* .
24+
25+
# Stage all files in git and create a commit
26+
git add .
27+
git add -u
28+
git commit -m "Website at $(date)"
29+
30+
# Push the new files up to GitHub
31+
git push origin gh-pages
32+
33+
# Delete our temp folder
34+
cd ..
35+
rm -rf $DIR

website/index.html

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!DOCTYPE html>
2+
3+
<html lang="en">
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Spoon &mdash; 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">&lt;plugin>
61+
&lt;groupId>com.squareup.spoon&lt;/groupId>
62+
&lt;artifactId>spoon-maven-plugin&lt;/artifactId>
63+
&lt;version><em class="version">(insert latest version)</em>&lt;/version>
64+
&lt;executions>
65+
&lt;execution>
66+
&lt;phase>integration-test&lt;/phase>
67+
&lt;goals>
68+
&lt;goal>run&lt;/goal>
69+
&lt;/goals>
70+
&lt;/execution>
71+
&lt;/executions>
72+
&lt;/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">&lt;dependency>
75+
&lt;groupId>com.example&lt;/groupId>
76+
&lt;artifactId>example-app&lt;/artifactId>
77+
&lt;version>${project.version}&lt;/version>
78+
&lt;type>jar&lt;/type>
79+
&lt;scope>provied&lt;/scope>
80+
&lt;/dependency>
81+
&lt;dependency>
82+
&lt;groupId>com.example&lt;/groupId>
83+
&lt;artifactId>example-app&lt;/artifactId>
84+
&lt;version>${project.version}&lt;/version>
85+
&lt;type>apk&lt;/type>
86+
&lt;scope>provied&lt;/scope>
87+
&lt;/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>

website/static/app.css

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
body {
2+
background: #ffffff url('bedge_grunge.png') fixed repeat;
3+
margin-top: 40px;
4+
color: #222;
5+
font: 14px/19px Roboto, sans-serif;
6+
font-weight: 400;
7+
letter-spacing: .1
8+
}
9+
10+
code, pre {
11+
color: #444;
12+
background: none;
13+
border: none;
14+
}
15+
pre {
16+
font-size: 11px;
17+
}
18+
code {
19+
white-space: nowrap;
20+
}
21+
22+
.side h1 {
23+
font-size: 100px;
24+
line-height: 110px;
25+
font-weight: 200;
26+
margin-bottom: 30px;
27+
}
28+
.side h2 {
29+
font-size: 18px;
30+
line-height: 25px;
31+
font-weight: 300;
32+
margin-bottom: 60px;
33+
}
34+
35+
.main {
36+
padding-top: 40px;
37+
padding-bottom: 40px;
38+
}
39+
.main h3 {
40+
padding-top: 40px;
41+
margin-top: 0;
42+
margin-bottom: 10px;
43+
font-weight: 200;
44+
font-size: 20px;
45+
}
46+
.main h4 {
47+
padding-top: 20px;
48+
margin-top: 0;
49+
margin-bottom: 8px;
50+
text-transform: uppercase;
51+
font-weight: 300;
52+
font-size: 13px;
53+
line-height: 14px;
54+
color: #555;
55+
}
56+
.main h4:first-child, .main h3:first-child {
57+
padding-top: 0;
58+
}
59+
.main h5 {
60+
font-size: 12px;
61+
margin-top: 14px;
62+
margin-bottom: 4px;
63+
text-transform: uppercase;
64+
}
65+
66+
#ribbon img {
67+
position: absolute;
68+
top: 0;
69+
right: 0;
70+
border: 0;
71+
}
72+
73+
a:link, a:visited, a:active, a:hover {
74+
color: #4183C4;
75+
}
76+
a:hover {
77+
text-decoration: underline;
78+
}
79+
80+
@media(min-width:768px) {
81+
body {
82+
margin-top: 60px;
83+
}
84+
.side {
85+
text-align: right;
86+
position: fixed;
87+
}
88+
.side ul {
89+
margin-bottom: 60px;
90+
}
91+
.main {
92+
padding-top: 28px;
93+
padding-bottom: 100px;
94+
}
95+
.main-inner {
96+
margin-left: 25px;
97+
}
98+
99+
#ribbon img {
100+
position: fixed;
101+
}
102+
}

website/static/bedge_grunge.png

85.4 KB
Loading

website/static/bootstrap-responsive.min.css

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/static/bootstrap.min.css

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/static/prettify.css

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.com { color: #93a1a1; }
2+
.lit { color: #195f91; }
3+
.pun, .opn, .clo { color: #93a1a1; }
4+
.fun { color: #dc322f; }
5+
.str, .atv { color: #866; }
6+
.kwd, .linenums, .tag { color: #1e347b; }
7+
.typ, .atn, .dec, .var { color: teal; }
8+
.pln { color: #48484c; }
9+
10+
.prettyprint {
11+
padding: 8px;
12+
background-color: rgba(255, 255, 255, 0.3);
13+
}
14+
.prettyprint.linenums {
15+
-webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
16+
-moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
17+
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
18+
}
19+
20+
/* Specify class=linenums on a pre to get line numbering */
21+
ol.linenums {
22+
margin: 0 0 0 33px; /* IE indents via margin-left */
23+
}
24+
ol.linenums li {
25+
padding-left: 12px;
26+
color: #bebec5;
27+
line-height: 18px;
28+
text-shadow: 0 1px 0 #fff;
29+
}

0 commit comments

Comments
 (0)