calabash-cucumber 0.9.51 → 0.9.53
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
CALABASH_COUNT = {:step_index => 0, :step_line => nil}
|
2
2
|
|
3
|
+
#TODO change this approach as it breaks scenario outlines
|
3
4
|
Before do |scenario|
|
4
5
|
begin
|
5
6
|
CALABASH_COUNT[:step_index] = 0
|
@@ -10,7 +11,6 @@ Before do |scenario|
|
|
10
11
|
end
|
11
12
|
|
12
13
|
AfterStep do |scenario|
|
13
|
-
#Håndtering af den situation hvor Feature/Scenario/steps er mulitline
|
14
14
|
CALABASH_COUNT[:step_index] = CALABASH_COUNT[:step_index] + 1
|
15
15
|
raw = scenario.raw_steps[CALABASH_COUNT[:step_index]]
|
16
16
|
CALABASH_COUNT[:step_line] = raw.line unless raw.nil?
|
@@ -55,13 +55,19 @@ def relaunch
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
|
59
58
|
def app_path
|
60
59
|
ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH)
|
61
60
|
end
|
62
61
|
|
62
|
+
def calabash_notify
|
63
|
+
if self.respond_to?:on_launch
|
64
|
+
self.on_launch
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
63
68
|
Before do |scenario|
|
64
69
|
relaunch
|
70
|
+
calabash_notify
|
65
71
|
end
|
66
72
|
|
67
73
|
at_exit do
|
@@ -33,6 +33,10 @@ module Operations
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
def escape_quotes(str)
|
37
|
+
str.gsub("'","\\\\'")
|
38
|
+
end
|
39
|
+
|
36
40
|
def wait_for(timeout, &block)
|
37
41
|
begin
|
38
42
|
Timeout::timeout(timeout) do
|
@@ -45,6 +49,23 @@ module Operations
|
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
52
|
+
def wait_ready(timeout, times=2,sleep=0.3, &block)
|
53
|
+
raise "Times parameter must be greater than or equal 2" if times < 2
|
54
|
+
raise "Sleep parameter must be greater than 0" if sleep <= 0
|
55
|
+
begin
|
56
|
+
Timeout::timeout(timeout) do
|
57
|
+
while times > 0 do
|
58
|
+
if block.call
|
59
|
+
times -= 1
|
60
|
+
end
|
61
|
+
sleep 0.3
|
62
|
+
end
|
63
|
+
end
|
64
|
+
rescue Exception => e
|
65
|
+
screenshot_and_raise e
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
48
69
|
def query(uiquery, *args)
|
49
70
|
map(uiquery, :query, *args)
|
50
71
|
end
|
@@ -268,7 +289,7 @@ module Operations
|
|
268
289
|
data = load_playback_data(recording)
|
269
290
|
|
270
291
|
post_data = %Q|{"events":"#{data}"|
|
271
|
-
post_data<< %Q|,"query":"#{options[:query]}"| if options[:query]
|
292
|
+
post_data<< %Q|,"query":"#{escape_quotes(options[:query])}"| if options[:query]
|
272
293
|
post_data<< %Q|,"offset":#{options[:offset].to_json}| if options[:offset]
|
273
294
|
post_data<< %Q|,"reverse":#{options[:reverse]}| if options[:reverse]
|
274
295
|
post_data<< %Q|,"prototype":"#{options[:prototype]}"| if options[:prototype]
|
@@ -287,8 +308,8 @@ module Operations
|
|
287
308
|
data = load_playback_data(recording)
|
288
309
|
|
289
310
|
post_data = %Q|{"events":"#{data}"|
|
290
|
-
post_data<< %Q|,"start":"#{options[:start]}"| if options[:start]
|
291
|
-
post_data<< %Q|,"end":"#{options[:end]}"| if options[:end]
|
311
|
+
post_data<< %Q|,"start":"#{escape_quotes(options[:start])}"| if options[:start]
|
312
|
+
post_data<< %Q|,"end":"#{escape_quotes(options[:end])}"| if options[:end]
|
292
313
|
post_data<< %Q|,"offset_start":#{options[:offset_start].to_json}| if options[:offset_start]
|
293
314
|
post_data<< %Q|,"offset_end":#{options[:offset_end].to_json}| if options[:offset_end]
|
294
315
|
post_data << "}"
|
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.
|
4
|
+
version: 0.9.53
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|
16
|
-
requirement: &
|
16
|
+
requirement: &70277488769700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70277488769700
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &70277488768760 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70277488768760
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: CFPropertyList
|
38
|
-
requirement: &
|
38
|
+
requirement: &70277488767520 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70277488767520
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sim_launcher
|
49
|
-
requirement: &
|
49
|
+
requirement: &70277488766520 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70277488766520
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: slowhandcuke
|
60
|
-
requirement: &
|
60
|
+
requirement: &70277488765640 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70277488765640
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: net-http-persistent
|
71
|
-
requirement: &
|
71
|
+
requirement: &70277488764420 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70277488764420
|
80
80
|
description: calabash-cucumber drives tests for native iOS apps. You must link your
|
81
81
|
app with calabash-ios-server framework to execute tests.
|
82
82
|
email:
|