angular_webdriver 0.0.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.gitmodules +3 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +32 -0
  6. data/Gemfile +2 -0
  7. data/Thorfile +33 -1
  8. data/angular_webdriver.gemspec +10 -3
  9. data/docs/overview.md +101 -0
  10. data/docs/sync.md +53 -0
  11. data/lib/angular_webdriver/protractor/by.rb +331 -0
  12. data/lib/angular_webdriver/protractor/by_repeater_inner.rb +106 -0
  13. data/lib/angular_webdriver/protractor/client_side_scripts.rb +1035 -0
  14. data/lib/angular_webdriver/protractor/protractor.rb +396 -77
  15. data/lib/angular_webdriver/protractor/protractor_element.rb +33 -0
  16. data/lib/angular_webdriver/protractor/rspec_helpers.rb +19 -0
  17. data/lib/angular_webdriver/protractor/watir_patch.rb +209 -0
  18. data/lib/angular_webdriver/protractor/webdriver_patch.rb +246 -0
  19. data/lib/angular_webdriver/version.rb +2 -2
  20. data/lib/angular_webdriver.rb +14 -1
  21. data/{LICENSE → license/angular_webdriver/LICENSE.txt} +0 -0
  22. data/{lib/angular_webdriver → license}/protractor/LICENSE.txt +0 -0
  23. data/{lib/angular_webdriver/protractor/get_url_trace.rb → notes/bootstrap_notes.md} +13 -0
  24. data/notes/element_by_id/element_by_id_sync_off.txt +12 -0
  25. data/notes/element_by_id/element_by_id_sync_on.txt +74 -0
  26. data/notes/element_chaining_debug.txt +94 -0
  27. data/notes/evaluate/js_evaluate_sync_on.txt +60 -0
  28. data/notes/evaluate/ruby_evaluate_sync_on.txt +35 -0
  29. data/notes/get_title/browser_get_title_sync_off.txt +11 -0
  30. data/notes/get_title/browser_get_title_sync_on.txt +54 -0
  31. data/notes/phantomjs.md +23 -0
  32. data/notes/protractor_cli_bugs.txt +39 -0
  33. data/notes/protractor_get/protractor_get.rb +102 -0
  34. data/notes/protractor_get/protractor_get_website_sync_off.txt +11 -0
  35. data/notes/protractor_get/protractor_get_website_sync_on.txt +86 -0
  36. data/notes/repeater/findAllRepeaterRows_annotated.txt +150 -0
  37. data/notes/repeater/findAllRepeaterRows_raw.txt +145 -0
  38. data/notes/repeater/findRepeaterColumn_annotated.txt +317 -0
  39. data/notes/repeater/findRepeaterColumn_raw.txt +310 -0
  40. data/notes/repeater/findRepeaterElement_annotated.txt +152 -0
  41. data/notes/repeater/findRepeaterElement_raw.txt +146 -0
  42. data/notes/repeater/findRepeaterRows_annotated.txt +156 -0
  43. data/notes/repeater/findRepeaterRows_raw.txt +152 -0
  44. data/notes/sync_after.md +46 -0
  45. data/notes/sync_notes.md +137 -0
  46. data/notes/synchronize_spec/status_gettext.txt +121 -0
  47. data/notes/synchronize_spec/status_gettext_x3.txt +451 -0
  48. data/notes/synchronize_spec/synchronize_spec.js.txt +74 -0
  49. data/notes/synchronize_spec/watir_gettext.txt +73 -0
  50. data/readme.md +52 -12
  51. data/release_notes.md +127 -0
  52. data/selenium_server/lib/logs.rb +50 -0
  53. data/selenium_server/lib/selenium_server.rb +21 -0
  54. data/selenium_server/readme.md +3 -0
  55. data/selenium_server/spec/logs_spec.rb +18 -0
  56. data/selenium_server/spec/nodejs_sync_spec_waithttp_annotated.txt +54 -0
  57. data/selenium_server/spec/nodejs_sync_spec_waithttp_raw.txt +367 -0
  58. data/selenium_server/spec/nodejs_sync_spec_waithttp_raw_processed.txt +43 -0
  59. data/selenium_server/spec/ruby_sync_spec_waithttp_annotated.txt +59 -0
  60. data/selenium_server/spec/ruby_sync_spec_waithttp_raw.txt +267 -0
  61. data/selenium_server/spec/ruby_sync_spec_waithttp_raw_processed.txt +39 -0
  62. data/selenium_server/spec/spec_helper.rb +6 -0
  63. data/selenium_server/spec/status_gettext_x3.txt +429 -0
  64. data/selenium_server/spec/status_gettext_x3_annotated.txt +86 -0
  65. metadata +91 -18
  66. data/lib/angular_webdriver/protractor/clientSideScripts.json +0 -19
  67. data/lib/angular_webdriver/protractor/clientsidescripts.js +0 -671
  68. data/lib/angular_webdriver/protractor/scripts.rb +0 -7
  69. data/lib/angular_webdriver/protractor/scripts_to_json.js +0 -11
  70. data/spec/protractor_spec.rb +0 -40
  71. data/spec/spec_helper.rb +0 -5
@@ -0,0 +1,429 @@
1
+ 15:51:00.940 INFO [1] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
2
+ 15:51:01.018 INFO [1] org.openqa.selenium.server.SeleniumServer - Writing debug logs to angular_sync.txt
3
+ 15:51:01.018 INFO [1] org.openqa.selenium.server.SeleniumServer - Java: Oracle Corporation 25.25-b02
4
+ 15:51:01.018 INFO [1] org.openqa.selenium.server.SeleniumServer - OS: Mac OS X 10.10.3 x86_64
5
+ 15:51:01.047 INFO [1] org.openqa.selenium.server.SeleniumServer - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
6
+ 15:51:01.179 INFO [1] org.openqa.selenium.remote.server.DefaultDriverSessions - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match with current platform: MAC
7
+ 15:51:01.283 INFO [1] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
8
+ 15:51:01.284 INFO [1] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
9
+ 15:51:01.286 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
10
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@5ba23b66
11
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
12
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
13
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/,/]
14
+ 15:51:01.340 INFO [1] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
15
+ 15:51:01.340 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@7e6cbb7a
16
+ 15:51:34.766 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]])
17
+ 15:51:34.787 INFO [21] org.openqa.selenium.remote.server.DefaultDriverProvider - Creating a new session for Capabilities [{count=1, browserName=firefox, version=ANY}]
18
+ 15:51:42.070 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]]
19
+ 15:51:42.116 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [set script timeoutt: 11000])
20
+ 15:51:42.143 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [set script timeoutt: 11000]
21
+ 15:51:42.312 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get: data:text/html,<html></html>])
22
+ 15:51:42.388 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get: data:text/html,<html></html>]
23
+ 15:51:42.401 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://localhost:8081/index.html#/async");, []])
24
+ 15:51:42.464 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://localhost:8081/index.html#/async");, []]
25
+ 15:51:42.486 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: return window.location.href;, []])
26
+ 15:51:42.685 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: return window.location.href;, []]
27
+ 15:51:42.720 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute async script: try { return (function (attempts, asyncCallback) {
28
+ var callback = function(args) {
29
+ setTimeout(function() {
30
+ asyncCallback(args);
31
+ }, 0);
32
+ };
33
+ var check = function(n) {
34
+ try {
35
+ if (window.angular && window.angular.resumeBootstrap) {
36
+ callback([true, null]);
37
+ } else if (n < 1) {
38
+ if (window.angular) {
39
+ callback([false, 'angular never provided resumeBootstrap']);
40
+ } else {
41
+ callback([false, 'retries looking for angular exceeded']);
42
+ }
43
+ } else {
44
+ window.setTimeout(function() {check(n - 1);}, 1000);
45
+ }
46
+ } catch (e) {
47
+ callback([false, e]);
48
+ }
49
+ };
50
+ check(attempts);
51
+ }).apply(this, arguments); }
52
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [10]])
53
+ 15:51:42.812 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (attempts, asyncCallback) {
54
+ var callback = function(args) {
55
+ setTimeout(function() {
56
+ asyncCallback(args);
57
+ }, 0);
58
+ };
59
+ var check = function(n) {
60
+ try {
61
+ if (window.angular && window.angular.resumeBootstrap) {
62
+ callback([true, null]);
63
+ } else if (n < 1) {
64
+ if (window.angular) {
65
+ callback([false, 'angular never provided resumeBootstrap']);
66
+ } else {
67
+ callback([false, 'retries looking for angular exceeded']);
68
+ }
69
+ } else {
70
+ window.setTimeout(function() {check(n - 1);}, 1000);
71
+ }
72
+ } catch (e) {
73
+ callback([false, e]);
74
+ }
75
+ };
76
+ check(attempts);
77
+ }).apply(this, arguments); }
78
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [10]]
79
+ 15:51:42.823 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: return (function () {
80
+ angular.module('protractorBaseModule_', []).
81
+ config(['$compileProvider', function($compileProvider) {
82
+ if ($compileProvider.debugInfoEnabled) {
83
+ $compileProvider.debugInfoEnabled(true);
84
+ }
85
+ }]);
86
+ }).apply(null, arguments);, []])
87
+ 15:51:42.872 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: return (function () {
88
+ angular.module('protractorBaseModule_', []).
89
+ config(['$compileProvider', function($compileProvider) {
90
+ if ($compileProvider.debugInfoEnabled) {
91
+ $compileProvider.debugInfoEnabled(true);
92
+ }
93
+ }]);
94
+ }).apply(null, arguments);, []]
95
+ 15:51:42.883 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
96
+ 15:51:42.977 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]]
97
+ 15:51:43.066 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute async script: try { return (function (rootSelector, callback) {
98
+ var el = document.querySelector(rootSelector);
99
+
100
+ try {
101
+ if (!window.angular) {
102
+ throw new Error('angular could not be found on the window');
103
+ }
104
+ if (angular.getTestability) {
105
+ angular.getTestability(el).whenStable(callback);
106
+ } else {
107
+ if (!angular.element(el).injector()) {
108
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
109
+ ' this may mean it is not inside ng-app.');
110
+ }
111
+ angular.element(el).injector().get('$browser').
112
+ notifyWhenNoOutstandingRequests(callback);
113
+ }
114
+ } catch (err) {
115
+ callback(err.message);
116
+ }
117
+ }).apply(this, arguments); }
118
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
119
+ 15:51:43.121 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
120
+ var el = document.querySelector(rootSelector);
121
+
122
+ try {
123
+ if (!window.angular) {
124
+ throw new Error('angular could not be found on the window');
125
+ }
126
+ if (angular.getTestability) {
127
+ angular.getTestability(el).whenStable(callback);
128
+ } else {
129
+ if (!angular.element(el).injector()) {
130
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
131
+ ' this may mean it is not inside ng-app.');
132
+ }
133
+ angular.element(el).injector().get('$browser').
134
+ notifyWhenNoOutstandingRequests(callback);
135
+ }
136
+ } catch (err) {
137
+ callback(err.message);
138
+ }
139
+ }).apply(this, arguments); }
140
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
141
+ 15:51:43.135 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
142
+ var root = document.querySelector(rootSelector || 'body');
143
+ using = using || document;
144
+ if (angular.getTestability) {
145
+ return angular.getTestability(root).
146
+ findBindings(using, binding, exactMatch);
147
+ }
148
+ var bindings = using.getElementsByClassName('ng-binding');
149
+ var matches = [];
150
+ for (var i = 0; i < bindings.length; ++i) {
151
+ var dataBinding = angular.element(bindings[i]).data('$binding');
152
+ if (dataBinding) {
153
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
154
+ if (exactMatch) {
155
+ var matcher = new RegExp('({|\\s|^|\\|)' +
156
+ /* See http://stackoverflow.com/q/3561711 */
157
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
158
+ '(}|\\s|$|\\|)');
159
+ if (matcher.test(bindingName)) {
160
+ matches.push(bindings[i]);
161
+ }
162
+ } else {
163
+ if (bindingName.indexOf(binding) != -1) {
164
+ matches.push(bindings[i]);
165
+ }
166
+ }
167
+
168
+ }
169
+ }
170
+ return matches; /* Return the whole array for webdriver.findElements. */
171
+ }).apply(this, arguments); }
172
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
173
+ 15:51:43.241 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
174
+ var root = document.querySelector(rootSelector || 'body');
175
+ using = using || document;
176
+ if (angular.getTestability) {
177
+ return angular.getTestability(root).
178
+ findBindings(using, binding, exactMatch);
179
+ }
180
+ var bindings = using.getElementsByClassName('ng-binding');
181
+ var matches = [];
182
+ for (var i = 0; i < bindings.length; ++i) {
183
+ var dataBinding = angular.element(bindings[i]).data('$binding');
184
+ if (dataBinding) {
185
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
186
+ if (exactMatch) {
187
+ var matcher = new RegExp('({|\\s|^|\\|)' +
188
+ /* See http://stackoverflow.com/q/3561711 */
189
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
190
+ '(}|\\s|$|\\|)');
191
+ if (matcher.test(bindingName)) {
192
+ matches.push(bindings[i]);
193
+ }
194
+ } else {
195
+ if (bindingName.indexOf(binding) != -1) {
196
+ matches.push(bindings[i]);
197
+ }
198
+ }
199
+
200
+ }
201
+ }
202
+ return matches; /* Return the whole array for webdriver.findElements. */
203
+ }).apply(this, arguments); }
204
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
205
+ 15:51:43.255 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
206
+ 15:51:43.302 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]]
207
+ 15:51:43.317 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute async script: try { return (function (rootSelector, callback) {
208
+ var el = document.querySelector(rootSelector);
209
+
210
+ try {
211
+ if (!window.angular) {
212
+ throw new Error('angular could not be found on the window');
213
+ }
214
+ if (angular.getTestability) {
215
+ angular.getTestability(el).whenStable(callback);
216
+ } else {
217
+ if (!angular.element(el).injector()) {
218
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
219
+ ' this may mean it is not inside ng-app.');
220
+ }
221
+ angular.element(el).injector().get('$browser').
222
+ notifyWhenNoOutstandingRequests(callback);
223
+ }
224
+ } catch (err) {
225
+ callback(err.message);
226
+ }
227
+ }).apply(this, arguments); }
228
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
229
+ 15:51:43.369 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
230
+ var el = document.querySelector(rootSelector);
231
+
232
+ try {
233
+ if (!window.angular) {
234
+ throw new Error('angular could not be found on the window');
235
+ }
236
+ if (angular.getTestability) {
237
+ angular.getTestability(el).whenStable(callback);
238
+ } else {
239
+ if (!angular.element(el).injector()) {
240
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
241
+ ' this may mean it is not inside ng-app.');
242
+ }
243
+ angular.element(el).injector().get('$browser').
244
+ notifyWhenNoOutstandingRequests(callback);
245
+ }
246
+ } catch (err) {
247
+ callback(err.message);
248
+ }
249
+ }).apply(this, arguments); }
250
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
251
+ 15:51:43.386 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
252
+ var root = document.querySelector(rootSelector || 'body');
253
+ using = using || document;
254
+ if (angular.getTestability) {
255
+ return angular.getTestability(root).
256
+ findBindings(using, binding, exactMatch);
257
+ }
258
+ var bindings = using.getElementsByClassName('ng-binding');
259
+ var matches = [];
260
+ for (var i = 0; i < bindings.length; ++i) {
261
+ var dataBinding = angular.element(bindings[i]).data('$binding');
262
+ if (dataBinding) {
263
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
264
+ if (exactMatch) {
265
+ var matcher = new RegExp('({|\\s|^|\\|)' +
266
+ /* See http://stackoverflow.com/q/3561711 */
267
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
268
+ '(}|\\s|$|\\|)');
269
+ if (matcher.test(bindingName)) {
270
+ matches.push(bindings[i]);
271
+ }
272
+ } else {
273
+ if (bindingName.indexOf(binding) != -1) {
274
+ matches.push(bindings[i]);
275
+ }
276
+ }
277
+
278
+ }
279
+ }
280
+ return matches; /* Return the whole array for webdriver.findElements. */
281
+ }).apply(this, arguments); }
282
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
283
+ 15:51:43.430 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
284
+ var root = document.querySelector(rootSelector || 'body');
285
+ using = using || document;
286
+ if (angular.getTestability) {
287
+ return angular.getTestability(root).
288
+ findBindings(using, binding, exactMatch);
289
+ }
290
+ var bindings = using.getElementsByClassName('ng-binding');
291
+ var matches = [];
292
+ for (var i = 0; i < bindings.length; ++i) {
293
+ var dataBinding = angular.element(bindings[i]).data('$binding');
294
+ if (dataBinding) {
295
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
296
+ if (exactMatch) {
297
+ var matcher = new RegExp('({|\\s|^|\\|)' +
298
+ /* See http://stackoverflow.com/q/3561711 */
299
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
300
+ '(}|\\s|$|\\|)');
301
+ if (matcher.test(bindingName)) {
302
+ matches.push(bindings[i]);
303
+ }
304
+ } else {
305
+ if (bindingName.indexOf(binding) != -1) {
306
+ matches.push(bindings[i]);
307
+ }
308
+ }
309
+
310
+ }
311
+ }
312
+ return matches; /* Return the whole array for webdriver.findElements. */
313
+ }).apply(this, arguments); }
314
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
315
+ 15:51:43.452 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
316
+ 15:51:43.493 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]]
317
+ 15:51:43.508 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute async script: try { return (function (rootSelector, callback) {
318
+ var el = document.querySelector(rootSelector);
319
+
320
+ try {
321
+ if (!window.angular) {
322
+ throw new Error('angular could not be found on the window');
323
+ }
324
+ if (angular.getTestability) {
325
+ angular.getTestability(el).whenStable(callback);
326
+ } else {
327
+ if (!angular.element(el).injector()) {
328
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
329
+ ' this may mean it is not inside ng-app.');
330
+ }
331
+ angular.element(el).injector().get('$browser').
332
+ notifyWhenNoOutstandingRequests(callback);
333
+ }
334
+ } catch (err) {
335
+ callback(err.message);
336
+ }
337
+ }).apply(this, arguments); }
338
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
339
+ 15:51:43.552 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
340
+ var el = document.querySelector(rootSelector);
341
+
342
+ try {
343
+ if (!window.angular) {
344
+ throw new Error('angular could not be found on the window');
345
+ }
346
+ if (angular.getTestability) {
347
+ angular.getTestability(el).whenStable(callback);
348
+ } else {
349
+ if (!angular.element(el).injector()) {
350
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
351
+ ' this may mean it is not inside ng-app.');
352
+ }
353
+ angular.element(el).injector().get('$browser').
354
+ notifyWhenNoOutstandingRequests(callback);
355
+ }
356
+ } catch (err) {
357
+ callback(err.message);
358
+ }
359
+ }).apply(this, arguments); }
360
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
361
+ 15:51:43.573 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
362
+ var root = document.querySelector(rootSelector || 'body');
363
+ using = using || document;
364
+ if (angular.getTestability) {
365
+ return angular.getTestability(root).
366
+ findBindings(using, binding, exactMatch);
367
+ }
368
+ var bindings = using.getElementsByClassName('ng-binding');
369
+ var matches = [];
370
+ for (var i = 0; i < bindings.length; ++i) {
371
+ var dataBinding = angular.element(bindings[i]).data('$binding');
372
+ if (dataBinding) {
373
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
374
+ if (exactMatch) {
375
+ var matcher = new RegExp('({|\\s|^|\\|)' +
376
+ /* See http://stackoverflow.com/q/3561711 */
377
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
378
+ '(}|\\s|$|\\|)');
379
+ if (matcher.test(bindingName)) {
380
+ matches.push(bindings[i]);
381
+ }
382
+ } else {
383
+ if (bindingName.indexOf(binding) != -1) {
384
+ matches.push(bindings[i]);
385
+ }
386
+ }
387
+
388
+ }
389
+ }
390
+ return matches; /* Return the whole array for webdriver.findElements. */
391
+ }).apply(this, arguments); }
392
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
393
+ 15:51:43.619 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
394
+ var root = document.querySelector(rootSelector || 'body');
395
+ using = using || document;
396
+ if (angular.getTestability) {
397
+ return angular.getTestability(root).
398
+ findBindings(using, binding, exactMatch);
399
+ }
400
+ var bindings = using.getElementsByClassName('ng-binding');
401
+ var matches = [];
402
+ for (var i = 0; i < bindings.length; ++i) {
403
+ var dataBinding = angular.element(bindings[i]).data('$binding');
404
+ if (dataBinding) {
405
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
406
+ if (exactMatch) {
407
+ var matcher = new RegExp('({|\\s|^|\\|)' +
408
+ /* See http://stackoverflow.com/q/3561711 */
409
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
410
+ '(}|\\s|$|\\|)');
411
+ if (matcher.test(bindingName)) {
412
+ matches.push(bindings[i]);
413
+ }
414
+ } else {
415
+ if (bindingName.indexOf(binding) != -1) {
416
+ matches.push(bindings[i]);
417
+ }
418
+ }
419
+
420
+ }
421
+ }
422
+ return matches; /* Return the whole array for webdriver.findElements. */
423
+ }).apply(this, arguments); }
424
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
425
+ 15:51:43.635 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
426
+ 15:51:43.700 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]]
427
+ 15:51:43.730 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [delete session: 90d3b5c4-6af6-4c14-8660-aa60fe91dd1f])
428
+ 15:51:43.839 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [delete session: 90d3b5c4-6af6-4c14-8660-aa60fe91dd1f]
429
+ 15:51:57.102 INFO [16] org.openqa.selenium.server.SeleniumServer - Shutting down...
@@ -0,0 +1,86 @@
1
+ var util = require('util');
2
+
3
+ describe('synchronizing with slow pages', function() {
4
+ beforeEach(function() {
5
+ browser.get('index.html#/async');
6
+ });
7
+
8
+ it('waits for http calls', function() {
9
+ var status = element(by.binding('slowHttpStatus'));
10
+
11
+ expect(status.getText()).toEqual('not started');
12
+ expect(status.getText()).toEqual('not started');
13
+ expect(status.getText()).toEqual('not started');
14
+ });
15
+ });
16
+
17
+ In protractor, element() is lazily evaluated.
18
+
19
+ element(by.binding('...')) doesn't make a server call until an action
20
+ is performed on the element.
21
+
22
+ every action always re-finds the element. synchronization is done before
23
+ the element find method. if we didn't refind the element then sync wouldn't trigger
24
+ when interacting with elements.
25
+
26
+ -----
27
+
28
+ Launching a standalone server
29
+ Writing debug logs to angular_sync.txt
30
+ Java: Oracle Corporation 25.25-b02
31
+ OS: Mac OS X 10.10.3 x86_64
32
+ v2.45.0, with Core v2.45.0. Built from revision 5017cb8
33
+ Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match with current platform: MAC
34
+ RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
35
+ Version Jetty/5.1.x
36
+ Started HttpContext[/selenium-server,/selenium-server]
37
+ Started org.openqa.jetty.jetty.servlet.ServletHandler@5ba23b66
38
+ Started HttpContext[/wd,/wd]
39
+ Started HttpContext[/selenium-server/driver,/selenium-server/driver]
40
+ Started HttpContext[/,/]
41
+ Started SocketListener on 0.0.0.0:4444
42
+ Started org.openqa.jetty.jetty.Server@7e6cbb7a
43
+ Executing: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]])
44
+ Creating a new session for Capabilities [{count=1, browserName=firefox, version=ANY}]
45
+ Executing: [set script timeoutt: 11000])
46
+ Executing: [get: data:text/html,<html></html>])
47
+
48
+ // get localhost:8081/index.html#/async
49
+ Executing: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://localhost:8081/index.html#/async");, []])
50
+ Executing: [execute script: return window.location.href;, []])
51
+ Executing: [execute async script: Protractor.testForAngular, [10]])
52
+
53
+ Executing: [execute script: return (function () {
54
+ angular.module('protractorBaseModule_', []).
55
+ config(['$compileProvider', function($compileProvider) {
56
+ if ($compileProvider.debugInfoEnabled) {
57
+ $compileProvider.debugInfoEnabled(true);
58
+ }
59
+ }]);
60
+ }).apply(null, arguments);, []])
61
+ angular.module('protractorBaseModule_', []).
62
+ config(['$compileProvider', function($compileProvider) {
63
+ if ($compileProvider.debugInfoEnabled) {
64
+ $compileProvider.debugInfoEnabled(true);
65
+ }
66
+ }]);
67
+ }).apply(null, arguments);, []]
68
+ Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
69
+
70
+ // wait for angular, by.binding slowHttpStatus, get text
71
+ Executing: [execute async script: Protractor.waitForAngular, [body]])
72
+ Executing: [execute script: Protractor by.binding, [slowHttpStatus, false, null, body]])
73
+ Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
74
+
75
+ // wait for angular, by.binding slowHttpStatus, get text
76
+ Executing: [execute async script: Protractor.waitForAngular, [body]])
77
+ Executing: [execute script: Protractor by.binding, [slowHttpStatus, false, null, body]])
78
+ Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
79
+
80
+ // wait for angular, by.binding slowHttpStatus, get text
81
+ Executing: [execute async script: Protractor.waitForAngular, [body]])
82
+ Executing: [execute script: Protractor by.binding, [slowHttpStatus, false, null, body]])
83
+ Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
84
+
85
+ Executing: [delete session: 90d3b5c4-6af6-4c14-8660-aa60fe91dd1f])
86
+ Shutting down...
metadata CHANGED
@@ -1,29 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular_webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.46.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.46.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: watir-webdriver
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: webdriver_utils
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - ">="
18
46
  - !ruby/object:Gem::Version
19
- version: 2.45.0
47
+ version: 0.0.5
20
48
  type: :runtime
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - ">="
25
53
  - !ruby/object:Gem::Version
26
- version: 2.45.0
54
+ version: 0.0.5
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: rspec
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,19 +95,19 @@ dependencies:
67
95
  - !ruby/object:Gem::Version
68
96
  version: 0.10.1
69
97
  - !ruby/object:Gem::Dependency
70
- name: webdriver_utils
98
+ name: trace_files
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - ">="
101
+ - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: 0.0.3
103
+ version: 0.0.2
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - ">="
108
+ - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: 0.0.3
110
+ version: 0.0.2
83
111
  description: Angular webdriver.
84
112
  email:
85
113
  - code@bootstraponline.com
@@ -88,23 +116,68 @@ extensions: []
88
116
  extra_rdoc_files: []
89
117
  files:
90
118
  - ".gitignore"
119
+ - ".gitmodules"
120
+ - ".rspec"
121
+ - ".travis.yml"
91
122
  - Gemfile
92
- - LICENSE
93
123
  - Thorfile
94
124
  - angular_webdriver.gemspec
125
+ - docs/overview.md
126
+ - docs/sync.md
95
127
  - lib/angular_webdriver.rb
96
- - lib/angular_webdriver/protractor/LICENSE.txt
97
- - lib/angular_webdriver/protractor/clientSideScripts.json
98
- - lib/angular_webdriver/protractor/clientsidescripts.js
99
- - lib/angular_webdriver/protractor/get_url_trace.rb
128
+ - lib/angular_webdriver/protractor/by.rb
129
+ - lib/angular_webdriver/protractor/by_repeater_inner.rb
130
+ - lib/angular_webdriver/protractor/client_side_scripts.rb
100
131
  - lib/angular_webdriver/protractor/protractor.rb
101
- - lib/angular_webdriver/protractor/scripts.rb
102
- - lib/angular_webdriver/protractor/scripts_to_json.js
132
+ - lib/angular_webdriver/protractor/protractor_element.rb
133
+ - lib/angular_webdriver/protractor/rspec_helpers.rb
134
+ - lib/angular_webdriver/protractor/watir_patch.rb
135
+ - lib/angular_webdriver/protractor/webdriver_patch.rb
103
136
  - lib/angular_webdriver/version.rb
137
+ - license/angular_webdriver/LICENSE.txt
138
+ - license/protractor/LICENSE.txt
139
+ - notes/bootstrap_notes.md
140
+ - notes/element_by_id/element_by_id_sync_off.txt
141
+ - notes/element_by_id/element_by_id_sync_on.txt
142
+ - notes/element_chaining_debug.txt
143
+ - notes/evaluate/js_evaluate_sync_on.txt
144
+ - notes/evaluate/ruby_evaluate_sync_on.txt
145
+ - notes/get_title/browser_get_title_sync_off.txt
146
+ - notes/get_title/browser_get_title_sync_on.txt
147
+ - notes/phantomjs.md
148
+ - notes/protractor_cli_bugs.txt
149
+ - notes/protractor_get/protractor_get.rb
150
+ - notes/protractor_get/protractor_get_website_sync_off.txt
151
+ - notes/protractor_get/protractor_get_website_sync_on.txt
152
+ - notes/repeater/findAllRepeaterRows_annotated.txt
153
+ - notes/repeater/findAllRepeaterRows_raw.txt
154
+ - notes/repeater/findRepeaterColumn_annotated.txt
155
+ - notes/repeater/findRepeaterColumn_raw.txt
156
+ - notes/repeater/findRepeaterElement_annotated.txt
157
+ - notes/repeater/findRepeaterElement_raw.txt
158
+ - notes/repeater/findRepeaterRows_annotated.txt
159
+ - notes/repeater/findRepeaterRows_raw.txt
160
+ - notes/sync_after.md
161
+ - notes/sync_notes.md
162
+ - notes/synchronize_spec/status_gettext.txt
163
+ - notes/synchronize_spec/status_gettext_x3.txt
164
+ - notes/synchronize_spec/synchronize_spec.js.txt
165
+ - notes/synchronize_spec/watir_gettext.txt
104
166
  - readme.md
105
167
  - release_notes.md
106
- - spec/protractor_spec.rb
107
- - spec/spec_helper.rb
168
+ - selenium_server/lib/logs.rb
169
+ - selenium_server/lib/selenium_server.rb
170
+ - selenium_server/readme.md
171
+ - selenium_server/spec/logs_spec.rb
172
+ - selenium_server/spec/nodejs_sync_spec_waithttp_annotated.txt
173
+ - selenium_server/spec/nodejs_sync_spec_waithttp_raw.txt
174
+ - selenium_server/spec/nodejs_sync_spec_waithttp_raw_processed.txt
175
+ - selenium_server/spec/ruby_sync_spec_waithttp_annotated.txt
176
+ - selenium_server/spec/ruby_sync_spec_waithttp_raw.txt
177
+ - selenium_server/spec/ruby_sync_spec_waithttp_raw_processed.txt
178
+ - selenium_server/spec/spec_helper.rb
179
+ - selenium_server/spec/status_gettext_x3.txt
180
+ - selenium_server/spec/status_gettext_x3_annotated.txt
108
181
  homepage: https://github.com/bootstraponline/angular_webdriver
109
182
  licenses:
110
183
  - http://www.apache.org/licenses/LICENSE-2.0.txt