calabash-android 0.5.16.pre1 → 0.6.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/calabash-android-build.rb +2 -1
- data/irbrc +17 -0
- data/lib/calabash-android/dot_dir.rb +17 -0
- data/lib/calabash-android/environment.rb +120 -0
- data/{test-server → lib/calabash-android/lib}/AndroidManifest.xml +0 -0
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/logging.rb +120 -0
- data/lib/calabash-android/operations.rb +12 -0
- data/lib/calabash-android/store/preferences.rb +211 -0
- data/lib/calabash-android/text_helpers.rb +41 -14
- data/lib/calabash-android/usage_tracker.rb +192 -0
- data/lib/calabash-android/version.rb +1 -1
- data/lib/calabash-android/wait_helpers.rb +1 -1
- data/lib/calabash-android.rb +6 -1
- metadata +168 -61
- data/.calabash_settings +0 -1
- data/.yardopts +0 -3
- data/CHANGES.txt +0 -354
- data/ENVIRONMENT_VARIABLES.md +0 -106
- data/Gemfile +0 -4
- data/README_YARDOC.md +0 -163
- data/Rakefile +0 -49
- data/calabash-android.gemspec +0 -30
- data/lib/calabash-android/canned_steps.md +0 -229
- data/test-server/build.xml +0 -152
- data/test-server/calabash-js/src/calabash.js +0 -172
data/CHANGES.txt
DELETED
@@ -1,354 +0,0 @@
|
|
1
|
-
0.5.13
|
2
|
-
Do not depend on any specific version of Cucumber
|
3
|
-
Grant all permissions when installing an app on M
|
4
|
-
|
5
|
-
0.5.12
|
6
|
-
Fix Calabash WebView queries not working for new Android
|
7
|
-
System WebViews in Lollipop and M.
|
8
|
-
|
9
|
-
0.5.11
|
10
|
-
Change the way Calabash (re)signs applications. Use the encryption
|
11
|
-
of the supplied keystore, and always use SHA1 as the digest
|
12
|
-
algorithm.
|
13
|
-
|
14
|
-
0.5.10
|
15
|
-
Fix building and signing not working if the language of the
|
16
|
-
host computer was not English.
|
17
|
-
|
18
|
-
0.5.9
|
19
|
-
Fix crosswalk queries giving wrong coordinates.
|
20
|
-
|
21
|
-
Fix client rescuing `Exceptions`
|
22
|
-
|
23
|
-
Support signing with DSA certificates
|
24
|
-
|
25
|
-
Support indexes in css/xpath queries.
|
26
|
-
|
27
|
-
0.5.8
|
28
|
-
Handle `embed` if Calabash Android was 'included' instead of added
|
29
|
-
to the Cucumber World
|
30
|
-
|
31
|
-
Do depend on ANY retriable version >= 2
|
32
|
-
|
33
|
-
Fixed possible NPE in WebView queries
|
34
|
-
|
35
|
-
0.5.7
|
36
|
-
Replaced calls to retriable with Retriable.retriable.
|
37
|
-
|
38
|
-
0.5.6
|
39
|
-
Support for Crosswalk.
|
40
|
-
|
41
|
-
Support cordova Web Views of custom class name.
|
42
|
-
|
43
|
-
Don't fail JSON parsing on empty beans.
|
44
|
-
|
45
|
-
Rescue 'awesome print' LoadError in irbrc; don't fail silently.
|
46
|
-
|
47
|
-
Backdoor not finding any method to invoke in activities.
|
48
|
-
|
49
|
-
0.5.5
|
50
|
-
Support for the newest versions of Cordova.
|
51
|
-
|
52
|
-
Change press_user_action_button now defaults to enter key (newline) in input fields with multiple lines.
|
53
|
-
|
54
|
-
Properly delegate all callbacks to the origin Web Chrome Client of the WebView being tested.
|
55
|
-
|
56
|
-
Run queries on the UI thread of the views. The query command could hang indefinitely in certain situations before this fix.
|
57
|
-
|
58
|
-
0.5.4:
|
59
|
-
This version is only a fix of changes introduced in 0.5.3.
|
60
|
-
|
61
|
-
Fixed usage of old clear_text being invalid. Now calabash only prints a warning and proceeds.
|
62
|
-
|
63
|
-
0.5.3:
|
64
|
-
Added methods to clear text in a specified view or the view that has focus.
|
65
|
-
|
66
|
-
Added ability to invoke javascript in webviews specified by a query.
|
67
|
-
|
68
|
-
Improved keystore handling.
|
69
|
-
|
70
|
-
Fixed issue with a gemspec that was too loose (Cucumber beta is not supported).
|
71
|
-
|
72
|
-
0.5.2:
|
73
|
-
Added generic multi touch gestures and many predefined gestures.
|
74
|
-
|
75
|
-
Gestures will now wait 5 seconds by default for the specified view to appear.
|
76
|
-
|
77
|
-
Added press_user_action_button method to press the user action button.
|
78
|
-
|
79
|
-
For a full changelog see
|
80
|
-
https://github.com/calabash/calabash-android/tree/master/changelog/0.5.2.md
|
81
|
-
0.5.0:
|
82
|
-
Removed many actions. They all have equivalent ruby wrappers/queries.
|
83
|
-
|
84
|
-
Added new ruby wrappers for scrolling and more complex gestures that would requre an action before.
|
85
|
-
|
86
|
-
Implemented flash method. It 'flashes' all found elements visually on the device to help the tester locate a view.
|
87
|
-
Its syntax is equivalent to query.
|
88
|
-
|
89
|
-
Added keyboard_enter_text/enter_text methods.
|
90
|
-
|
91
|
-
Updated all predefined steps. Their implementation is now more alike their naming.
|
92
|
-
|
93
|
-
Backoor method to invoke methods in the tested app.
|
94
|
-
|
95
|
-
Fixed visibility bugs:
|
96
|
-
- Views that were invisible were returned as visible in some cases.
|
97
|
-
- No visibility filtering on webviews.
|
98
|
-
|
99
|
-
Fixed various small bugs.
|
100
|
-
|
101
|
-
0.3.7:
|
102
|
-
Added calabash-android resign command
|
103
|
-
|
104
|
-
Fixed bug: No longer reuses a single result for every success result
|
105
|
-
|
106
|
-
Will give the app a few seconds to get up and running before failing
|
107
|
-
|
108
|
-
Fixed skeleton app_life_cycle_hook so screenshots are now taken before the app is shut down
|
109
|
-
|
110
|
-
0.3.6:
|
111
|
-
Will fail if the keyguard cannot be disabled when starting the app.
|
112
|
-
|
113
|
-
If the app is not running calabash will now die instead of running around
|
114
|
-
like a serverless chicking.
|
115
|
-
|
116
|
-
On-device screenshots are still unstable but will no longer crash the app
|
117
|
-
if they fail.
|
118
|
-
|
119
|
-
Much better Cucumber output if the app is no longer running.
|
120
|
-
|
121
|
-
0.3.5:
|
122
|
-
No longer takes screenshots when perform_action fails.
|
123
|
-
If you want to take screenshots when a scenario fails you can use a hook:
|
124
|
-
|
125
|
-
After do |scenario|
|
126
|
-
if scenario.failed?
|
127
|
-
screenshot_embed
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
This hook is now part of the generated skeleton.
|
132
|
-
|
133
|
-
Upgraded to Robotium 3.6 to support api level 17.
|
134
|
-
|
135
|
-
Fixed mock location.
|
136
|
-
|
137
|
-
|
138
|
-
0.3.4:
|
139
|
-
Removed maps_unsupported
|
140
|
-
The test will fail at run time if the device does not have
|
141
|
-
com.google.android.maps installed.
|
142
|
-
|
143
|
-
0.3.3:
|
144
|
-
A series of bugfixes.
|
145
|
-
|
146
|
-
0.3.1:
|
147
|
-
Will now create test_servers dir if it doesn't exist.
|
148
|
-
|
149
|
-
0.3.0:
|
150
|
-
The test server is no longer build from source by calabash-android.
|
151
|
-
Calabash-android now comes with a half-done test server that is missing an
|
152
|
-
AndroidManifest.xml and a signature.
|
153
|
-
We will now inject a special crafted manifest that works with the app under test
|
154
|
-
into the test server apk and sign it with the appropiate certificate.
|
155
|
-
|
156
|
-
Fixed several bugs.
|
157
|
-
|
158
|
-
0.2.22:
|
159
|
-
Removed incorrect text when running calabash-anroid gen.
|
160
|
-
|
161
|
-
0.2.21:
|
162
|
-
Various bug fixes related to keystore.
|
163
|
-
|
164
|
-
0.2.20:
|
165
|
-
Added click_on_view_by_description action
|
166
|
-
|
167
|
-
0.2.19:
|
168
|
-
New actions:
|
169
|
-
Drag action
|
170
|
-
Press image button by content description
|
171
|
-
|
172
|
-
0.2.18:
|
173
|
-
Various small improvements and bug fixes.
|
174
|
-
|
175
|
-
Screenshots are now embedded into the test report using Cucumbers embed method.
|
176
|
-
|
177
|
-
0.2.17:
|
178
|
-
Added calabash-android extract-manifest that will print the manifest of any apk file.
|
179
|
-
|
180
|
-
0.2.16:
|
181
|
-
Added --google-maps-support option.
|
182
|
-
By default no actions from sh.calaba.instrumentationbackend.actions.map
|
183
|
-
will be available. By adding the --google-maps-support all actions will
|
184
|
-
be baked into the test server.
|
185
|
-
|
186
|
-
Removed colors from cucumber output on Windows
|
187
|
-
|
188
|
-
0.2.15:
|
189
|
-
Fixed bug related to Google maps api add-on being located at different location
|
190
|
-
in different api versions.
|
191
|
-
|
192
|
-
0.2.14:
|
193
|
-
Removed calabash-android submit. Tools for interacting with lesspainful.com
|
194
|
-
will be extracted into a seperate gem.
|
195
|
-
|
196
|
-
Added "calabash-android version"
|
197
|
-
|
198
|
-
0.2.13:
|
199
|
-
Now using application/json content type for communication with test server.
|
200
|
-
|
201
|
-
0.2.12:
|
202
|
-
Various small improvements and bug fixes.
|
203
|
-
|
204
|
-
Fixed support for scenario outline.
|
205
|
-
Added support for interacting with Google Maps.
|
206
|
-
|
207
|
-
0.2.11:
|
208
|
-
Added is_enabled action that determines if a view is enabled.
|
209
|
-
|
210
|
-
Cleaner return values when executing javascript.
|
211
|
-
|
212
|
-
0.2.10:
|
213
|
-
Various small improvements and bug fixes.
|
214
|
-
|
215
|
-
Default behavior is now to shutdown the test server after scenario.
|
216
|
-
calabash-android now waits for the test server to be ready before sending
|
217
|
-
the first command.
|
218
|
-
|
219
|
-
If the environment variable RESET_BETWEEN_SCENARIOS is "1" the app will
|
220
|
-
be reinstalled between scenarios and not just between features.
|
221
|
-
|
222
|
-
0.2.9:
|
223
|
-
Moving to the new http screenshot method.
|
224
|
-
screenshottaker.jar and the use of ddmlib will be phased out.
|
225
|
-
|
226
|
-
0.2.8:
|
227
|
-
Added /screenshot to test server.
|
228
|
-
Calabash will now kill the test server at exit.
|
229
|
-
Test server is now compiled with the debug flag which means better
|
230
|
-
stacktraces.
|
231
|
-
|
232
|
-
Bug fixes.
|
233
|
-
|
234
|
-
0.2.7:
|
235
|
-
Fixed path on Windows - Really!
|
236
|
-
|
237
|
-
0.2.6:
|
238
|
-
Fixed path on Windows.
|
239
|
-
|
240
|
-
0.2.5:
|
241
|
-
Will now escape '+' as %2B in arguments
|
242
|
-
|
243
|
-
0.2.4:
|
244
|
-
Added three actions by Sampo Niskanen for interaction with WebViews:
|
245
|
-
* Executing arbitrary javascript in WebView
|
246
|
-
* Get the current url
|
247
|
-
* Detect the page load status
|
248
|
-
|
249
|
-
Fixed bug in features-skeleton/support/app_installation_hooks.rb
|
250
|
-
|
251
|
-
Fixed minor bugs
|
252
|
-
|
253
|
-
0.2.3:
|
254
|
-
The 0.2.2 gem was broken :(
|
255
|
-
Making a new release
|
256
|
-
|
257
|
-
0.2.2:
|
258
|
-
Fixed path problems with Ant on Windows.
|
259
|
-
|
260
|
-
0.2.1:
|
261
|
-
Path to custom keystores can now be relative.
|
262
|
-
Setup only deals with custom keystores.
|
263
|
-
|
264
|
-
0.2.0:
|
265
|
-
No changes from 0.2.0.pre10.
|
266
|
-
|
267
|
-
0.2.0.pre10:
|
268
|
-
Now accepts full app paths as well as paths with spaces.
|
269
|
-
|
270
|
-
0.2.0.pre9:
|
271
|
-
Fixing connection issue on Windows.
|
272
|
-
|
273
|
-
0.2.0.pre8:
|
274
|
-
Adding target version to javac in order to work with Java 7.
|
275
|
-
|
276
|
-
0.2.0.pre7:
|
277
|
-
Fixing api-level lookup on windows.
|
278
|
-
|
279
|
-
0.2.0.pre6:
|
280
|
-
Replaced ENV["PWD"] with FileUtils.pwd to support Windows
|
281
|
-
|
282
|
-
0.2.0.pre5:
|
283
|
-
Added jar file to extract manifest from apk to avoid using unzip.
|
284
|
-
This is first attempt at supporting Windows in 0.2.0
|
285
|
-
|
286
|
-
0.2.0.pre4:
|
287
|
-
It is no longer needed to do the separate build step.
|
288
|
-
If no test server is found calabash-android will now attempt build it.
|
289
|
-
0.2.0.pre3:
|
290
|
-
Reintroduced lib/calabash-android/management/app_installation.rb
|
291
|
-
to stay backwards compatible with generated skeletons.
|
292
|
-
|
293
|
-
0.2.0.pre2:
|
294
|
-
A HTTP server has been introduced in the test server so that we no
|
295
|
-
longer use socket for communication.
|
296
|
-
|
297
|
-
0.2.0.pre1:
|
298
|
-
The concept of a Device has been introduced. It will handle all setup
|
299
|
-
and communication with physical devices or emulators.
|
300
|
-
The device class is needed because we want to interact with more than
|
301
|
-
one device at the same time from Calabash.
|
302
|
-
|
303
|
-
0.1.0:
|
304
|
-
Added support for testing Xamarin Mono for Android apps.
|
305
|
-
Currently only Release builds are supported.
|
306
|
-
This new version requires you make changes in
|
307
|
-
features/support/app_life_cycle_hooks.rb.
|
308
|
-
The first time you execute "calabash-android run" upgrade instructions
|
309
|
-
will be displayed.
|
310
|
-
|
311
|
-
0.0.19:
|
312
|
-
take_screenshot now works with Ruby 1.8.7
|
313
|
-
|
314
|
-
0.0.18:
|
315
|
-
Fixed bug. HTML text fields are now cleared when using set_text.
|
316
|
-
|
317
|
-
0.0.17:
|
318
|
-
Upgraded to Robotium 3.3
|
319
|
-
|
320
|
-
0.0.16:
|
321
|
-
Clears text when calling set_text in a webview.
|
322
|
-
Added set_text helper method to support.
|
323
|
-
|
324
|
-
0.0.15:
|
325
|
-
Prefixes screenshots with feature name
|
326
|
-
|
327
|
-
0.0.14:
|
328
|
-
Added 'calabash-android submit'
|
329
|
-
Will submit your apk and features to www.lesspainful.com
|
330
|
-
|
331
|
-
0.0.13:
|
332
|
-
Added missing file EnterKey.java
|
333
|
-
|
334
|
-
0.0.12:
|
335
|
-
Added "I press the enter button" step
|
336
|
-
|
337
|
-
0.0.11:
|
338
|
-
Added a small delay after executing cucumber from calabash-android-run
|
339
|
-
to make termination prettier.
|
340
|
-
|
341
|
-
0.0.10:
|
342
|
-
Added -v and --verbose options to calabash-android run.
|
343
|
-
This will turn on verbose logging for Calabash as well as Cucumber.
|
344
|
-
Default logging is much less verbose now but can be even better.
|
345
|
-
0.0.9:
|
346
|
-
Moved from Robotium 2.5 to 3.2.1
|
347
|
-
0.0.8:
|
348
|
-
Added colors to Cucumber output
|
349
|
-
|
350
|
-
0.0.7: Output from the ant build and from running Cucumber is now in sync.
|
351
|
-
That means that you can now trust that the output you see is actually
|
352
|
-
the most recent output from ant or Cucumber.
|
353
|
-
|
354
|
-
0.0.6: Introducing the CHANGES file
|
data/ENVIRONMENT_VARIABLES.md
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
## Calabash Android Environment Variables
|
2
|
-
|
3
|
-
Calabash Android references Unix environment variables to control its runtime behavior.
|
4
|
-
|
5
|
-
## Conventions
|
6
|
-
|
7
|
-
Paths or values with spaces need double or single quotes.
|
8
|
-
|
9
|
-
#### Example: Quoting values with spaces.
|
10
|
-
|
11
|
-
```
|
12
|
-
APP_PATH="~/path with/a spaces/in it" # Correct!
|
13
|
-
APP_PATH=~/path with/a spaces/in it # Incorrect.
|
14
|
-
```
|
15
|
-
|
16
|
-
## Environment Variables
|
17
|
-
|
18
|
-
### `ADB_DEVICE_ARG`
|
19
|
-
|
20
|
-
#### Example
|
21
|
-
|
22
|
-
```
|
23
|
-
ADB_DEVICE_ARG=4df7ee16Xa083009
|
24
|
-
ADB_DEVICE_ARG=C4F12B41QB6E89E
|
25
|
-
```
|
26
|
-
|
27
|
-
### `APP_PATH`
|
28
|
-
|
29
|
-
The path to apk that is being tested.
|
30
|
-
|
31
|
-
Use this variable if your apk is located in a non-default location or your environment requires special configuration (e.g. example a CI environment).
|
32
|
-
|
33
|
-
### `MAIN_ACTIVITY`
|
34
|
-
|
35
|
-
Calabash Android will automatically try to detect the main activity of
|
36
|
-
the application. Use this variable to specify an alternative main activity.
|
37
|
-
|
38
|
-
#### Example
|
39
|
-
|
40
|
-
```
|
41
|
-
MAIN_ACTIVITY="com.example.myactivity" calabash-android run example.apk
|
42
|
-
```
|
43
|
-
|
44
|
-
### `CALABASH_IRBRC`
|
45
|
-
|
46
|
-
Use this variable to load a custom .irbrc when opening calabash-ios console. This is useful if you have multiple calabash projects and want to share an .irbrc across all of them.
|
47
|
-
|
48
|
-
#### .irbrc load order rules
|
49
|
-
|
50
|
-
1. If `CALABASH_IRBRC` is defined, then that .irbrc is loaded.
|
51
|
-
2. If there is a .irbrc in the directory where `console` is called, then that file is loaded.
|
52
|
-
3. Otherwise, the defaults scripts/.irbrc is loaded.
|
53
|
-
|
54
|
-
#### Special
|
55
|
-
|
56
|
-
Calling `calabash-ios console` sets the `IRBRC` environment variable.
|
57
|
-
|
58
|
-
#### Example
|
59
|
-
|
60
|
-
```
|
61
|
-
$ CALABASH_IRBRC="~/.irbrc-calabash" calabash-ios console
|
62
|
-
```
|
63
|
-
|
64
|
-
### `RESET_BETWEEN_SCENARIOS`
|
65
|
-
|
66
|
-
Use this variable to reset your app's data between cucumber Scenarios.
|
67
|
-
|
68
|
-
#### Pro Tip: Reset the app data before certain Scenarios.
|
69
|
-
|
70
|
-
Use a `Before` hook + a `tag` to control when calabash will reset the app data.
|
71
|
-
|
72
|
-
### `SCREENSHOT_PATH`
|
73
|
-
|
74
|
-
Use this variable to apply a 'prefix' to a screenshot when saving. See the examples.
|
75
|
-
|
76
|
-
#### Note
|
77
|
-
|
78
|
-
The behavior of this variable is subject to change.
|
79
|
-
|
80
|
-
#### Special
|
81
|
-
|
82
|
-
If the the *path* portion of SCREENSHOT_PATH does not exist, `screenshot` will raise an error.
|
83
|
-
|
84
|
-
@see {Calabash::Android::Operations#screenshot}
|
85
|
-
|
86
|
-
#### Example: Specify a prefix
|
87
|
-
|
88
|
-
```
|
89
|
-
SCREENSHOT_PATH=galaxy_s5_ => galaxy_s5_screenshot_0.png
|
90
|
-
SCREENSHOT_PATH="screenshots/nexus5-" => screenshots/nexus5-screenshot_0.png
|
91
|
-
```
|
92
|
-
|
93
|
-
#### Example: Specify a directory
|
94
|
-
|
95
|
-
```
|
96
|
-
# correct!
|
97
|
-
SCREENSHOT_PATH=/path/to/a/directory/ => path/to/a/directory/screenshot_0.png
|
98
|
-
# incorrect :(
|
99
|
-
SCREENSHOT_PATH=/path/to/a/directory => path/to/a/directoryscreenshot_0.png
|
100
|
-
```
|
101
|
-
|
102
|
-
### `TEST_APP_PATH`
|
103
|
-
|
104
|
-
Calabash Android will detect the test-server apt based on the checksum of the application and the Calabash Android version.
|
105
|
-
|
106
|
-
Use this variable if your test-server is located in a non-default location or environment requires special configuration (e.g. example a CI environment).
|
data/Gemfile
DELETED
data/README_YARDOC.md
DELETED
@@ -1,163 +0,0 @@
|
|
1
|
-
## Yard Docs
|
2
|
-
|
3
|
-
This gem is documented with yard.
|
4
|
-
|
5
|
-
### Build the Docs Locally
|
6
|
-
|
7
|
-
```
|
8
|
-
$ be rake yard
|
9
|
-
Files: 38
|
10
|
-
Modules: 26 ( 13 undocumented)
|
11
|
-
Classes: 14 ( 11 undocumented)
|
12
|
-
Constants: 31 ( 21 undocumented)
|
13
|
-
Methods: 466 ( 242 undocumented)
|
14
|
-
46.55% documented
|
15
|
-
```
|
16
|
-
|
17
|
-
Docs are generated in the `docs` directory.
|
18
|
-
|
19
|
-
### See What is Undocumented
|
20
|
-
|
21
|
-
```
|
22
|
-
$ be yard stats --list-undoc
|
23
|
-
```
|
24
|
-
|
25
|
-
### Start a Local Server
|
26
|
-
|
27
|
-
```
|
28
|
-
$ be yard server
|
29
|
-
> YARD 0.8.7.3 documentation server at http://0.0.0.0:8808
|
30
|
-
[2014-02-25 13:17:46] INFO WEBrick 1.3.1
|
31
|
-
[2014-02-25 13:17:46] INFO ruby 2.0.0 (2013-11-22) [x86_64-darwin13.0.0]
|
32
|
-
[2014-02-25 13:17:46] INFO WEBrick::HTTPServer#start: pid=54296 port=8808
|
33
|
-
```
|
34
|
-
|
35
|
-
View docs here: http://0.0.0.0:8808
|
36
|
-
|
37
|
-
When writing docs, it is usual to run:
|
38
|
-
|
39
|
-
```
|
40
|
-
# Reparses the library code on each request
|
41
|
-
$ be yard server --reload
|
42
|
-
```
|
43
|
-
|
44
|
-
### Documenting with Yard
|
45
|
-
|
46
|
-
* http://yardoc.org/
|
47
|
-
* https://github.com/lsegal/yard
|
48
|
-
* http://yardoc.org/guides/index.html
|
49
|
-
* http://yardoc.org/types.html
|
50
|
-
|
51
|
-
The Yard syntax should be familiar to anyone who has used javadocs or doyxgen.
|
52
|
-
|
53
|
-
This page has details about the Yard markup tags and is extremely useful:
|
54
|
-
|
55
|
-
* [list of yard tags](http://rubydoc.info/gems/yard/file/docs/Tags.md#List_of_Available_Tags)
|
56
|
-
|
57
|
-
### Examples
|
58
|
-
|
59
|
-
```
|
60
|
-
# method for interacting with instruments
|
61
|
-
#
|
62
|
-
# @example Find the instruments version
|
63
|
-
# instruments(:version)
|
64
|
-
#
|
65
|
-
# @example A list of known simulators
|
66
|
-
# instruments(:sims)
|
67
|
-
#
|
68
|
-
# @param [String] cmd controls the return value. currently accepts nil,
|
69
|
-
# :sims, and :version as valid parameters
|
70
|
-
# @return [String] based on the value of `cmd` version, a list known
|
71
|
-
# simulators, or the path to the instruments binary
|
72
|
-
# @raise [ArgumentError] if invalid `cmd` is passed
|
73
|
-
```
|
74
|
-
|
75
|
-
#### code blocks
|
76
|
-
|
77
|
-
|
78
|
-
```
|
79
|
-
# ```
|
80
|
-
# def example_code
|
81
|
-
#
|
82
|
-
# end
|
83
|
-
# ```
|
84
|
-
```
|
85
|
-
|
86
|
-
#### tags that span multiple lines
|
87
|
-
|
88
|
-
Indent subsequent lines by 2 or more spaces (prefer 2 spaces).
|
89
|
-
|
90
|
-
```
|
91
|
-
# @param [String] cmd controls the return value. currently accepts nil,
|
92
|
-
# :sims, and :version as valid parameters
|
93
|
-
```
|
94
|
-
|
95
|
-
#### default argument values are auto-generated
|
96
|
-
|
97
|
-
A method like this:
|
98
|
-
|
99
|
-
```
|
100
|
-
# @param [String] cmd controls the return value. currently accepts nil,
|
101
|
-
# :sims, and :version as valid parameters
|
102
|
-
def instruments(cmd=nil)
|
103
|
-
```
|
104
|
-
|
105
|
-
will generate:
|
106
|
-
|
107
|
-
```
|
108
|
-
cmd (String) (defaults to: nil) — controls the return value. currently accepts nil, :sims, and :version as valid parameters
|
109
|
-
```
|
110
|
-
|
111
|
-
#### documenting option hashes
|
112
|
-
|
113
|
-
Default values can be specified by including them after the option key in `()`.
|
114
|
-
|
115
|
-
```
|
116
|
-
# @param [Hash] opts controls the content of the query string
|
117
|
-
# @option opts [Integer,nil] :with_tag (true) if non-nil the query string includes tag filter
|
118
|
-
# @option opts [Integer,nil] :with_clips_to_bounds (false) if non-nil the query string includes clipsToBounds filter
|
119
|
-
```
|
120
|
-
|
121
|
-
#### multiple return values
|
122
|
-
|
123
|
-
You can list multiple return tags for a method in the case where a method has
|
124
|
-
distinct return cases. Each case should begin with “if …”
|
125
|
-
|
126
|
-
```
|
127
|
-
# @return [nil] if `key` does not exist
|
128
|
-
# @return [String] if the `key` exists then the value of +key+ (error)
|
129
|
-
```
|
130
|
-
|
131
|
-
You can also chain return values, but this freaks out RubyMine. :(
|
132
|
-
|
133
|
-
```
|
134
|
-
# Finds an object or list of objects in the db using a query
|
135
|
-
# @return [String, Array<String>, nil] the object or objects to
|
136
|
-
# find in the database. Can be nil.
|
137
|
-
def find(query) finder_code_here end
|
138
|
-
```
|
139
|
-
|
140
|
-
#### generics are allowed
|
141
|
-
|
142
|
-
```
|
143
|
-
# @param [Array<String, Integer, Float>] list a list of strings integers and floats
|
144
|
-
```
|
145
|
-
|
146
|
-
#### ignoring private APIs
|
147
|
-
|
148
|
-
The [.yardopts](./.yardopts) file includes the `--no-private` option.
|
149
|
-
|
150
|
-
To mark an object as private, use this tag.
|
151
|
-
|
152
|
-
* `# @!visibility private`
|
153
|
-
|
154
|
-
Objects that are within the (Ruby) scope of `private` will be recognized
|
155
|
-
automatically by yard as private.
|
156
|
-
|
157
|
-
```
|
158
|
-
# @!visibility private
|
159
|
-
# Raises an error by raising a exception and conditionally takes a
|
160
|
-
# screenshot based on the value of `screenshot_on_error`.
|
161
|
-
# ...
|
162
|
-
def handle_error_with_options(ex, timeout_message, screenshot_on_error)
|
163
|
-
```
|
data/Rakefile
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
load 'lib/calabash-android/env.rb'
|
3
|
-
|
4
|
-
def build
|
5
|
-
test_server_template_dir = File.join(File.dirname(__FILE__), 'test-server')
|
6
|
-
|
7
|
-
Dir.mktmpdir do |workspace_dir|
|
8
|
-
|
9
|
-
@test_server_dir = File.join(workspace_dir, 'test-server')
|
10
|
-
FileUtils.cp_r(test_server_template_dir, workspace_dir)
|
11
|
-
|
12
|
-
args = [
|
13
|
-
Env.ant_path,
|
14
|
-
"clean",
|
15
|
-
"package",
|
16
|
-
"-debug",
|
17
|
-
"-Dtools.dir=\"#{Env.tools_dir}\"",
|
18
|
-
"-Dandroid.api.level=19",
|
19
|
-
"-Dversion=#{Calabash::Android::VERSION}",
|
20
|
-
]
|
21
|
-
Dir.chdir(@test_server_dir) do
|
22
|
-
STDOUT.sync = true
|
23
|
-
IO.popen(args.join(" ")) do |io|
|
24
|
-
io.each { |s| print s }
|
25
|
-
end
|
26
|
-
if $?.exitstatus != 0
|
27
|
-
puts "Could not build the test server. Please see the output above."
|
28
|
-
exit $?.exitstatus
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
FileUtils.mkdir_p "test_servers" unless File.exist? "test_servers"
|
33
|
-
|
34
|
-
FileUtils.cp(File.join(@test_server_dir, "bin", "Test_unsigned.apk"), File.join(File.dirname(__FILE__), 'lib/calabash-android/lib/TestServer.apk'))
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
task :build do
|
39
|
-
unless File.exists? "test-server/calabash-js/src"
|
40
|
-
puts "calabash-js not found!"
|
41
|
-
puts "For instuctions see: https://github.com/calabash/calabash-android/wiki/Building-calabash-android"
|
42
|
-
exit 1
|
43
|
-
end
|
44
|
-
|
45
|
-
build
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
|
-
Bundler::GemHelper.install_tasks
|
data/calabash-android.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "calabash-android/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "calabash-android"
|
7
|
-
s.version = Calabash::Android::VERSION
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Jonas Maturana Larsen"]
|
10
|
-
s.email = ["jonas@lesspainful.com"]
|
11
|
-
s.homepage = "http://github.com/calabash"
|
12
|
-
s.summary = %q{Client for calabash-android for automated functional testing on Android}
|
13
|
-
s.description = %q{calabash-android drives tests for native and hybrid Android apps. }
|
14
|
-
s.files = `git ls-files | grep -v "test-server/instrumentation-backend"`.split("\n") + Dir["test-server/calabash-js/src/*.js"] + ["lib/calabash-android/lib/TestServer.apk"]
|
15
|
-
s.executables = "calabash-android"
|
16
|
-
s.require_paths = ["lib"]
|
17
|
-
|
18
|
-
s.add_dependency( "cucumber" )
|
19
|
-
s.add_dependency( "json", '~> 1.8' )
|
20
|
-
s.add_dependency( 'retriable', '>= 1.3.3.1', '< 1.5')
|
21
|
-
s.add_dependency( "slowhandcuke", '~> 0.0.3')
|
22
|
-
s.add_dependency( "rubyzip", "~> 1.1" )
|
23
|
-
s.add_dependency( "awesome_print", '~> 1.2')
|
24
|
-
s.add_dependency( 'httpclient', '>= 2.3.2', '< 3.0')
|
25
|
-
s.add_dependency( 'escape', '~> 0.0.4')
|
26
|
-
|
27
|
-
s.add_development_dependency( 'rake', '~> 10.3' )
|
28
|
-
s.add_development_dependency( 'yard', '~> 0.8' )
|
29
|
-
s.add_development_dependency( 'redcarpet', '~> 3.1' )
|
30
|
-
end
|