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,451 @@
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
+
18
+ -----
19
+
20
+
21
+ raw protractor logs:
22
+
23
+ 15:51:00.940 INFO [1] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
24
+ 15:51:01.018 INFO [1] org.openqa.selenium.server.SeleniumServer - Writing debug logs to angular_sync.txt
25
+ 15:51:01.018 INFO [1] org.openqa.selenium.server.SeleniumServer - Java: Oracle Corporation 25.25-b02
26
+ 15:51:01.018 INFO [1] org.openqa.selenium.server.SeleniumServer - OS: Mac OS X 10.10.3 x86_64
27
+ 15:51:01.047 INFO [1] org.openqa.selenium.server.SeleniumServer - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
28
+ 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
29
+ 15:51:01.283 INFO [1] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
30
+ 15:51:01.284 INFO [1] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
31
+ 15:51:01.286 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
32
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@5ba23b66
33
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
34
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
35
+ 15:51:01.329 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/,/]
36
+ 15:51:01.340 INFO [1] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
37
+ 15:51:01.340 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@7e6cbb7a
38
+ 15:51:34.766 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]])
39
+ 15:51:34.787 INFO [21] org.openqa.selenium.remote.server.DefaultDriverProvider - Creating a new session for Capabilities [{count=1, browserName=firefox, version=ANY}]
40
+ 15:51:42.070 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]]
41
+ 15:51:42.116 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [set script timeoutt: 11000])
42
+ 15:51:42.143 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [set script timeoutt: 11000]
43
+ 15:51:42.312 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get: data:text/html,<html></html>])
44
+ 15:51:42.388 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get: data:text/html,<html></html>]
45
+ 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");, []])
46
+ 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");, []]
47
+ 15:51:42.486 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: return window.location.href;, []])
48
+ 15:51:42.685 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: return window.location.href;, []]
49
+ 15:51:42.720 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute async script: try { return (function (attempts, asyncCallback) {
50
+ var callback = function(args) {
51
+ setTimeout(function() {
52
+ asyncCallback(args);
53
+ }, 0);
54
+ };
55
+ var check = function(n) {
56
+ try {
57
+ if (window.angular && window.angular.resumeBootstrap) {
58
+ callback([true, null]);
59
+ } else if (n < 1) {
60
+ if (window.angular) {
61
+ callback([false, 'angular never provided resumeBootstrap']);
62
+ } else {
63
+ callback([false, 'retries looking for angular exceeded']);
64
+ }
65
+ } else {
66
+ window.setTimeout(function() {check(n - 1);}, 1000);
67
+ }
68
+ } catch (e) {
69
+ callback([false, e]);
70
+ }
71
+ };
72
+ check(attempts);
73
+ }).apply(this, arguments); }
74
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [10]])
75
+ 15:51:42.812 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (attempts, asyncCallback) {
76
+ var callback = function(args) {
77
+ setTimeout(function() {
78
+ asyncCallback(args);
79
+ }, 0);
80
+ };
81
+ var check = function(n) {
82
+ try {
83
+ if (window.angular && window.angular.resumeBootstrap) {
84
+ callback([true, null]);
85
+ } else if (n < 1) {
86
+ if (window.angular) {
87
+ callback([false, 'angular never provided resumeBootstrap']);
88
+ } else {
89
+ callback([false, 'retries looking for angular exceeded']);
90
+ }
91
+ } else {
92
+ window.setTimeout(function() {check(n - 1);}, 1000);
93
+ }
94
+ } catch (e) {
95
+ callback([false, e]);
96
+ }
97
+ };
98
+ check(attempts);
99
+ }).apply(this, arguments); }
100
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [10]]
101
+ 15:51:42.823 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: return (function () {
102
+ angular.module('protractorBaseModule_', []).
103
+ config(['$compileProvider', function($compileProvider) {
104
+ if ($compileProvider.debugInfoEnabled) {
105
+ $compileProvider.debugInfoEnabled(true);
106
+ }
107
+ }]);
108
+ }).apply(null, arguments);, []])
109
+ 15:51:42.872 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: return (function () {
110
+ angular.module('protractorBaseModule_', []).
111
+ config(['$compileProvider', function($compileProvider) {
112
+ if ($compileProvider.debugInfoEnabled) {
113
+ $compileProvider.debugInfoEnabled(true);
114
+ }
115
+ }]);
116
+ }).apply(null, arguments);, []]
117
+ 15:51:42.883 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
118
+ 15:51:42.977 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]]
119
+ 15:51:43.066 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [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.121 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
142
+ var el = document.querySelector(rootSelector);
143
+
144
+ try {
145
+ if (!window.angular) {
146
+ throw new Error('angular could not be found on the window');
147
+ }
148
+ if (angular.getTestability) {
149
+ angular.getTestability(el).whenStable(callback);
150
+ } else {
151
+ if (!angular.element(el).injector()) {
152
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
153
+ ' this may mean it is not inside ng-app.');
154
+ }
155
+ angular.element(el).injector().get('$browser').
156
+ notifyWhenNoOutstandingRequests(callback);
157
+ }
158
+ } catch (err) {
159
+ callback(err.message);
160
+ }
161
+ }).apply(this, arguments); }
162
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
163
+ 15:51:43.135 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
164
+ var root = document.querySelector(rootSelector || 'body');
165
+ using = using || document;
166
+ if (angular.getTestability) {
167
+ return angular.getTestability(root).
168
+ findBindings(using, binding, exactMatch);
169
+ }
170
+ var bindings = using.getElementsByClassName('ng-binding');
171
+ var matches = [];
172
+ for (var i = 0; i < bindings.length; ++i) {
173
+ var dataBinding = angular.element(bindings[i]).data('$binding');
174
+ if (dataBinding) {
175
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
176
+ if (exactMatch) {
177
+ var matcher = new RegExp('({|\\s|^|\\|)' +
178
+ /* See http://stackoverflow.com/q/3561711 */
179
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
180
+ '(}|\\s|$|\\|)');
181
+ if (matcher.test(bindingName)) {
182
+ matches.push(bindings[i]);
183
+ }
184
+ } else {
185
+ if (bindingName.indexOf(binding) != -1) {
186
+ matches.push(bindings[i]);
187
+ }
188
+ }
189
+
190
+ }
191
+ }
192
+ return matches; /* Return the whole array for webdriver.findElements. */
193
+ }).apply(this, arguments); }
194
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
195
+ 15:51:43.241 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
196
+ var root = document.querySelector(rootSelector || 'body');
197
+ using = using || document;
198
+ if (angular.getTestability) {
199
+ return angular.getTestability(root).
200
+ findBindings(using, binding, exactMatch);
201
+ }
202
+ var bindings = using.getElementsByClassName('ng-binding');
203
+ var matches = [];
204
+ for (var i = 0; i < bindings.length; ++i) {
205
+ var dataBinding = angular.element(bindings[i]).data('$binding');
206
+ if (dataBinding) {
207
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
208
+ if (exactMatch) {
209
+ var matcher = new RegExp('({|\\s|^|\\|)' +
210
+ /* See http://stackoverflow.com/q/3561711 */
211
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
212
+ '(}|\\s|$|\\|)');
213
+ if (matcher.test(bindingName)) {
214
+ matches.push(bindings[i]);
215
+ }
216
+ } else {
217
+ if (bindingName.indexOf(binding) != -1) {
218
+ matches.push(bindings[i]);
219
+ }
220
+ }
221
+
222
+ }
223
+ }
224
+ return matches; /* Return the whole array for webdriver.findElements. */
225
+ }).apply(this, arguments); }
226
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
227
+ 15:51:43.255 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
228
+ 15:51:43.302 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]]
229
+ 15:51:43.317 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [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.369 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
252
+ var el = document.querySelector(rootSelector);
253
+
254
+ try {
255
+ if (!window.angular) {
256
+ throw new Error('angular could not be found on the window');
257
+ }
258
+ if (angular.getTestability) {
259
+ angular.getTestability(el).whenStable(callback);
260
+ } else {
261
+ if (!angular.element(el).injector()) {
262
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
263
+ ' this may mean it is not inside ng-app.');
264
+ }
265
+ angular.element(el).injector().get('$browser').
266
+ notifyWhenNoOutstandingRequests(callback);
267
+ }
268
+ } catch (err) {
269
+ callback(err.message);
270
+ }
271
+ }).apply(this, arguments); }
272
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
273
+ 15:51:43.386 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
274
+ var root = document.querySelector(rootSelector || 'body');
275
+ using = using || document;
276
+ if (angular.getTestability) {
277
+ return angular.getTestability(root).
278
+ findBindings(using, binding, exactMatch);
279
+ }
280
+ var bindings = using.getElementsByClassName('ng-binding');
281
+ var matches = [];
282
+ for (var i = 0; i < bindings.length; ++i) {
283
+ var dataBinding = angular.element(bindings[i]).data('$binding');
284
+ if (dataBinding) {
285
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
286
+ if (exactMatch) {
287
+ var matcher = new RegExp('({|\\s|^|\\|)' +
288
+ /* See http://stackoverflow.com/q/3561711 */
289
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
290
+ '(}|\\s|$|\\|)');
291
+ if (matcher.test(bindingName)) {
292
+ matches.push(bindings[i]);
293
+ }
294
+ } else {
295
+ if (bindingName.indexOf(binding) != -1) {
296
+ matches.push(bindings[i]);
297
+ }
298
+ }
299
+
300
+ }
301
+ }
302
+ return matches; /* Return the whole array for webdriver.findElements. */
303
+ }).apply(this, arguments); }
304
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
305
+ 15:51:43.430 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
306
+ var root = document.querySelector(rootSelector || 'body');
307
+ using = using || document;
308
+ if (angular.getTestability) {
309
+ return angular.getTestability(root).
310
+ findBindings(using, binding, exactMatch);
311
+ }
312
+ var bindings = using.getElementsByClassName('ng-binding');
313
+ var matches = [];
314
+ for (var i = 0; i < bindings.length; ++i) {
315
+ var dataBinding = angular.element(bindings[i]).data('$binding');
316
+ if (dataBinding) {
317
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
318
+ if (exactMatch) {
319
+ var matcher = new RegExp('({|\\s|^|\\|)' +
320
+ /* See http://stackoverflow.com/q/3561711 */
321
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
322
+ '(}|\\s|$|\\|)');
323
+ if (matcher.test(bindingName)) {
324
+ matches.push(bindings[i]);
325
+ }
326
+ } else {
327
+ if (bindingName.indexOf(binding) != -1) {
328
+ matches.push(bindings[i]);
329
+ }
330
+ }
331
+
332
+ }
333
+ }
334
+ return matches; /* Return the whole array for webdriver.findElements. */
335
+ }).apply(this, arguments); }
336
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
337
+ 15:51:43.452 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
338
+ 15:51:43.493 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]]
339
+ 15:51:43.508 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [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.552 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
362
+ var el = document.querySelector(rootSelector);
363
+
364
+ try {
365
+ if (!window.angular) {
366
+ throw new Error('angular could not be found on the window');
367
+ }
368
+ if (angular.getTestability) {
369
+ angular.getTestability(el).whenStable(callback);
370
+ } else {
371
+ if (!angular.element(el).injector()) {
372
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
373
+ ' this may mean it is not inside ng-app.');
374
+ }
375
+ angular.element(el).injector().get('$browser').
376
+ notifyWhenNoOutstandingRequests(callback);
377
+ }
378
+ } catch (err) {
379
+ callback(err.message);
380
+ }
381
+ }).apply(this, arguments); }
382
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
383
+ 15:51:43.573 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
384
+ var root = document.querySelector(rootSelector || 'body');
385
+ using = using || document;
386
+ if (angular.getTestability) {
387
+ return angular.getTestability(root).
388
+ findBindings(using, binding, exactMatch);
389
+ }
390
+ var bindings = using.getElementsByClassName('ng-binding');
391
+ var matches = [];
392
+ for (var i = 0; i < bindings.length; ++i) {
393
+ var dataBinding = angular.element(bindings[i]).data('$binding');
394
+ if (dataBinding) {
395
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
396
+ if (exactMatch) {
397
+ var matcher = new RegExp('({|\\s|^|\\|)' +
398
+ /* See http://stackoverflow.com/q/3561711 */
399
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
400
+ '(}|\\s|$|\\|)');
401
+ if (matcher.test(bindingName)) {
402
+ matches.push(bindings[i]);
403
+ }
404
+ } else {
405
+ if (bindingName.indexOf(binding) != -1) {
406
+ matches.push(bindings[i]);
407
+ }
408
+ }
409
+
410
+ }
411
+ }
412
+ return matches; /* Return the whole array for webdriver.findElements. */
413
+ }).apply(this, arguments); }
414
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
415
+ 15:51:43.619 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
416
+ var root = document.querySelector(rootSelector || 'body');
417
+ using = using || document;
418
+ if (angular.getTestability) {
419
+ return angular.getTestability(root).
420
+ findBindings(using, binding, exactMatch);
421
+ }
422
+ var bindings = using.getElementsByClassName('ng-binding');
423
+ var matches = [];
424
+ for (var i = 0; i < bindings.length; ++i) {
425
+ var dataBinding = angular.element(bindings[i]).data('$binding');
426
+ if (dataBinding) {
427
+ var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
428
+ if (exactMatch) {
429
+ var matcher = new RegExp('({|\\s|^|\\|)' +
430
+ /* See http://stackoverflow.com/q/3561711 */
431
+ binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
432
+ '(}|\\s|$|\\|)');
433
+ if (matcher.test(bindingName)) {
434
+ matches.push(bindings[i]);
435
+ }
436
+ } else {
437
+ if (bindingName.indexOf(binding) != -1) {
438
+ matches.push(bindings[i]);
439
+ }
440
+ }
441
+
442
+ }
443
+ }
444
+ return matches; /* Return the whole array for webdriver.findElements. */
445
+ }).apply(this, arguments); }
446
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
447
+ 15:51:43.635 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]])
448
+ 15:51:43.700 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@58ceb9cc -> unknown locator]]
449
+ 15:51:43.730 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [delete session: 90d3b5c4-6af6-4c14-8660-aa60fe91dd1f])
450
+ 15:51:43.839 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [delete session: 90d3b5c4-6af6-4c14-8660-aa60fe91dd1f]
451
+ 15:51:57.102 INFO [16] org.openqa.selenium.server.SeleniumServer - Shutting down...
@@ -0,0 +1,74 @@
1
+ $ java -jar selenium-server-standalone-2.45.0.jar
2
+ 11:01:47.348 INFO - Launching a standalone server
3
+ 11:01:47.400 INFO - Java: Oracle Corporation 25.25-b02
4
+ 11:01:47.401 INFO - OS: Mac OS X 10.10.3 x86_64
5
+ 11:01:47.415 INFO - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
6
+ 11:01:47.536 INFO - 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
+ 11:01:47.602 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
8
+ 11:01:47.603 INFO - Version Jetty/5.1.x
9
+ 11:01:47.606 INFO - Started HttpContext[/selenium-server,/selenium-server]
10
+ 11:01:47.632 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@7e0babb1
11
+ 11:01:47.632 INFO - Started HttpContext[/wd,/wd]
12
+ 11:01:47.632 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
13
+ 11:01:47.633 INFO - Started HttpContext[/,/]
14
+ 11:01:47.639 INFO - Started SocketListener on 0.0.0.0:4444
15
+ 11:01:47.639 INFO - Started org.openqa.jetty.jetty.Server@6e2c634b
16
+ 11:01:51.375 INFO - Executing: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]])
17
+ 11:01:51.389 INFO - Creating a new session for Capabilities [{count=1, browserName=firefox, version=ANY}]
18
+ 11:01:56.965 INFO - Done: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]]
19
+
20
+ 11:01:57.005 INFO - Executing: [set script timeoutt: 11000])
21
+ 11:01:57.023 INFO - Done: [set script timeoutt: 11000]
22
+
23
+ // get "http://localhost:8081/index.html#/async"
24
+ 11:01:57.162 INFO - Executing: [get: data:text/html,<html></html>])
25
+ 11:01:57.243 INFO - Done: [get: data:text/html,<html></html>]
26
+ 11:01:57.255 INFO - Executing: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://localhost:8081/index.html#/async");, []])
27
+ 11:01:57.346 INFO - Done: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://localhost:8081/index.html#/async");, []]
28
+ 11:01:57.368 INFO - Executing: [execute script: return window.location.href;, []])
29
+ 11:01:57.457 INFO - Done: [execute script: return window.location.href;, []]
30
+
31
+ // testForAngular
32
+ 11:01:57.476 INFO - Executing: [testForAngular, [10]])
33
+ 11:01:57.520 INFO - Done: [testForAngular]
34
+ 11:01:57.591 INFO - Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
35
+ 11:01:57.681 INFO - Done: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]]
36
+
37
+ // waitForAngular
38
+ 11:01:57.740 INFO - Executing: [waitForAngular])
39
+ 11:01:57.792 INFO - Done: [waitForAngular]
40
+
41
+ // Find by binding
42
+ 11:01:57.807 INFO - Executing: [findByBinding, [slowHttpStatus, false, null, body]])
43
+ 11:01:57.909 INFO - Done: [find by binding]
44
+ 11:01:57.930 INFO - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@4fa55238 -> unknown locator]])
45
+ 11:01:57.968 INFO - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@4fa55238 -> unknown locator]]
46
+
47
+
48
+ // waitForAngular
49
+ 11:01:57.982 INFO - Executing: [waitForAngular])
50
+ 11:01:58.028 INFO - Done: [waitForAngular]
51
+
52
+ // Find by CSS
53
+ 11:01:58.039 INFO - Executing: [find elements: By.cssSelector: [ng-click="slowHttp()"]])
54
+ 11:01:58.093 INFO - Done: [find elements: By.cssSelector: [ng-click="slowHttp()"]]
55
+
56
+ // Click
57
+ 11:01:58.109 INFO - Executing: [click: 1 [[FirefoxDriver: firefox on MAC (b2bfa3ec-6318-6646-8f91-9486d51c4400)] -> css selector: [ng-click="slowHttp()"]]])
58
+ 11:01:58.203 INFO - Done: [click: 1 [[FirefoxDriver: firefox on MAC (b2bfa3ec-6318-6646-8f91-9486d51c4400)] -> css selector: [ng-click="slowHttp()"]]]
59
+
60
+
61
+ // waitForAngular
62
+ 11:01:58.216 INFO - Executing: [waitForAngular])
63
+ 11:02:03.211 INFO - Done: [waitForAngular]
64
+
65
+ // Find by binding
66
+ 11:02:03.226 INFO - Executing: [findByBinding, [slowHttpStatus, false, null, body]]
67
+
68
+ // get text
69
+ 11:02:03.291 INFO - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@4fa55238 -> unknown locator]])
70
+ 11:02:03.339 INFO - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@4fa55238 -> unknown locator]]
71
+
72
+
73
+ 11:02:03.362 INFO - Executing: [delete session: 48f4d92c-afbd-459d-bde0-7a39b56b45b6])
74
+ 11:02:03.468 INFO - Done: [delete session: 48f4d92c-afbd-459d-bde0-7a39b56b45b6]
@@ -0,0 +1,73 @@
1
+ ele = browser.element(css: '[ng-click="slowHttp()"]')
2
+ ele.text
3
+
4
+ 11:59:21.947 INFO - Executing: [get current window handle])
5
+ 11:59:28.786 INFO - Done: [get current window handle]
6
+ 11:59:28.790 INFO - Executing: [get window handles])
7
+ 11:59:28.878 INFO - Done: [get window handles]
8
+ 11:59:28.883 INFO - Executing: [switch to frame: null])
9
+ 11:59:28.974 INFO - Done: [switch to frame: null]
10
+ 11:59:28.979 INFO - Executing: [is enabled: 0 [[FirefoxDriver: firefox on MAC (9b9be3e9-bff2-2d4e-a479-b85a9ee556c2)] -> css selector: [ng-click="slowHttp()"]]])
11
+ 11:59:39.046 INFO - Done: [is enabled: 0 [[FirefoxDriver: firefox on MAC (9b9be3e9-bff2-2d4e-a479-b85a9ee556c2)] -> css selector: [ng-click="slowHttp()"]]]
12
+ 11:59:39.049 INFO - Executing: [get text: 0 [[FirefoxDriver: firefox on MAC (9b9be3e9-bff2-2d4e-a479-b85a9ee556c2)] -> css selector: [ng-click="slowHttp()"]]])
13
+ 11:59:39.151 INFO - Done: [get text: 0 [[FirefoxDriver: firefox on MAC (9b9be3e9-bff2-2d4e-a479-b85a9ee556c2)] -> css selector: [ng-click="slowHttp()"]]]
14
+
15
+
16
+ enable always locate:
17
+ Watir.always_locate = true
18
+
19
+ default is true... setting this doesn't always locate.
20
+
21
+
22
+ with always locate patch:
23
+
24
+ 12:40:11.029 INFO - Executing: [execute async script: /* Protractor.waitForAngular() */
25
+ try { return (function (rootSelector, callback) {
26
+ var el = document.querySelector(rootSelector);
27
+
28
+ try {
29
+ if (!window.angular) {
30
+ throw new Error('angular could not be found on the window');
31
+ }
32
+ if (angular.getTestability) {
33
+ angular.getTestability(el).whenStable(callback);
34
+ } else {
35
+ if (!angular.element(el).injector()) {
36
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
37
+ ' this may mean it is not inside ng-app.');
38
+ }
39
+ angular.element(el).injector().get('$browser').
40
+ notifyWhenNoOutstandingRequests(callback);
41
+ }
42
+ } catch (err) {
43
+ callback(err.message);
44
+ }
45
+ }).apply(this, arguments); }
46
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
47
+ 12:40:11.042 INFO - Done: [execute async script: /* Protractor.waitForAngular() */
48
+ try { return (function (rootSelector, callback) {
49
+ var el = document.querySelector(rootSelector);
50
+
51
+ try {
52
+ if (!window.angular) {
53
+ throw new Error('angular could not be found on the window');
54
+ }
55
+ if (angular.getTestability) {
56
+ angular.getTestability(el).whenStable(callback);
57
+ } else {
58
+ if (!angular.element(el).injector()) {
59
+ throw new Error('root element (' + rootSelector + ') has no injector.' +
60
+ ' this may mean it is not inside ng-app.');
61
+ }
62
+ angular.element(el).injector().get('$browser').
63
+ notifyWhenNoOutstandingRequests(callback);
64
+ }
65
+ } catch (err) {
66
+ callback(err.message);
67
+ }
68
+ }).apply(this, arguments); }
69
+ catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
70
+ 12:40:11.054 INFO - Executing: [find element: By.cssSelector: [ng-click="slowHttp()"]])
71
+ 12:40:11.147 INFO - Done: [find element: By.cssSelector: [ng-click="slowHttp()"]]
72
+ 12:40:11.163 INFO - Executing: [get text: 0 [[FirefoxDriver: firefox on MAC (b7da1100-8e8a-6044-8abf-317acfeb389e)] -> css selector: [ng-click="slowHttp()"]]])
73
+ 12:40:11.209 INFO - Done: [get text: 0 [[FirefoxDriver: firefox on MAC (b7da1100-8e8a-6044-8abf-317acfeb389e)] -> css selector: [ng-click="slowHttp()"]]]