run_loop 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/run_loop/core.rb +21 -1
- data/lib/run_loop/version.rb +1 -1
- data/scripts/calabash-uia-min.js +7 -0
- data/scripts/run_loop_basic.js +5 -1
- data/scripts/run_loop_fast_uia.js +2 -0
- data/scripts/run_loop_host.js +1 -0
- metadata +32 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73937dad7c29104b1ae37c879b16e44aff02db3
|
4
|
+
data.tar.gz: dda0b44e84dd217f63e2108912fb74b79049bd1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c63c401d4307fe1accf494b4a6a32619d66043ded3c7c75ebc7ff9cacfdcc32f0fc23552309bd048212c4ca77c0421e8aab5be9b892a3e3ab8383442950db3
|
7
|
+
data.tar.gz: 5d23eda8b969944c6030affb7ff2dcd7da5a1ef357b4b5f6ce8ff9e92d7e169b9dfa0f001182bc0a95811c73fe4eba9b40149bbe00e4a2d0fe37e27b75a30c22
|
data/lib/run_loop/core.rb
CHANGED
@@ -131,7 +131,9 @@ module RunLoop
|
|
131
131
|
|
132
132
|
cal_script = File.join(SCRIPTS_PATH, 'calabash_script_uia.js')
|
133
133
|
File.open(script, 'w') do |file|
|
134
|
-
|
134
|
+
if include_calabash_script?(options)
|
135
|
+
file.puts IO.read(cal_script)
|
136
|
+
end
|
135
137
|
file.puts code
|
136
138
|
end
|
137
139
|
|
@@ -271,6 +273,24 @@ module RunLoop
|
|
271
273
|
run_loop
|
272
274
|
end
|
273
275
|
|
276
|
+
# @!visibility private
|
277
|
+
# Usually we include CalabashScript to ease uia automation.
|
278
|
+
# However in certain scenarios we don't load it since
|
279
|
+
# it slows down the UIAutomation initialization process
|
280
|
+
# occasionally causing privacy/security dialogs not to be automated.
|
281
|
+
#
|
282
|
+
# @return {boolean} true if CalabashScript should be loaded
|
283
|
+
def self.include_calabash_script?(options)
|
284
|
+
|
285
|
+
if (options[:include_calabash_script] == false) || options[:dismiss_immediate_dialogs]
|
286
|
+
return false
|
287
|
+
end
|
288
|
+
if Core.script_for_key(:run_loop_basic) == options[:script]
|
289
|
+
return options[:include_calabash_script]
|
290
|
+
end
|
291
|
+
true
|
292
|
+
end
|
293
|
+
|
274
294
|
# @!visibility private
|
275
295
|
# Are we targeting a simulator?
|
276
296
|
#
|
data/lib/run_loop/version.rb
CHANGED
@@ -0,0 +1,7 @@
|
|
1
|
+
(function(){function m(){return h.frontMostApp()}function r(){return m().mainWindow()}function s(){return m().windows().toArray()}function n(){return m().keyboard()}function l(a,c){this.reason=a;this.a=c||"";this.message=this.toString()}function k(a){return!a||a instanceof UIAElementNil}function t(a,c){var b=c||[],e,d;if(k(a))return b;e=a.elements();for(var f=0,g=e.length;f<g;f+=1)d=e[f],b.push(d),t(d,b);return b}function q(a,c){for(var b=0,e=c.length;b<e;b+=1)a.push(c[b])}function u(a,c){var b=[];
|
2
|
+
if(k(c))return b;c instanceof this[a]&&b.push(c);for(var e=c.elements(),d=0,f=e.length;d<f;d+=1)q(b,u(a,e[d]));return b}function x(a,c){var b=null;if(a instanceof Array){if(3===a.length){var e=a[0],b=a[1],d=a[2];if("string"==typeof d)if(-1==d.indexOf("'"))d="'"+d+"'";else if(-1==d.indexOf('"'))d='"'+d+'"';else throw new l("Escaping for filters not supported yet.");b=c.withPredicate(e+" "+b+" "+d);return!k(b)}return!1}for(e in a)if(a.hasOwnProperty(e))if(b=a[e],"marked"==e){if(c.name()!=b&&c.label()!=
|
3
|
+
b&&(!c.value||c.value!=b))return!1}else if(b=c.withValueForKey(b,e),k(b))return!1;return!0}function v(a,c){if(c(a))return a;var b,e;if(k(a))return null;b=a.elements();for(var d=0,f=b.length;d<f;d+=1)if(e=b[d],v(e,c))return e;return null}function w(a){h.delay(a);return h}var g={},h=UIATarget.localTarget();h.setTimeout(0);l.prototype=error();l.prototype.toString=function(){var a="UIAutomationError[reason="+this.reason;0<this.a.length&&(a+=", details="+this.a);return a+"]"};g.sleep=w;g.query=function(a,
|
4
|
+
c){if(!c)return g.query(a,s());c instanceof UIAElement&&(c=[c]);var b=c,e=null,d=null,f=[],p,h,k,l;p=0;for(k=a.length;p<k;p+=1){e=a[p];h=0;for(l=b.length;h<l;h+=1)d=b[h],"string"===typeof e?"*"===e||"view"==e||"UIAElement"===e?q(f,t(d,[d])):q(f,u(e,d)):x(e,d)&&f.push(d);b=f;f=[]}return b};g.keyboard_visible=function(){return!k(n())};g.keyboard_enter_text=function(a,c){if(!g.keyboard_visible())throw new l("Keyboard not visible");c=c||{};if(c.unsafe)return n().typeString(a),!0;var b=v(r(),function(a){return 1==
|
5
|
+
a.hasKeyboardFocus()});if(k(b))return n().typeString(a),!0;var e=c.initial_text||"",d=new Date,f=c.timeout||60,h=n();do try{return h.typeString(a),!0}catch(m){UIALogger.logMessage("keyboard_enter_text failed: "+m),UIALogger.logMessage("keyboard_enter_text retrying with restore to: "+e),b.setValue(e)}while(!(new Date-d>=1E3*f));throw new l("Unable to enter text","text: "+a+" failed after retrying for "+f);};g.deactivate=function(a){h.deactivateAppForDuration(a)};g.tap_offset=function(a,c,b){b=b||{};
|
6
|
+
return b.unsafe?function(){return c.apply(this,arguments)}:function(){var e=new Date,d=b.timeout||60,f=b.frequency||.1;do try{return c.apply(this,arguments)}catch(g){UIALogger.logMessage(a+"Error: "+g+". Arguments: "+arguments[0]+", "+arguments[1]),w(f)}while(!(new Date-e>=1E3*d));throw new l(a,"Arguments: "+arguments[0]+", "+arguments[1]);}}("tap_offset failed",function(a,c){h.tapWithOptions(a,c||{})},{timeout:60,frequency:.5});this.target=h;this.uia=g;g.app=m;g.window=r;g.windows=s;g.keyboard=n;
|
7
|
+
g.alert=function(){return m().alert()}})();
|
data/scripts/run_loop_basic.js
CHANGED
@@ -193,8 +193,12 @@ function isLocationPrompt(alert) {
|
|
193
193
|
var exps = [
|
194
194
|
["OK", /vil bruge din aktuelle placering/],
|
195
195
|
["OK", /Would Like to Use Your Current Location/],
|
196
|
+
["OK", /Would Like to Send You Notifications/],
|
197
|
+
["Allow", /access your location/],
|
196
198
|
["Ja", /Darf (?:.)+ Ihren aktuellen Ort verwenden/],
|
197
|
-
["OK", /Would Like to Access Your Photos/]
|
199
|
+
["OK", /Would Like to Access Your Photos/],
|
200
|
+
["OK", /Would Like to Access Your Contacts/],
|
201
|
+
["OK", /запрашивает разрешение на использование Ващей текущей пгеопозиции/]
|
198
202
|
],
|
199
203
|
ans, exp,
|
200
204
|
txt;
|
@@ -199,6 +199,8 @@ function isLocationPrompt(alert) {
|
|
199
199
|
["OK", /vil bruge din aktuelle placering/],
|
200
200
|
["OK", /Would Like to Use Your Current Location/],
|
201
201
|
["Ja", /Darf (?:.)+ Ihren aktuellen Ort verwenden/],
|
202
|
+
["OK", /Would Like to Send You Notifications/],
|
203
|
+
["Allow", /access your location/],
|
202
204
|
["OK", /Would Like to Access Your Photos/],
|
203
205
|
["OK", /Would Like to Access Your Contacts/],
|
204
206
|
["OK", /запрашивает разрешение на использование Ващей текущей пгеопозиции/]
|
data/scripts/run_loop_host.js
CHANGED
@@ -216,6 +216,7 @@ function isLocationPrompt(alert) {
|
|
216
216
|
var exps = [
|
217
217
|
["OK", /vil bruge din aktuelle placering/],
|
218
218
|
["OK", /Would Like to Use Your Current Location/],
|
219
|
+
["OK", /Would Like to Send You Notifications/],
|
219
220
|
["Allow", /access your location/],
|
220
221
|
["Ja", /Darf (?:.)+ Ihren aktuellen Ort verwenden/],
|
221
222
|
["OK", /Would Like to Access Your Photos/],
|
metadata
CHANGED
@@ -1,195 +1,195 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: run_loop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
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-09-
|
11
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.18'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.18'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.8'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.8'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: retriable
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.3.3.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.3.3.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: awesome_print
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.2.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.2.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: CFPropertyList
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '2.2'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.6'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: travis
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '1.7'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.7'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '3.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '3.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rake
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ~>
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '10.3'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ~>
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '10.3'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: guard-rspec
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ~>
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '4.3'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ~>
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '4.3'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: guard-bundler
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '2.0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '2.0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: growl
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ~>
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '1.0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '1.0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rb-readline
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- -
|
185
|
+
- - ~>
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0.5'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ~>
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0.5'
|
195
195
|
description: calabash-cucumber drives tests for native iOS apps. RunLoop provides
|
@@ -212,6 +212,7 @@ files:
|
|
212
212
|
- lib/run_loop/sim_control.rb
|
213
213
|
- lib/run_loop/version.rb
|
214
214
|
- lib/run_loop/xctools.rb
|
215
|
+
- scripts/calabash-uia-min.js
|
215
216
|
- scripts/calabash.lldb.erb
|
216
217
|
- scripts/calabash_script_uia.js
|
217
218
|
- scripts/json2-min.js
|
@@ -232,17 +233,17 @@ require_paths:
|
|
232
233
|
- lib
|
233
234
|
required_ruby_version: !ruby/object:Gem::Requirement
|
234
235
|
requirements:
|
235
|
-
- -
|
236
|
+
- - '>='
|
236
237
|
- !ruby/object:Gem::Version
|
237
238
|
version: '1.9'
|
238
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
240
|
requirements:
|
240
|
-
- -
|
241
|
+
- - '>='
|
241
242
|
- !ruby/object:Gem::Version
|
242
243
|
version: '0'
|
243
244
|
requirements: []
|
244
245
|
rubyforge_project:
|
245
|
-
rubygems_version: 2.
|
246
|
+
rubygems_version: 2.4.1
|
246
247
|
signing_key:
|
247
248
|
specification_version: 4
|
248
249
|
summary: Tools related to running Calabash iOS tests
|