run_loop 1.1.0 → 1.1.1.pre1

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: b85916dc0be8fbbf6e5326d953501f5245c15af1
4
- data.tar.gz: bed6f2a0b40c4abf114244ce785a68a8b533abde
3
+ metadata.gz: f3863d38d0bd08af344764bccbfdd02fc74e305f
4
+ data.tar.gz: f632568b5c4e520eefa771c9c2f94d1589963b2a
5
5
  SHA512:
6
- metadata.gz: 9892774caa1ec504e78583089c8320681087c01bb70afd4682593d732c544f9ed6e1800847f6035499d3b2a9273820ef2d1d89ffd24c313c7415f74ae3f4ac5c
7
- data.tar.gz: 2143458e189c9268bc14e1453df476f9fd67a0c86c5b43f010db444405f8a78fe376c484c74592e4fc39b7d647a012fed37be3cd4fe58cf40f5f2fceaf303f54
6
+ metadata.gz: 0a6d9b508d2c5478c4d47ffa55d2c194c593366664719ab5e32cebea49390f0b44bb9c990e235c90982e2c015aa6d97cd35688e856c094bd1470bfeb23668cf0
7
+ data.tar.gz: 29fab379355e8b698dd89cbfcf4cd462c3ca8a033f8b17645e73a951a0ef5f12101cef85658c1f6ecd95d9d38541e43bfc89e0445fadd006826a59e151c656d0
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1.pre1'
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
@@ -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()}})();
@@ -292,17 +292,17 @@ var target = null,
292
292
 
293
293
  for (i=0; i<MAX_TRIES; i+=1) {
294
294
  UIALogger.logMessage("Write result...");
295
+ target.frontMostApp().preferencesValueForKey(__calabashResponse);
296
+ UIALogger.logMessage("Last response..."+__calabashResponse);
295
297
  target.frontMostApp().setPreferencesValueForKey(sanitized, __calabashResponse);
296
- UIALogger.logMessage("Check successful storage...")
297
- UIATarget.localTarget().delay(0.1);
298
- UIALogger.logMessage("Post delay...")
299
298
  res = target.frontMostApp().preferencesValueForKey(__calabashResponse);
299
+ UIALogger.logMessage("Next response..."+__calabashResponse);
300
300
  if (res && res['index'] == sanitized['index']) {
301
301
  UIALogger.logMessage("Storage succeeded: "+ res['index']);
302
302
  return;
303
303
  } else {
304
- UIALogger.logMessage("Storage failed: "+ res);
305
- target.delay(0.5);
304
+ UIALogger.logMessage("Storage failed: "+ res + " Retrying...");
305
+ target.delay(0.2);
306
306
  }
307
307
  }
308
308
  throw new Error("Unable to write to preferences");
@@ -318,11 +318,20 @@ var target = null,
318
318
  "value":err.toString(),
319
319
  "backtrace":(err.stack ? err.stack.toString() : ""),
320
320
  "index":index});
321
+ },
322
+ _resetCalabashPreferences = function () {
323
+ //Implementation is weird but reading pref values seems to have side effects
324
+ //also deleting a key seemed to require writing 0 and then null :)
325
+ var app = UIATarget.localTarget().frontMostApp();
326
+ app.preferencesValueForKey(__calabashRequest);
327
+ app.preferencesValueForKey(__calabashResponse);
328
+ app.setPreferencesValueForKey(0, __calabashResponse);
329
+ app.setPreferencesValueForKey(null, __calabashResponse);
330
+ app.setPreferencesValueForKey(0, __calabashRequest);
331
+ app.setPreferencesValueForKey(null, __calabashRequest);
321
332
  };
322
333
 
323
- UIATarget.localTarget().frontMostApp().setPreferencesValueForKey(null, __calabashResponse);
324
- UIATarget.localTarget().frontMostApp().setPreferencesValueForKey(0, __calabashRequest);
325
-
334
+ _resetCalabashPreferences();
326
335
  Log.result('success',true,true);
327
336
  target = UIATarget.localTarget();
328
337
  while (true) {
@@ -340,11 +349,10 @@ while (true) {
340
349
  }
341
350
 
342
351
  _actualIndex = preferences['index'];
343
- UIALogger.logMessage("index " + _actualIndex + ", expecting: "+_expectedIndex+" -> command: "+ preferences['command']);
344
352
  if (!isNaN(_actualIndex) && _actualIndex >= _expectedIndex) {
353
+ UIATarget.localTarget().frontMostApp().setPreferencesValueForKey(null, __calabashResponse);
345
354
  _exp = preferences['command'];
346
355
  UIALogger.logMessage("index " + _actualIndex + " is command: "+ _exp);
347
- target.frontMostApp().setPreferencesValueForKey(null, __calabashRequest);
348
356
  try {
349
357
  if (_exp == 'break;') {
350
358
  _success("OK", _actualIndex);
@@ -364,7 +372,5 @@ while (true) {
364
372
  continue;
365
373
  }
366
374
  _expectedIndex = Math.max(_actualIndex+1, _expectedIndex+1);
367
-
368
-
369
- target.delay(0.2);
375
+ target.delay(0.1);
370
376
  }
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.1.0
4
+ version: 1.1.1.pre1
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-06 00:00:00.000000000 Z
11
+ date: 2014-11-07 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
- version: '0'
243
+ version: 1.3.1
243
244
  requirements: []
244
245
  rubyforge_project:
245
- rubygems_version: 2.4.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