calabash-android 0.5.16.pre1 → 0.6.0.prelatestcrosswalk

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in calabash-android.gemspec
4
- gemspec
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
@@ -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
@@ -1,229 +0,0 @@
1
- Canned steps
2
- ============
3
- Calabash Android comes with the following set of predefined steps.
4
- You can add your own steps or change the ones you see here.
5
-
6
- Assertion steps
7
- ---------------
8
-
9
- To assert that specified text can be found use any of the following steps.
10
-
11
- Then /^I see the text "([^\"]*)"$/
12
- Then /^I see "([^\"]*)"$/
13
- Then /^I should see "([^\"]*)"$/
14
- Then /^I should see text containing "([^\"]*)"$/
15
-
16
- To assert that specified text cannot be found use any of the following steps.
17
-
18
- Then /^I should not see "([^\"]*)"$/
19
- Then /^I don't see the text "([^\"]*)"$/
20
- Then /^I don't see "([^\"]*)"$/
21
-
22
-
23
- Input steps
24
- -----------
25
-
26
- Then /^I toggle checkbox number (\d+)$/ do |index|
27
- Toggles the checkout with the specified index.
28
-
29
- Then /^I long press "([^\"]*)"$/ do |text|
30
- Long presses the view containing the specified text.
31
-
32
- Then /^I long press "([^\"]*)" and select item number (\d+)$/ do |text, index|
33
- **This predefined step is deprecated**
34
-
35
- Long presses the view containing the specified text and selects the menu item with the specified index in the context menu that appears.
36
-
37
- Then /^I long press "([^\"]*)" and select "([^\"]*)"$/ do |text, identifier|
38
- **This predefined step is deprecated**
39
-
40
- Long presses the view containing the specified text and selects the menu item marked by the specified identifier in the context menu that appears.
41
-
42
-
43
- Given /^I set the date to "(\d\d-\d\d-\d\d\d\d)" on DatePicker with index "([^\"]*)"$/ do |date, index|
44
- Finds the datepicker with the specified index and changes the date.
45
-
46
-
47
- Given /^I set the time to "(\d\d:\d\d)" on TimePicker with index "([^\"]*)"$/
48
- Given /^I set the "([^\"]*)" time to "(\d\d:\d\d)"$/
49
- Finds the timepicker with the specified index and changes the time.
50
-
51
- Given /^I set the "([^\"]*)" date to "(\d\d-\d\d-\d\d\d\d)"$/ do |content_description, date|
52
- Finds the datepicker by content description and changes the date.
53
-
54
- Then /^I enter "([^\"]*)" into input field number (\d+)$/ do |text, index|
55
- Enters the specified text into the input field with the specified index.
56
-
57
- Then /^I enter text "([^\"]*)" into field with id "([^\"]*)"$/ do |text, id|
58
- Enters the specified text into the input field with the specified id.
59
-
60
- Then /^I enter "([^\"]*)" as "([^\"]*)"$/ do |text, content_description|
61
- Then /^I enter "([^\"]*)" into "([^\"]*)"$/ do |text, content_description|
62
- Enters the specified text into the input field that has the specified content description.
63
-
64
- Then /^I clear input field number (\d+)$/ do |index|
65
- Clears the text of the input field with the specified index.
66
-
67
- Then /^I clear "([^\"]*)"$/ do |identifier|
68
- Clears the text of input fields marked by the identifier.
69
-
70
- Then /^I clear input field with id "([^\"]*)"$/ do |id|
71
- Clears the text of the input field with the specified id.
72
-
73
- Then /^I select "([^\"]*)" from "([^\"]*)"$/ do |item_identifier, spinner_identifier|
74
- Finds the spinner marked by the specified 'spinner_identifier' or has a childview marked by the specified 'spinner_identifier'. It then selects the menu item marked by the specified 'item_identifier'.
75
-
76
- Buttons
77
- -------
78
-
79
- Then /^I go back$/
80
- Simulates that the user pressed the back button.
81
-
82
- Then /^I press the menu key$/
83
- Simulates that the user pressed the menu button.
84
-
85
- Then /^I press the enter button$/
86
- Simulates that the user pressed the enter button on the keyboard.
87
-
88
- Gestures
89
- --------
90
- Then /^I swipe left$/
91
- Swipes left.
92
-
93
- Then /^I swipe right$/
94
- Swipes right.
95
-
96
- Then /^I scroll down$/
97
- Scrolls down.
98
-
99
- Then /^I scroll up$/
100
- Scrolls up.
101
-
102
- Then /^I select "([^\"]*)" from the menu$/ do |identifier|
103
- Opens the menu by simulating pressing the menu button and then selects a menu item marked by the specified identifier.
104
-
105
-
106
- Then /^I drag from (\d+):(\d+) to (\d+):(\d+) moving with (\d+) steps$/ do |from_x, from_y, to_x, to_y, steps|
107
- Drags from one point on the screen to another.
108
-
109
- **Note: x:y co-ordinates are expressed as percentages of the screen width:height**
110
-
111
- Touching
112
- --------
113
-
114
- Given /^I press the "([^\"]*)" button$/ do |text|
115
- Taps the button containing the specified text.
116
-
117
- Then /^I press button number (\d+)$/ do |index|
118
- Taps the button with the specified index.
119
-
120
- Then /^I press image button number (\d+)$/ do |index|
121
- Taps the image button with the specified index.
122
-
123
- Then /^I press view with id "([^\"]*)"$/ do |id|
124
- Taps the view with the give id.
125
-
126
- Then /^I press "([^\"]*)"$/ do |identifier|
127
- Taps the view marked by the specified identifier.
128
-
129
- Then /^I touch the "([^\"]*)" text$/ do |text|
130
- Taps the specified text.
131
-
132
- Then /^I press list item number (\d+)$/ do |index|
133
- **This predefined step is deprecated**
134
-
135
- Taps the list item with the specified index in the first visible list.
136
-
137
- Then /^I long press list item number (\d+)$/ do |index|
138
- **This predefined step is deprecated**
139
-
140
- Long presses the list item with the specified index in the first visible list.
141
-
142
- Then /^I click on screen (\d+)% from the left and (\d+)% from the top$/ do |x, y|
143
- Taps the screen at the specified location.
144
-
145
- Waiting
146
- -------
147
-
148
- Then /^I wait for progress$/ do
149
- Will wait until there are no more progress bars.
150
-
151
- Then /^I wait for "([^\"]*)" to appear$/ do |text|
152
- Then /^I wait to see "([^\"]*)"$/ do |text|
153
- Waits for the specified text to appear.
154
-
155
- Then /^I wait up to (\d+) seconds for "([^\"]*)" to appear$/ do |timeout, text|
156
- Then /^I wait up to (\d+) seconds to see "([^\"]*)"$/ do |timeout, †ext|
157
- Waits for the specified text to appear, with a custom timeout
158
-
159
- Then /^I wait for the "([^\"]*)" button to appear$/ do |identifier|
160
- Waits for a button marked by the specified identifier to appear.
161
-
162
- Then /^I wait for the "([^\"]*)" screen to appear$/ do |activity_name|
163
- Waits for a particular screen (Android Activity) to appear.
164
-
165
- Then /^I wait for the view with id "([^\"]*)" to appear$/ do |id|
166
- Waits for a view with the specified if to appear.
167
-
168
- Then /^I wait up to (\d+) seconds for the "([^\"]*)" screen to appear$/ do |timeout, activity_name|
169
- Then /^I wait upto (\d+) seconds for the "([^\"]*)" screen to appear$/ do |timeout, activity_name|
170
- Waits for a particular screen (Android Activity) to appear with a timeout.
171
-
172
- Then /^I wait for 1 second$/
173
- Then /^I wait for a second$/
174
- Waits for one second.
175
-
176
- Then /^I wait$/
177
- Waits for two seconds.
178
-
179
- Then /^I wait for (\d+) seconds$/ do |seconds|
180
- Waits for a specified number of seconds.
181
-
182
- Screenshots
183
- -----------
184
- To take a screenshot of the phone while running the test use any of these steps.
185
-
186
- Then /^take picture$/
187
- Then /^I take a picture$/
188
- Then /^I take a screenshot$/
189
-
190
-
191
- Location steps
192
- --------------
193
- If you allow your phone to use mocked locations (configured on your device under development settings) and your app has the `ACCESS_MOCK_LOCATION` permission you can change the perceived location of the device by using any of these steps.
194
-
195
-
196
- You can change the location any address or named location. This is done using the [geocoder gem](http://www.rubygeocoder.com/).
197
-
198
-
199
- Then /^I am in "([^\"]*)"$/ do |location|
200
- Then /^I am at "([^\"]*)"$/ do |location|
201
- Then /^I go to "([^\"]*)"$/ do |location|
202
-
203
- To use a set of concrete GPS cordinates
204
-
205
- Then /^I am at ([-+]?[0-9]*\.?[0-9]+), ([-+]?[0-9]*\.?[0-9]+)$/ do |latitude, longitude|
206
- Then /^I go to ([-+]?[0-9]*\.?[0-9]+), ([-+]?[0-9]*\.?[0-9]+)$/ do |latitude, longitude|
207
-
208
- Internationalization
209
- --------------------
210
-
211
- Then /^I press text of translated l10nkey "?([^\"]*)"?$/
212
- Simulates that the user pressed the text of the l10nkey.
213
-
214
- Then /^I press button of translated l10nkey "?([^\"]*)"?$/
215
- Simulates that the user pressed the button with the label text of the l10nkey.
216
-
217
- Then /^I press menu item of translated l10nkey "?([^\"]*)"?$/
218
- Simulates that the user pressed the menu item with the label text of the l10nkey.
219
-
220
- Then /^I press toggle button of translated l10nkey "?([^\"]*)?"$/
221
- Simulates that the user pressed the toggle button with the label text of the l10nkey.
222
-
223
- Then /^I wait for the translated "?([^\"]*)"? l10nkey to appear$/
224
- Waits until the text of the translated l10nkey is displayed.
225
-
226
- Note: you can assert or press interface elements using [Android's String resources](http://developer.android.com/reference/android/R.string.html) by passing a package in a custom step:
227
-
228
- perform_action('press_l10n_element', 'ok', nil, 'android')
229
-