calabash-cucumber 0.9.166 → 0.9.167

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63d73b5e63940ad25b53c4d541e86128843787de
4
- data.tar.gz: 0e2c58df0c1137f892fb44ca5efecea534e40a17
3
+ metadata.gz: b9f317fce7bc0b7b9619b15814d0eeef21a8426d
4
+ data.tar.gz: e7aa950deff8599ee64a2bc3884f62d3bc4d6b6f
5
5
  SHA512:
6
- metadata.gz: 32cafe39cab410dd13ce6865266c39d04925db2d6e86f2504fb211b69f09fac5df01129327b845caaf9c86b76996f345a0dfff902fe74da9ed0b201db2dffd2b
7
- data.tar.gz: c6fe8af54e3219a32d6d2811de574bc90e4c0d7201a896103c8215a4a4f81450ba402a9917ccad71696564fa4aeb900d3a8d996602ad64700489eaa5fe85e49f
6
+ metadata.gz: 2ec474c89f466cb9bbd92d1ebd85f2d38dfec59eddc952b8ad79450dd4694349595d6ce005d2398218f41fb3383509b2aeb19fda91883d103fa0aa1c3ff31125
7
+ data.tar.gz: 3e6d58a8d8320b250ddf04bae3fc1b26d823b0c048d7365c78ba70fe3f62f43be88e2c936487e74d0499bb45e6466d38c7a1b77dc739c34e3d365ccdface780a
data/.gitignore CHANGED
@@ -1,6 +1,13 @@
1
- pkg
2
1
  Markdown.pl
3
2
  .idea
4
3
  Gemfile.lock
5
4
  staticlib
6
5
  libcalabash
6
+
7
+ # ruby, bundler, rbenv
8
+ pkg
9
+ .bundle
10
+ vendor
11
+ pkg
12
+ *.gem
13
+ .ruby-version
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency( "geocoder", "~>1.1.8")
27
27
  s.add_dependency( "httpclient","~> 2.3.3")
28
28
  s.add_dependency( "bundler", "~> 1.1")
29
- s.add_dependency( "run_loop", "~> 0.1.2" )
29
+ s.add_dependency( "run_loop", "~> 0.1.4" )
30
30
  s.add_dependency( "awesome_print")
31
31
  s.add_dependency( "xamarin-test-cloud", "~> 0.9.27")
32
32
 
@@ -132,6 +132,7 @@ module Calabash
132
132
  views_touched
133
133
  end
134
134
 
135
+ # todo for 1.0 version - scroll_to_cell should expose required arguments +section+ and +row+
135
136
  def scroll_to_cell(options={:query => 'tableView',
136
137
  :row => 0,
137
138
  :section => 0,
@@ -185,6 +186,64 @@ module Calabash
185
186
  views_touched
186
187
  end
187
188
 
189
+ # scrolls to +item+ in +section+ in a UICollectionView
190
+ #
191
+ # calls the +:collectionViewScroll+ server route
192
+ #
193
+ # +item+ and +section+ are zero-indexed
194
+ #
195
+ # scroll_to_collection_view_item(0, 2, {:scroll_position => :top}) #=> scroll to item 0 in section 2 to top
196
+ # scroll_to_collection_view_item(5, 0, {:scroll_position => :bottom}) #=> scroll to item 5 in section 0 to bottom
197
+ #
198
+ # allowed options
199
+ # :query => a query string
200
+ # default => 'collectionView'
201
+ # example => "collectionView marked:'hit songs'"
202
+ #
203
+ # :scroll_position => the position to scroll to
204
+ # default => :top
205
+ # allowed => {:top | :center_vertical | :bottom | :left | :center_horizontal | :right}
206
+ #
207
+ # :animate => animate the scrolling
208
+ # default => true
209
+ # allowed => {true | false}
210
+ #
211
+ # :failed_message => the message to display on failure
212
+ # default => nil - will display a default failure message
213
+ # allowed => any string
214
+ #
215
+ # raises an exception if the scroll cannot be performed.
216
+ # * the +:query+ finds no collection view
217
+ # * collection view does not contain a cell at +item+/+section+
218
+ # * +:scroll_position+ is invalid
219
+ def scroll_to_collection_view_item(item, section, opts={})
220
+ default_options = {:query => 'collectionView',
221
+ :scroll_position => :top,
222
+ :animate => true,
223
+ :failed_message => nil}
224
+ opts = default_options.merge(opts)
225
+ uiquery = opts[:query]
226
+
227
+ scroll_position = opts[:scroll_position]
228
+ candidates = [:top, :center_vertical, :bottom, :left, :center_horizontal, :right]
229
+ unless candidates.include?(scroll_position)
230
+ raise "scroll_position '#{scroll_position}' is not one of '#{candidates}'"
231
+ end
232
+
233
+ animate = opts[:animate]
234
+
235
+ views_touched=map(uiquery, :collectionViewScroll, item.to_i, section.to_i, scroll_position, animate)
236
+
237
+ if opts[:failed_message]
238
+ msg = opts[:failed_message]
239
+ else
240
+ msg = "unable to scroll: '#{uiquery}' to row '#{item}' in section '#{section}'"
241
+ end
242
+
243
+ assert_map_results(views_touched, msg)
244
+ views_touched
245
+ end
246
+
188
247
  def send_app_to_background(secs)
189
248
  launcher.actions.send_app_to_background(secs)
190
249
  end
@@ -239,8 +239,10 @@ module Calabash
239
239
  # keyboard and not a key
240
240
  if code.eql?(UIA_SUPPORTED_CHARS['Delete'])
241
241
  uia("uia.keyboard().elements().firstWithName('Delete').tap()")
242
+ elsif code.eql?(UIA_SUPPORTED_CHARS['Return'])
243
+ tap_keyboard_action_key
242
244
  else
243
- uia_type_string(code)
245
+ uia_type_string(code, '')
244
246
  end
245
247
  end
246
248
  res = {'results' => []}
@@ -160,6 +160,10 @@ module Calabash
160
160
  uia_call_method(:queryEl, args_arr, *opts)
161
161
  end
162
162
 
163
+ def uia_call_windows(args_arr, *opts)
164
+ uia_call_method(:queryElWindows, args_arr, *opts)
165
+ end
166
+
163
167
  def uia_call_method(cmd, args_arr, *opts)
164
168
  if opts.empty?
165
169
  return uia_handle_command(cmd, args_arr)
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = '0.9.166'
4
- FRAMEWORK_VERSION = '0.9.166'
3
+ VERSION = '0.9.167'
4
+ FRAMEWORK_VERSION = '0.9.167'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.166
4
+ version: 0.9.167
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - ~>
158
158
  - !ruby/object:Gem::Version
159
- version: 0.1.2
159
+ version: 0.1.4
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ~>
165
165
  - !ruby/object:Gem::Version
166
- version: 0.1.2
166
+ version: 0.1.4
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: awesome_print
169
169
  requirement: !ruby/object:Gem::Requirement