calabash-cucumber 0.9.168 → 0.9.169.pre2

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: 263716c55576ea9c83ca12e9a10083e353301ee3
4
- data.tar.gz: fd0034d17b171b8d35312c4bcd09c5bb54cd3463
3
+ metadata.gz: c860c07a3b899e7aa1ee325f1dfc8bcd047ae2e6
4
+ data.tar.gz: 564980de6ded2290c81e2b6c6348ce2f649e553c
5
5
  SHA512:
6
- metadata.gz: 5f131a4bbbb06af009c2318a847896808571c1a85ffc7351b5ebfef7f1e786779023d55c07558a2a55ec6c59f531f022645f9cd3312dd8bd9e8c5718f0429770
7
- data.tar.gz: 2f520f3726a0d6459965657de66ff7f4c963da559bad85c40c6a2008b9d5298fb370e93f591ab3c479cc022962215f6839a736c1ea5893250cf549cf1c0276f3
6
+ metadata.gz: b08713ae250a8b54b24e05f89a4b41f015f6483932289a2b4f0806260d90c6d0ada14773afe9acac2026beaf003d04f9246597efea055a771eb080cf48fa1b62
7
+ data.tar.gz: 735c45b24c1bdd1dd67a89653f8a31397542426352b6fbde2b638ff59e457839f7ac55005b371a4d4fa449473b8cce19a9237126d74cde1439d656d4214fcc9d
@@ -13,6 +13,10 @@ class Calabash::Cucumber::InstrumentsActions
13
13
  query_action(options, :uia_tap_offset)
14
14
  end
15
15
 
16
+ def tap(options)
17
+ uia_tap_server(options[:query], options)
18
+ end
19
+
16
20
  def double_tap(options)
17
21
  query_action(options, :uia_double_tap_offset)
18
22
  end
@@ -13,6 +13,10 @@ class Calabash::Cucumber::PlaybackActions
13
13
  playback('touch', options)
14
14
  end
15
15
 
16
+ def tap(options)
17
+ touch(options)
18
+ end
19
+
16
20
  def double_tap(options)
17
21
  playback('double_tap', options)
18
22
  end
@@ -39,6 +39,10 @@ module Calabash
39
39
  map(uiquery, :query, *args)
40
40
  end
41
41
 
42
+ def q(uiquery, *args)
43
+ query(uiquery, *args)
44
+ end
45
+
42
46
  # causes all views matched by the +query+ to briefly change colors making
43
47
  # them visually identifiable.
44
48
  #
@@ -74,6 +78,16 @@ module Calabash
74
78
  query_action_with_options(:touch, uiquery, options)
75
79
  end
76
80
 
81
+ def tap_q(uiquery, options={})
82
+ _uiquery, options = extract_query_and_options(uiquery, options)
83
+ launcher.actions.tap(options)
84
+ end
85
+
86
+ def t(uiquery, options={})
87
+ tap_q(uiquery, options)
88
+ end
89
+
90
+
77
91
  def double_tap(uiquery, options={})
78
92
  query_action_with_options(:double_tap, uiquery, options)
79
93
  end
@@ -108,8 +108,10 @@ module Calabash
108
108
  msg << "Alternatively you can use the environment variable APP_BUNDLE_PATH.\n"
109
109
  raise msg.join("\n")
110
110
  else
111
- puts "Found potential build dir: #{build_dirs.first}"
112
- puts "Checking..."
111
+ if FULL_CONSOLE_OUTPUT
112
+ puts "Found potential build dir: #{build_dirs.first}"
113
+ puts "Checking..."
114
+ end
113
115
  return build_dirs.first
114
116
  end
115
117
  end
@@ -64,6 +64,10 @@ module Calabash
64
64
  simple_touch(label, *args)
65
65
  end
66
66
 
67
+ def tap_mark(label, *args)
68
+ simple_touch(label, *args)
69
+ end
70
+
67
71
  def html(q)
68
72
  query(q).map { |e| e['html'] }
69
73
  end
@@ -16,6 +16,15 @@ module Calabash
16
16
  res['results'].first
17
17
  end
18
18
 
19
+ def uia_tap_server(query, options={})
20
+ res = http({:method => :post, :path => 'uia-tap'}, {:query => query}.merge(options))
21
+ res = JSON.parse(res)
22
+ if res['outcome'] != 'SUCCESS'
23
+ raise "uia-tap action failed because: #{res['reason']}\n#{res['details']}"
24
+ end
25
+ res['results'].first
26
+ end
27
+
19
28
  def uia_query(*queryparts)
20
29
  #TODO escape '\n etc in query
21
30
  uia_handle_command(:query, queryparts)
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = '0.9.168'
4
- FRAMEWORK_VERSION = '0.9.168'
3
+ VERSION = '0.9.169.pre2'
4
+ FRAMEWORK_VERSION = '0.9.169.pre2'
5
5
  end
6
6
  end
@@ -8,6 +8,8 @@ module Calabash
8
8
  include Calabash::Cucumber::Core
9
9
  include Calabash::Cucumber::TestsHelpers
10
10
 
11
+ CLIENT_TIMEOUT_ADDITION = 5
12
+
11
13
  class WaitError < RuntimeError
12
14
  end
13
15
 
@@ -112,8 +114,11 @@ module Calabash
112
114
  end
113
115
 
114
116
  def wait_for_condition(options = {})
115
- options[:timeout] = options[:timeout] || 30
116
- options[:query] = options[:query] || "view"
117
+ timeout = options[:timeout]
118
+ unless timeout && timeout > 0
119
+ timeout = 30
120
+ end
121
+ options[:query] = options[:query] || '*'
117
122
  if options.has_key?(:condition)
118
123
  opt_condition = options[:condition]
119
124
  if opt_condition.is_a?(Symbol)
@@ -125,22 +130,23 @@ module Calabash
125
130
  end
126
131
  options[:condition] = options[:condition] || CALABASH_CONDITIONS[:none_animating]
127
132
  options[:post_timeout] = options[:post_timeout] || 0
128
- options[:frequency] = options[:frequency] || 0.3
129
- retry_frequency = options[:retry_frequency] = options[:retry_frequency] || 0.3
130
- options[:count] = options[:count] || 2
131
- timeout_message = options[:timeout_message] = options[:timeout_message] || "Timeout waiting for condition (#{options[:condition]})"
132
- screenshot_on_error = options[:screenshot_on_error] = options[:screenshot_on_error] || true
133
+
134
+ retry_frequency = options[:frequency] = options[:frequency] || 0.2
135
+ timeout_message = options[:timeout_message] = options[:timeout_message] || "Timeout waiting (#{options[:timeout]}) for condition (#{options[:condition]})"
136
+ screenshot_on_error = true
137
+ if options.key?(:screenshot_on_error)
138
+ screenshot_on_error = options[:screenshot_on_error]
139
+ end
133
140
 
134
141
  begin
135
- Timeout::timeout(options[:timeout],WaitError) do
136
- loop do
142
+ Timeout::timeout(timeout+CLIENT_TIMEOUT_ADDITION, WaitError) do
137
143
  res = http({:method => :post, :path => 'condition'},
138
144
  options)
139
145
  res = JSON.parse(res)
140
- break if res['outcome'] == 'SUCCESS'
141
- sleep(options[:retry_frequency]) if options[:retry_frequency] > 0
142
- end
143
- sleep(options[:post_timeout]) if options[:post_timeout] > 0
146
+ unless res['outcome'] == 'SUCCESS'
147
+ raise WaitError.new(res['reason'])
148
+ end
149
+ sleep(options[:post_timeout]) if options[:post_timeout] > 0
144
150
  end
145
151
  rescue WaitError => e
146
152
  msg = timeout_message || e
@@ -156,7 +162,7 @@ module Calabash
156
162
  raise wait_error(msg)
157
163
  end
158
164
  rescue Exception => e
159
- handle_error_with_options(e,nil, options[:screenshot_on_error])
165
+ handle_error_with_options(e,nil, screenshot_on_error)
160
166
  end
161
167
  end
162
168
 
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.168
4
+ version: 0.9.169.pre2
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-03-27 00:00:00.000000000 Z
11
+ date: 2014-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -384,12 +384,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
384
384
  version: '0'
385
385
  required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  requirements:
387
- - - '>='
387
+ - - '>'
388
388
  - !ruby/object:Gem::Version
389
- version: '0'
389
+ version: 1.3.1
390
390
  requirements: []
391
391
  rubyforge_project:
392
- rubygems_version: 2.1.11
392
+ rubygems_version: 2.0.3
393
393
  signing_key:
394
394
  specification_version: 4
395
395
  summary: Client for calabash-ios-server for automated functional testing on iOS