calabash-cucumber 0.9.113 → 0.9.115

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- calabash-cucumber (0.9.112)
4
+ calabash-cucumber (0.9.115)
5
5
  CFPropertyList
6
6
  bundler (~> 1.1)
7
7
  cucumber
8
- httpclient (~> 2.2)
8
+ httpclient (= 2.2.7)
9
9
  json
10
- location-one (~> 0.0.7)
10
+ location-one (~> 0.0.8)
11
11
  sim_launcher (= 0.4.6)
12
12
  slowhandcuke
13
13
 
@@ -25,11 +25,11 @@ GEM
25
25
  geocoder (1.1.4)
26
26
  gherkin (2.11.5)
27
27
  json (>= 1.4.6)
28
- httpclient (2.3.0.1)
28
+ httpclient (2.2.7)
29
29
  json (1.7.5)
30
- location-one (0.0.7)
30
+ location-one (0.0.8)
31
31
  geocoder (~> 1.1)
32
- httpclient (~> 2.2)
32
+ httpclient (= 2.2.7)
33
33
  json
34
34
  rack (1.4.1)
35
35
  rack-protection (1.2.0)
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency( "CFPropertyList" )
22
22
  s.add_dependency( "sim_launcher", "0.4.6")
23
23
  s.add_dependency( "slowhandcuke" )
24
- s.add_dependency( "location-one", "~>0.0.7")
25
- s.add_dependency( "httpclient","~> 2.2")
24
+ s.add_dependency( "location-one", "~>0.0.8")
25
+ s.add_dependency( "httpclient","2.2.7")
26
26
  s.add_dependency( "bundler", "~> 1.1")
27
27
 
28
28
  end
@@ -18,6 +18,14 @@ module Calabash
18
18
  map(uiquery, :query, *args)
19
19
  end
20
20
 
21
+ def server_version
22
+ JSON.parse(http(:path => 'version'))
23
+ end
24
+
25
+ def client_version
26
+ Calabash::Cucumber::VERSION
27
+ end
28
+
21
29
  def perform(*args)
22
30
  if args.length == 1
23
31
  #simple selector
@@ -28,7 +36,7 @@ module Calabash
28
36
  args = [hash]
29
37
  elsif args.length == 2
30
38
  q = args[1][:on]
31
- if args[0].is_a?Hash
39
+ if args[0].is_a? Hash
32
40
  args = [args[0]]
33
41
  else
34
42
  args = args[0]
@@ -113,6 +121,35 @@ module Calabash
113
121
  views_touched
114
122
  end
115
123
 
124
+ def scroll_to_cell(options={:query => "tableView",
125
+ :row => 0,
126
+ :section => 0,
127
+ :scroll_position => :top,
128
+ :animate => true})
129
+ uiquery = options[:query] || "tableView"
130
+ row = options[:row]
131
+ sec = options[:section]
132
+ if row.nil? or sec.nil?
133
+ raise "You must supply both :row and :section keys to scroll_to_cell"
134
+ end
135
+
136
+ args = []
137
+ if options.has_key?(:scroll_position)
138
+ args << options[:scroll_position]
139
+ else
140
+ args << "top"
141
+ end
142
+ if options.has_key?(:animate)
143
+ args << options[:animate]
144
+ end
145
+ views_touched=map(uiquery, :scrollToRow, row.to_i, sec.to_i, *args)
146
+
147
+ if views_touched.empty? or views_touched.member? "<VOID>"
148
+ screenshot_and_raise "Unable to scroll: '#{uiquery}' to: #{options}"
149
+ end
150
+ views_touched
151
+ end
152
+
116
153
  def pinch(in_out, options={})
117
154
  file = "pinch_in"
118
155
  if in_out.to_sym==:out
@@ -186,7 +223,7 @@ module Calabash
186
223
  dir = opts[:dir] || :down
187
224
 
188
225
  raise "Wheel index must be non negative" if wheel < 0
189
- raise "Only up and down supported :dir (#{dir})" unless [:up,:down].include?(dir)
226
+ raise "Only up and down supported :dir (#{dir})" unless [:up, :down].include?(dir)
190
227
 
191
228
  if ENV['OS'] == "ios4"
192
229
  playback "wheel_#{dir}", :query => "#{q} pickerTable index:#{wheel}"
@@ -223,7 +260,7 @@ module Calabash
223
260
  {:titleForRow => i},
224
261
  {:forComponent => comp}]).first
225
262
  end
226
- texts[comp] << txt
263
+ texts[comp] << txt
227
264
  end
228
265
  end
229
266
  texts
@@ -305,7 +342,7 @@ module Calabash
305
342
  file_name = "#{file_name}_#{os}_#{device}.base64"
306
343
  system("/usr/bin/plutil -convert binary1 -o _recording_binary.plist _recording.plist")
307
344
  system("openssl base64 -in _recording_binary.plist -out #{file_name}")
308
- system("rm _recording.plist _recording_binary.plist")
345
+ system("rm _recording.plist _recording_binary.plist")
309
346
  file_name
310
347
  end
311
348
 
@@ -60,6 +60,47 @@ module Calabash
60
60
  screenshot_and_raise(msg, options)
61
61
  end
62
62
 
63
+ def each_cell(opts={:query => "tableView", :post_scroll => 0.3, :animate => true}, &block)
64
+ uiquery = opts[:query] || "tableView"
65
+ skip = opts[:skip_if]
66
+ check_element_exists(uiquery)
67
+ secs = query(uiquery,:numberOfSections).first
68
+ secs.times do |sec|
69
+ rows = query(uiquery,{:numberOfRowsInSection => sec}).first
70
+ rows.times do |row|
71
+ next if skip and skip.call(row,sec)
72
+ scroll_opts = {:section => sec, :row => row}.merge(opts)
73
+ scroll_to_cell(scroll_opts)
74
+ sleep(opts[:post_scroll]) if opts[:post_scroll] and opts[:post_scroll] > 0
75
+ yield(row, sec)
76
+ end
77
+ end
78
+ end
79
+
80
+ def each_cell_and_back(opts={:query => "tableView",
81
+ :post_scroll => 0.3,
82
+ :post_back => 0.5,
83
+ :post_tap_cell => 0.3,
84
+ :animate => true}, &block)
85
+ back_query = opts[:back_query] || "navigationItemButtonView"
86
+ post_tap_cell = opts[:post_tap_cell] || 0.3
87
+ post_back = opts[:post_back] || 0.6
88
+
89
+
90
+ each_cell(opts) do |row, sec|
91
+ touch("tableViewCell indexPath:#{row},#{sec}")
92
+ wait_for_elements_exist([back_query])
93
+ sleep(post_tap_cell) if post_tap_cell > 0
94
+
95
+ yield(row,sec) if block_given?
96
+
97
+ touch(back_query)
98
+
99
+ sleep(post_back) if post_back > 0
100
+
101
+ end
102
+ end
103
+
63
104
 
64
105
  def screenshot_embed(options={:prefix => nil, :name => nil, :label => nil})
65
106
  path = screenshot(options)
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = "0.9.113"
4
- FRAMEWORK_VERSION = "0.9.111"
3
+ VERSION = "0.9.115"
4
+ FRAMEWORK_VERSION = "0.9.115"
5
5
  end
6
6
  end
@@ -85,6 +85,11 @@ module Calabash
85
85
  options[:timeout_message] = options[:timeout_message] || "Timeout waiting for condition (#{options[:condition]})"
86
86
  options[:screenshot_on_error] = options[:screenshot_on_error] || true
87
87
 
88
+ if options[:condition] == CALABASH_CONDITIONS[:none_animating]
89
+ puts "Waiting for none-animating has been found unreliable."
90
+ puts "You are advised not to use it until this is resolved."
91
+ puts "Test will continue..."
92
+ end
88
93
  begin
89
94
  Timeout::timeout(options[:timeout],WaitError) do
90
95
  loop do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.113
4
+ version: 0.9.115
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-16 00:00:00.000000000 Z
12
+ date: 2012-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 0.0.7
101
+ version: 0.0.8
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,23 +106,23 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 0.0.7
109
+ version: 0.0.8
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: httpclient
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
115
- - - ~>
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '2.2'
117
+ version: 2.2.7
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
123
- - - ~>
123
+ - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: '2.2'
125
+ version: 2.2.7
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: bundler
128
128
  requirement: !ruby/object:Gem::Requirement