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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.gitmodules +3 -0
- data/.rspec +2 -0
- data/.travis.yml +32 -0
- data/Gemfile +2 -0
- data/Thorfile +33 -1
- data/angular_webdriver.gemspec +10 -3
- data/docs/overview.md +101 -0
- data/docs/sync.md +53 -0
- data/lib/angular_webdriver/protractor/by.rb +331 -0
- data/lib/angular_webdriver/protractor/by_repeater_inner.rb +106 -0
- data/lib/angular_webdriver/protractor/client_side_scripts.rb +1035 -0
- data/lib/angular_webdriver/protractor/protractor.rb +396 -77
- data/lib/angular_webdriver/protractor/protractor_element.rb +33 -0
- data/lib/angular_webdriver/protractor/rspec_helpers.rb +19 -0
- data/lib/angular_webdriver/protractor/watir_patch.rb +209 -0
- data/lib/angular_webdriver/protractor/webdriver_patch.rb +246 -0
- data/lib/angular_webdriver/version.rb +2 -2
- data/lib/angular_webdriver.rb +14 -1
- data/{LICENSE → license/angular_webdriver/LICENSE.txt} +0 -0
- data/{lib/angular_webdriver → license}/protractor/LICENSE.txt +0 -0
- data/{lib/angular_webdriver/protractor/get_url_trace.rb → notes/bootstrap_notes.md} +13 -0
- data/notes/element_by_id/element_by_id_sync_off.txt +12 -0
- data/notes/element_by_id/element_by_id_sync_on.txt +74 -0
- data/notes/element_chaining_debug.txt +94 -0
- data/notes/evaluate/js_evaluate_sync_on.txt +60 -0
- data/notes/evaluate/ruby_evaluate_sync_on.txt +35 -0
- data/notes/get_title/browser_get_title_sync_off.txt +11 -0
- data/notes/get_title/browser_get_title_sync_on.txt +54 -0
- data/notes/phantomjs.md +23 -0
- data/notes/protractor_cli_bugs.txt +39 -0
- data/notes/protractor_get/protractor_get.rb +102 -0
- data/notes/protractor_get/protractor_get_website_sync_off.txt +11 -0
- data/notes/protractor_get/protractor_get_website_sync_on.txt +86 -0
- data/notes/repeater/findAllRepeaterRows_annotated.txt +150 -0
- data/notes/repeater/findAllRepeaterRows_raw.txt +145 -0
- data/notes/repeater/findRepeaterColumn_annotated.txt +317 -0
- data/notes/repeater/findRepeaterColumn_raw.txt +310 -0
- data/notes/repeater/findRepeaterElement_annotated.txt +152 -0
- data/notes/repeater/findRepeaterElement_raw.txt +146 -0
- data/notes/repeater/findRepeaterRows_annotated.txt +156 -0
- data/notes/repeater/findRepeaterRows_raw.txt +152 -0
- data/notes/sync_after.md +46 -0
- data/notes/sync_notes.md +137 -0
- data/notes/synchronize_spec/status_gettext.txt +121 -0
- data/notes/synchronize_spec/status_gettext_x3.txt +451 -0
- data/notes/synchronize_spec/synchronize_spec.js.txt +74 -0
- data/notes/synchronize_spec/watir_gettext.txt +73 -0
- data/readme.md +52 -12
- data/release_notes.md +127 -0
- data/selenium_server/lib/logs.rb +50 -0
- data/selenium_server/lib/selenium_server.rb +21 -0
- data/selenium_server/readme.md +3 -0
- data/selenium_server/spec/logs_spec.rb +18 -0
- data/selenium_server/spec/nodejs_sync_spec_waithttp_annotated.txt +54 -0
- data/selenium_server/spec/nodejs_sync_spec_waithttp_raw.txt +367 -0
- data/selenium_server/spec/nodejs_sync_spec_waithttp_raw_processed.txt +43 -0
- data/selenium_server/spec/ruby_sync_spec_waithttp_annotated.txt +59 -0
- data/selenium_server/spec/ruby_sync_spec_waithttp_raw.txt +267 -0
- data/selenium_server/spec/ruby_sync_spec_waithttp_raw_processed.txt +39 -0
- data/selenium_server/spec/spec_helper.rb +6 -0
- data/selenium_server/spec/status_gettext_x3.txt +429 -0
- data/selenium_server/spec/status_gettext_x3_annotated.txt +86 -0
- metadata +91 -18
- data/lib/angular_webdriver/protractor/clientSideScripts.json +0 -19
- data/lib/angular_webdriver/protractor/clientsidescripts.js +0 -671
- data/lib/angular_webdriver/protractor/scripts.rb +0 -7
- data/lib/angular_webdriver/protractor/scripts_to_json.js +0 -11
- data/spec/protractor_spec.rb +0 -40
- data/spec/spec_helper.rb +0 -5
@@ -0,0 +1,367 @@
|
|
1
|
+
17:12:53.968 INFO [1] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
|
2
|
+
17:12:54.019 INFO [1] org.openqa.selenium.server.SeleniumServer - Writing debug logs to aa.txt
|
3
|
+
17:12:54.019 INFO [1] org.openqa.selenium.server.SeleniumServer - Java: Oracle Corporation 25.25-b02
|
4
|
+
17:12:54.019 INFO [1] org.openqa.selenium.server.SeleniumServer - OS: Mac OS X 10.10.3 x86_64
|
5
|
+
17:12:54.030 INFO [1] org.openqa.selenium.server.SeleniumServer - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
|
6
|
+
17:12:54.113 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
|
+
17:12:54.188 INFO [1] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
|
8
|
+
17:12:54.190 INFO [1] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
|
9
|
+
17:12:54.191 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
|
10
|
+
17:12:54.216 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@5ba23b66
|
11
|
+
17:12:54.216 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
|
12
|
+
17:12:54.216 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
|
13
|
+
17:12:54.216 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/,/]
|
14
|
+
17:12:54.222 INFO [1] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
|
15
|
+
17:12:54.222 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@7e6cbb7a
|
16
|
+
17:13:03.833 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]])
|
17
|
+
17:13:03.846 INFO [21] org.openqa.selenium.remote.server.DefaultDriverProvider - Creating a new session for Capabilities [{count=1, browserName=firefox, version=ANY}]
|
18
|
+
17:13:08.761 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]]
|
19
|
+
17:13:08.809 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [set script timeoutt: 11000])
|
20
|
+
17:13:08.835 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [set script timeoutt: 11000]
|
21
|
+
17:13:08.994 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get: data:text/html,<html></html>])
|
22
|
+
17:13:09.053 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get: data:text/html,<html></html>]
|
23
|
+
17:13:09.073 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
|
+
17:13:09.148 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
|
+
17:13:09.179 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: return window.location.href;, []])
|
26
|
+
17:13:09.299 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: return window.location.href;, []]
|
27
|
+
17:13:09.316 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
|
+
17:13:09.354 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
|
+
17:13:09.367 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
|
+
17:13:09.415 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
|
+
17:13:09.428 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
|
96
|
+
17:13:09.512 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]]
|
97
|
+
17:13:09.566 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
|
+
17:13:09.632 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
|
+
17:13:09.647 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
|
+
17:13:09.751 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
|
+
17:13:09.766 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@777b0873 -> unknown locator]])
|
206
|
+
17:13:09.813 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@777b0873 -> unknown locator]]
|
207
|
+
17:13:09.827 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
|
+
17:13:09.872 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
|
+
17:13:09.889 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [find elements: By.cssSelector: [ng-click="slowHttp()"]])
|
252
|
+
17:13:09.944 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [find elements: By.cssSelector: [ng-click="slowHttp()"]]
|
253
|
+
17:13:09.968 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [click: 1 [[FirefoxDriver: firefox on MAC (9b861296-469c-8343-bf13-3ea3a8727281)] -> css selector: [ng-click="slowHttp()"]]])
|
254
|
+
17:13:10.065 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [click: 1 [[FirefoxDriver: firefox on MAC (9b861296-469c-8343-bf13-3ea3a8727281)] -> css selector: [ng-click="slowHttp()"]]]
|
255
|
+
17:13:10.079 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute async script: try { return (function (rootSelector, callback) {
|
256
|
+
var el = document.querySelector(rootSelector);
|
257
|
+
|
258
|
+
try {
|
259
|
+
if (!window.angular) {
|
260
|
+
throw new Error('angular could not be found on the window');
|
261
|
+
}
|
262
|
+
if (angular.getTestability) {
|
263
|
+
angular.getTestability(el).whenStable(callback);
|
264
|
+
} else {
|
265
|
+
if (!angular.element(el).injector()) {
|
266
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
267
|
+
' this may mean it is not inside ng-app.');
|
268
|
+
}
|
269
|
+
angular.element(el).injector().get('$browser').
|
270
|
+
notifyWhenNoOutstandingRequests(callback);
|
271
|
+
}
|
272
|
+
} catch (err) {
|
273
|
+
callback(err.message);
|
274
|
+
}
|
275
|
+
}).apply(this, arguments); }
|
276
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
|
277
|
+
17:13:15.069 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute async script: try { return (function (rootSelector, callback) {
|
278
|
+
var el = document.querySelector(rootSelector);
|
279
|
+
|
280
|
+
try {
|
281
|
+
if (!window.angular) {
|
282
|
+
throw new Error('angular could not be found on the window');
|
283
|
+
}
|
284
|
+
if (angular.getTestability) {
|
285
|
+
angular.getTestability(el).whenStable(callback);
|
286
|
+
} else {
|
287
|
+
if (!angular.element(el).injector()) {
|
288
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
289
|
+
' this may mean it is not inside ng-app.');
|
290
|
+
}
|
291
|
+
angular.element(el).injector().get('$browser').
|
292
|
+
notifyWhenNoOutstandingRequests(callback);
|
293
|
+
}
|
294
|
+
} catch (err) {
|
295
|
+
callback(err.message);
|
296
|
+
}
|
297
|
+
}).apply(this, arguments); }
|
298
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
|
299
|
+
17:13:15.083 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
|
300
|
+
var root = document.querySelector(rootSelector || 'body');
|
301
|
+
using = using || document;
|
302
|
+
if (angular.getTestability) {
|
303
|
+
return angular.getTestability(root).
|
304
|
+
findBindings(using, binding, exactMatch);
|
305
|
+
}
|
306
|
+
var bindings = using.getElementsByClassName('ng-binding');
|
307
|
+
var matches = [];
|
308
|
+
for (var i = 0; i < bindings.length; ++i) {
|
309
|
+
var dataBinding = angular.element(bindings[i]).data('$binding');
|
310
|
+
if (dataBinding) {
|
311
|
+
var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
|
312
|
+
if (exactMatch) {
|
313
|
+
var matcher = new RegExp('({|\\s|^|\\|)' +
|
314
|
+
/* See http://stackoverflow.com/q/3561711 */
|
315
|
+
binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
|
316
|
+
'(}|\\s|$|\\|)');
|
317
|
+
if (matcher.test(bindingName)) {
|
318
|
+
matches.push(bindings[i]);
|
319
|
+
}
|
320
|
+
} else {
|
321
|
+
if (bindingName.indexOf(binding) != -1) {
|
322
|
+
matches.push(bindings[i]);
|
323
|
+
}
|
324
|
+
}
|
325
|
+
|
326
|
+
}
|
327
|
+
}
|
328
|
+
return matches; /* Return the whole array for webdriver.findElements. */
|
329
|
+
}).apply(this, arguments); }
|
330
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]])
|
331
|
+
17:13:15.141 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [execute script: try { return (function (binding, exactMatch, using, rootSelector) {
|
332
|
+
var root = document.querySelector(rootSelector || 'body');
|
333
|
+
using = using || document;
|
334
|
+
if (angular.getTestability) {
|
335
|
+
return angular.getTestability(root).
|
336
|
+
findBindings(using, binding, exactMatch);
|
337
|
+
}
|
338
|
+
var bindings = using.getElementsByClassName('ng-binding');
|
339
|
+
var matches = [];
|
340
|
+
for (var i = 0; i < bindings.length; ++i) {
|
341
|
+
var dataBinding = angular.element(bindings[i]).data('$binding');
|
342
|
+
if (dataBinding) {
|
343
|
+
var bindingName = dataBinding.exp || dataBinding[0].exp || dataBinding;
|
344
|
+
if (exactMatch) {
|
345
|
+
var matcher = new RegExp('({|\\s|^|\\|)' +
|
346
|
+
/* See http://stackoverflow.com/q/3561711 */
|
347
|
+
binding.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') +
|
348
|
+
'(}|\\s|$|\\|)');
|
349
|
+
if (matcher.test(bindingName)) {
|
350
|
+
matches.push(bindings[i]);
|
351
|
+
}
|
352
|
+
} else {
|
353
|
+
if (bindingName.indexOf(binding) != -1) {
|
354
|
+
matches.push(bindings[i]);
|
355
|
+
}
|
356
|
+
}
|
357
|
+
|
358
|
+
}
|
359
|
+
}
|
360
|
+
return matches; /* Return the whole array for webdriver.findElements. */
|
361
|
+
}).apply(this, arguments); }
|
362
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [slowHttpStatus, false, null, body]]
|
363
|
+
17:13:15.162 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@777b0873 -> unknown locator]])
|
364
|
+
17:13:15.207 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@777b0873 -> unknown locator]]
|
365
|
+
17:13:15.228 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Executing: [delete session: 328e9486-cabe-4967-aefb-cee3ae3c250b])
|
366
|
+
17:13:15.337 INFO [15] org.openqa.selenium.remote.server.DriverServlet - Done: [delete session: 328e9486-cabe-4967-aefb-cee3ae3c250b]
|
367
|
+
17:13:33.766 INFO [16] org.openqa.selenium.server.SeleniumServer - Shutting down...
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Launching a standalone server
|
2
|
+
Writing debug logs to aa.txt
|
3
|
+
Java: Oracle Corporation 25.25-b02
|
4
|
+
OS: Mac OS X 10.10.3 x86_64
|
5
|
+
v2.45.0, with Core v2.45.0. Built from revision 5017cb8
|
6
|
+
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
|
+
RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
|
8
|
+
Version Jetty/5.1.x
|
9
|
+
Started HttpContext[/selenium-server,/selenium-server]
|
10
|
+
Started org.openqa.jetty.jetty.servlet.ServletHandler@5ba23b66
|
11
|
+
Started HttpContext[/wd,/wd]
|
12
|
+
Started HttpContext[/selenium-server/driver,/selenium-server/driver]
|
13
|
+
Started HttpContext[/,/]
|
14
|
+
Started SocketListener on 0.0.0.0:4444
|
15
|
+
Started org.openqa.jetty.jetty.Server@7e6cbb7a
|
16
|
+
Executing: [new session: Capabilities [{count=1, browserName=firefox, version=ANY}]])
|
17
|
+
Creating a new session for Capabilities [{count=1, browserName=firefox, version=ANY}]
|
18
|
+
Executing: [set script timeoutt: 11000])
|
19
|
+
Executing: [get: data:text/html,<html></html>])
|
20
|
+
Executing: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://localhost:8081/index.html#/async");, []])
|
21
|
+
Executing: [execute script: return window.location.href;, []])
|
22
|
+
Executing: [execute async script: Protractor.testForAngular, [10]])
|
23
|
+
Executing: [execute script: return (function () {
|
24
|
+
angular.module('protractorBaseModule_', []).
|
25
|
+
config(['$compileProvider', function($compileProvider) {
|
26
|
+
if ($compileProvider.debugInfoEnabled) {
|
27
|
+
$compileProvider.debugInfoEnabled(true);
|
28
|
+
}
|
29
|
+
}]);
|
30
|
+
}).apply(null, arguments);, []])
|
31
|
+
Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
|
32
|
+
Executing: [execute async script: Protractor.waitForAngular, [body]])
|
33
|
+
Executing: [execute script: Protractor by.binding, [slowHttpStatus, false, null, body]])
|
34
|
+
Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@777b0873 -> unknown locator]])
|
35
|
+
Executing: [execute async script: Protractor.waitForAngular, [body]])
|
36
|
+
Executing: [find elements: By.cssSelector: [ng-click="slowHttp()"]])
|
37
|
+
Executing: [click: 1 [[FirefoxDriver: firefox on MAC (9b861296-469c-8343-bf13-3ea3a8727281)] -> css selector: [ng-click="slowHttp()"]]])
|
38
|
+
Executing: [execute async script: Protractor.waitForAngular, [body]])
|
39
|
+
Executing: [execute script: Protractor by.binding, [slowHttpStatus, false, null, body]])
|
40
|
+
Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@777b0873 -> unknown locator]])
|
41
|
+
Executing: [delete session: 328e9486-cabe-4967-aefb-cee3ae3c250b])
|
42
|
+
Done: [delete session: 328e9486-cabe-4967-aefb-cee3ae3c250b]
|
43
|
+
Shutting down...
|
@@ -0,0 +1,59 @@
|
|
1
|
+
describe 'synchronizing with slow pages' do
|
2
|
+
before { visit 'async' }
|
3
|
+
|
4
|
+
it 'waits for http calls' do
|
5
|
+
status = element(by.binding('slowHttpStatus'))
|
6
|
+
button = element(by.css('[ng-click="slowHttp()"]'))
|
7
|
+
|
8
|
+
expect(status.text).to eq('not started')
|
9
|
+
|
10
|
+
button.click
|
11
|
+
|
12
|
+
expect(status.text).to eq('done')
|
13
|
+
end
|
14
|
+
|
15
|
+
----
|
16
|
+
|
17
|
+
Issues identified:
|
18
|
+
- :: waitForAngular didn't run when using finding by binding.
|
19
|
+
|
20
|
+
- :: data:text/html,<html></html> is requested twice... double check this isn't a bug
|
21
|
+
|
22
|
+
Observation:
|
23
|
+
- :: protractor always uses find elements, the find element
|
24
|
+
logic is handled client side
|
25
|
+
|
26
|
+
Executing: [new session: Capabilities [{rotatable=false, nativeEvents=false, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, version=, platform=ANY, cssSelectorsEnabled=true}]])
|
27
|
+
Creating a new session for Capabilities [{rotatable=false, nativeEvents=false, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, version=, platform=ANY, cssSelectorsEnabled=true}]
|
28
|
+
Executing: [set script timeoutt: 60000])
|
29
|
+
|
30
|
+
// get http://localhost:8081/#/async
|
31
|
+
Executing: [get: data:text/html,<html></html>])
|
32
|
+
Executing: [get: data:text/html,<html></html>])
|
33
|
+
Executing: [execute script: /* Protractor.get(http://localhost:8081/#/async) - reset url */
|
34
|
+
window.location.replace("http://localhost:8081/#/async");, []])
|
35
|
+
Executing: [execute script: /* Protractor.get(http://localhost:8081/#/async) - get url */
|
36
|
+
return window.location.href;, []])
|
37
|
+
Executing: [execute async script: /* Protractor.waitForAngular() */
|
38
|
+
Protractor.waitForAngular, [body]])
|
39
|
+
|
40
|
+
|
41
|
+
// by.binding slowHttpStatus, get text
|
42
|
+
Executing: [execute script: /* Protractor find by.binding() */
|
43
|
+
Protractor by.binding, [slowHttpStatus, false, false, body]])
|
44
|
+
Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@7f3fb971 -> unknown locator]])
|
45
|
+
|
46
|
+
// waitForAngular, by.css ng-click slowHttp, click
|
47
|
+
Executing: [execute async script: /* Protractor.waitForAngular() */
|
48
|
+
Protractor.waitForAngular, [body]])
|
49
|
+
Executing: [find element: By.cssSelector: [ng-click="slowHttp()"]])
|
50
|
+
Executing: [click: 1 [[FirefoxDriver: firefox on MAC (1bf5ce03-36b6-cd48-9de5-69cef3636974)] -> css selector: [ng-click="slowHttp()"]]])
|
51
|
+
|
52
|
+
// by.binding slowHttpStatus, get text
|
53
|
+
Executing: [execute script: /* Protractor find by.binding() */
|
54
|
+
Protractor by.binding, [slowHttpStatus, false, false, body]])
|
55
|
+
Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@7f3fb971 -> unknown locator]])
|
56
|
+
|
57
|
+
Executing: [delete session: a8d1d244-507b-43e3-baf5-52b9938c9063])
|
58
|
+
Done: [delete session: a8d1d244-507b-43e3-baf5-52b9938c9063]
|
59
|
+
Shutting down...
|