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 +4 -4
- data/lib/calabash-cucumber/actions/instruments_actions.rb +4 -0
- data/lib/calabash-cucumber/actions/playback_actions.rb +4 -0
- data/lib/calabash-cucumber/core.rb +14 -0
- data/lib/calabash-cucumber/launch/simulator_helper.rb +4 -2
- data/lib/calabash-cucumber/operations.rb +4 -0
- data/lib/calabash-cucumber/uia.rb +9 -0
- data/lib/calabash-cucumber/version.rb +2 -2
- data/lib/calabash-cucumber/wait_helpers.rb +20 -14
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c860c07a3b899e7aa1ee325f1dfc8bcd047ae2e6
|
4
|
+
data.tar.gz: 564980de6ded2290c81e2b6c6348ce2f649e553c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b08713ae250a8b54b24e05f89a4b41f015f6483932289a2b4f0806260d90c6d0ada14773afe9acac2026beaf003d04f9246597efea055a771eb080cf48fa1b62
|
7
|
+
data.tar.gz: 735c45b24c1bdd1dd67a89653f8a31397542426352b6fbde2b638ff59e457839f7ac55005b371a4d4fa449473b8cce19a9237126d74cde1439d656d4214fcc9d
|
@@ -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
|
-
|
112
|
-
|
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
|
@@ -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)
|
@@ -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
|
-
|
116
|
-
|
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
|
-
|
129
|
-
retry_frequency = options[:
|
130
|
-
options[:
|
131
|
-
|
132
|
-
|
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(
|
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
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
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,
|
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.
|
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-
|
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:
|
389
|
+
version: 1.3.1
|
390
390
|
requirements: []
|
391
391
|
rubyforge_project:
|
392
|
-
rubygems_version: 2.
|
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
|