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,60 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
19:04:49.004 INFO - Executing: [execute script: , []])
|
4
|
+
19:04:49.036 INFO - Done: [execute script: , []]
|
5
|
+
19:05:04.240 INFO - Executing: [execute script: , []])
|
6
|
+
19:05:04.240 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
|
7
|
+
var el = document.querySelector(rootSelector);
|
8
|
+
|
9
|
+
try {
|
10
|
+
if (!window.angular) {
|
11
|
+
throw new Error('angular could not be found on the window');
|
12
|
+
}
|
13
|
+
if (angular.getTestability) {
|
14
|
+
angular.getTestability(el).whenStable(callback);
|
15
|
+
} else {
|
16
|
+
if (!angular.element(el).injector()) {
|
17
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
18
|
+
' this may mean it is not inside ng-app.');
|
19
|
+
}
|
20
|
+
angular.element(el).injector().get('$browser').
|
21
|
+
notifyWhenNoOutstandingRequests(callback);
|
22
|
+
}
|
23
|
+
} catch (err) {
|
24
|
+
callback(err.message);
|
25
|
+
}
|
26
|
+
}).apply(this, arguments); }
|
27
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
|
28
|
+
19:05:04.255 INFO - Done: [execute script: , []]
|
29
|
+
19:05:04.318 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
|
30
|
+
var el = document.querySelector(rootSelector);
|
31
|
+
|
32
|
+
try {
|
33
|
+
if (!window.angular) {
|
34
|
+
throw new Error('angular could not be found on the window');
|
35
|
+
}
|
36
|
+
if (angular.getTestability) {
|
37
|
+
angular.getTestability(el).whenStable(callback);
|
38
|
+
} else {
|
39
|
+
if (!angular.element(el).injector()) {
|
40
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
41
|
+
' this may mean it is not inside ng-app.');
|
42
|
+
}
|
43
|
+
angular.element(el).injector().get('$browser').
|
44
|
+
notifyWhenNoOutstandingRequests(callback);
|
45
|
+
}
|
46
|
+
} catch (err) {
|
47
|
+
callback(err.message);
|
48
|
+
}
|
49
|
+
}).apply(this, arguments); }
|
50
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
|
51
|
+
19:05:04.336 INFO - Executing: [find elements: By.id: checkboxes])
|
52
|
+
19:05:04.443 INFO - Done: [find elements: By.id: checkboxes]
|
53
|
+
19:05:04.462 INFO - Executing: [execute script: try { return (function (element, expression) {
|
54
|
+
return angular.element(element).scope().$eval(expression);
|
55
|
+
}).apply(this, arguments); }
|
56
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [[[FirefoxDriver: firefox on MAC (26afe35d-a29e-a549-b987-7a939847cc5e)] -> id: checkboxes], show]])
|
57
|
+
19:05:04.491 INFO - Done: [execute script: try { return (function (element, expression) {
|
58
|
+
return angular.element(element).scope().$eval(expression);
|
59
|
+
}).apply(this, arguments); }
|
60
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [[[FirefoxDriver: firefox on MAC (26afe35d-a29e-a549-b987-7a939847cc5e)] -> id: checkboxes], show]]
|
@@ -0,0 +1,35 @@
|
|
1
|
+
19:11:27.184 INFO - Done: [execute async script: /* Protractor.waitForAngular() */
|
2
|
+
try { return (function (rootSelector, callback) {
|
3
|
+
var el = document.querySelector(rootSelector);
|
4
|
+
|
5
|
+
try {
|
6
|
+
if (!window.angular) {
|
7
|
+
throw new Error('angular could not be found on the window');
|
8
|
+
}
|
9
|
+
if (angular.getTestability) {
|
10
|
+
angular.getTestability(el).whenStable(callback);
|
11
|
+
} else {
|
12
|
+
if (!angular.element(el).injector()) {
|
13
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
14
|
+
' this may mean it is not inside ng-app.');
|
15
|
+
}
|
16
|
+
angular.element(el).injector().get('$browser').
|
17
|
+
notifyWhenNoOutstandingRequests(callback);
|
18
|
+
}
|
19
|
+
} catch (err) {
|
20
|
+
callback(err.message);
|
21
|
+
}
|
22
|
+
}).apply(this, arguments); }
|
23
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
|
24
|
+
19:11:27.190 INFO - Executing: [find element: By.id: checkboxes])
|
25
|
+
19:11:27.289 INFO - Done: [find element: By.id: checkboxes]
|
26
|
+
19:11:27.293 INFO - Executing: [execute script: /* Protractor.evaluate() */
|
27
|
+
try { return (function (element, expression) {
|
28
|
+
return angular.element(element).scope().$eval(expression);
|
29
|
+
}).apply(this, arguments); }
|
30
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [[[FirefoxDriver: firefox on MAC (3d7c9b89-3e07-474b-9a59-9a90dd0d8fc4)] -> id: checkboxes], show]])
|
31
|
+
19:11:27.352 INFO - Done: [execute script: /* Protractor.evaluate() */
|
32
|
+
try { return (function (element, expression) {
|
33
|
+
return angular.element(element).scope().$eval(expression);
|
34
|
+
}).apply(this, arguments); }
|
35
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [[[FirefoxDriver: firefox on MAC (3d7c9b89-3e07-474b-9a59-9a90dd0d8fc4)] -> id: checkboxes], show]]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
browser.get('https://angularjs.org/')
|
2
|
+
browser.ignoreSynchronization = true
|
3
|
+
browser.getTitle()
|
4
|
+
|
5
|
+
13:14:47.882 INFO - Executing: [get title])
|
6
|
+
13:14:47.886 INFO - Executing: [execute script: , []])
|
7
|
+
13:14:47.887 INFO - Executing: [execute script: , []])
|
8
|
+
13:14:48.330 INFO - Done: [get title]
|
9
|
+
13:14:51.504 INFO - Done: [execute script: , []]
|
10
|
+
13:14:51.818 INFO - Done: [execute script: , []]
|
11
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
browser.get('https://angularjs.org/')
|
2
|
+
browser.getTitle()
|
3
|
+
|
4
|
+
13:13:21.050 INFO - Executing: [execute script: , []])
|
5
|
+
|
6
|
+
wait for angular -- client side script
|
7
|
+
|
8
|
+
13:13:21.050 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
|
9
|
+
var el = document.querySelector(rootSelector);
|
10
|
+
|
11
|
+
try {
|
12
|
+
if (!window.angular) {
|
13
|
+
throw new Error('angular could not be found on the window');
|
14
|
+
}
|
15
|
+
if (angular.getTestability) {
|
16
|
+
angular.getTestability(el).whenStable(callback);
|
17
|
+
} else {
|
18
|
+
if (!angular.element(el).injector()) {
|
19
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
20
|
+
' this may mean it is not inside ng-app.');
|
21
|
+
}
|
22
|
+
angular.element(el).injector().get('$browser').
|
23
|
+
notifyWhenNoOutstandingRequests(callback);
|
24
|
+
}
|
25
|
+
} catch (err) {
|
26
|
+
callback(err.message);
|
27
|
+
}
|
28
|
+
}).apply(this, arguments); }
|
29
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
|
30
|
+
13:13:21.064 INFO - Done: [execute script: , []]
|
31
|
+
13:13:21.134 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
|
32
|
+
var el = document.querySelector(rootSelector);
|
33
|
+
|
34
|
+
try {
|
35
|
+
if (!window.angular) {
|
36
|
+
throw new Error('angular could not be found on the window');
|
37
|
+
}
|
38
|
+
if (angular.getTestability) {
|
39
|
+
angular.getTestability(el).whenStable(callback);
|
40
|
+
} else {
|
41
|
+
if (!angular.element(el).injector()) {
|
42
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
43
|
+
' this may mean it is not inside ng-app.');
|
44
|
+
}
|
45
|
+
angular.element(el).injector().get('$browser').
|
46
|
+
notifyWhenNoOutstandingRequests(callback);
|
47
|
+
}
|
48
|
+
} catch (err) {
|
49
|
+
callback(err.message);
|
50
|
+
}
|
51
|
+
}).apply(this, arguments); }
|
52
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
|
53
|
+
13:13:21.144 INFO - Executing: [get title])
|
54
|
+
13:13:21.194 INFO - Done: [get title]
|
data/notes/phantomjs.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# phantomjs
|
2
|
+
|
3
|
+
phantomjs provides [ghostdriver](https://github.com/detro/ghostdriver) which is
|
4
|
+
suppose to be faster than regular browsers because it's headless. phantomjs is
|
5
|
+
buggy and unable to reliably execute selenium tests (as of v2.0). Tests will
|
6
|
+
fail and segfault exclusively on phantomjs and work properly on regular web
|
7
|
+
browsers.
|
8
|
+
|
9
|
+
#### Usage
|
10
|
+
|
11
|
+
- [Download phantomjs](http://phantomjs.org/download.html)
|
12
|
+
- `./phantomjs --webdriver=4444`
|
13
|
+
- Use remote webdriver `Watir::Browser.new :remote, desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox`
|
14
|
+
|
15
|
+
#### Known issues
|
16
|
+
|
17
|
+
- [Official mac build of v2 is broken on OS X 10.10](https://github.com/ariya/phantomjs/issues/12900)
|
18
|
+
- [work around by running](https://github.com/ariya/phantomjs/issues/12900#issuecomment-74073057)
|
19
|
+
`brew install upx; upx -d bin/phantomjs`
|
20
|
+
- [Official linux builds do not exist](https://github.com/ariya/phantomjs/issues/12948)
|
21
|
+
|
22
|
+
The upcoming [v2.1 release](https://github.com/ariya/phantomjs/issues/12970) may
|
23
|
+
resolve the build issues. This is also blocking [phantomas](https://github.com/macbre/phantomas/issues/488)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
CLI randomly flakes out. press enter a bunch of times.
|
2
|
+
|
3
|
+
|
4
|
+
(node) warning: possible EventEmitter memory leak detected. 11 break listeners added. Use emitter.setMaxListeners() to increase limit.
|
5
|
+
Trace
|
6
|
+
at Client.addListener (events.js:179:15)
|
7
|
+
at Client.Readable.on (_stream_readable.js:671:33)
|
8
|
+
at CommandRepl.evaluate_ (/usr/local/lib/node_modules/protractor/lib/debugger/modes/commandRepl.js:106:15)
|
9
|
+
at CommandRepl.stepEval (/usr/local/lib/node_modules/protractor/lib/debugger/modes/commandRepl.js:34:8)
|
10
|
+
at REPLServer.stepEval (/usr/local/lib/node_modules/protractor/lib/debugger/clients/explorer.js:95:13)
|
11
|
+
at bound (domain.js:254:14)
|
12
|
+
at REPLServer.runBound [as eval] (domain.js:267:12)
|
13
|
+
at REPLServer.<anonymous> (repl.js:279:12)
|
14
|
+
at REPLServer.emit (events.js:107:17)
|
15
|
+
at REPLServer.Interface._onLine (readline.js:214:10)
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
doesn't sync on goForward or goBackward ?
|
20
|
+
|
21
|
+
|
22
|
+
docs for getLocationAbsUrl are wrong. it returns
|
23
|
+
'/api' not 'http://angular.github.io/protractor/#/api' when on
|
24
|
+
'http://angular.github.io/protractor/#/api'
|
25
|
+
|
26
|
+
|
27
|
+
Protractor.get doesn't work with file:/// base url
|
28
|
+
[1] pry(#<RSpec::ExampleGroups::Protractor>)> protractor.base_url = file_tmp
|
29
|
+
=> "file:///a/"
|
30
|
+
[2] pry(#<RSpec::ExampleGroups::Protractor>)> protractor.get 'a'
|
31
|
+
Selenium::WebDriver::Error::JavascriptError: Access to 'file:///a/a' from script denied
|
32
|
+
|
33
|
+
|
34
|
+
base_url of 'http://localhost:8081/#/' doesn't work as expected because
|
35
|
+
|
36
|
+
url.resolve(''http://localhost:8081/#/', 'async') becomes 'http://localhost:8081/async' instead of
|
37
|
+
''http://localhost:8081/#/async' when using the angular test app.
|
38
|
+
|
39
|
+
'Evalute' typo in clientisdescripts.js
|
@@ -0,0 +1,102 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
var DEFAULT_RESET_URL = 'data:text/html,<html></html>';
|
4
|
+
if (browserName === 'internet explorer' || browserName === 'safari') {
|
5
|
+
self.resetUrl = 'about:blank';
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
this.executeScript_(
|
10
|
+
'window.location.replace("' + destination + '");',
|
11
|
+
msg('reset url'))
|
12
|
+
|
13
|
+
self.executeAsyncScript_(clientSideScripts.testForAngular,
|
14
|
+
|
15
|
+
|
16
|
+
Protractor.prototype.get = function(destination, opt_timeout) {
|
17
|
+
var timeout = opt_timeout ? opt_timeout : this.getPageTimeout;
|
18
|
+
var self = this;
|
19
|
+
|
20
|
+
destination = this.baseUrl.indexOf('file://') === 0 ?
|
21
|
+
this.baseUrl + destination : url.resolve(this.baseUrl, destination);
|
22
|
+
var msg = function(str) {
|
23
|
+
return 'Protractor.get(' + destination + ') - ' + str;
|
24
|
+
};
|
25
|
+
|
26
|
+
if (this.ignoreSynchronization) {
|
27
|
+
return this.driver.get(destination);
|
28
|
+
}
|
29
|
+
|
30
|
+
var deferred = webdriver.promise.defer();
|
31
|
+
|
32
|
+
this.driver.get(this.resetUrl).then(null, deferred.reject);
|
33
|
+
this.executeScript_(
|
34
|
+
'window.name = "' + DEFER_LABEL + '" + window.name;' +
|
35
|
+
'window.location.replace("' + destination + '");',
|
36
|
+
msg('reset url'))
|
37
|
+
.then(null, deferred.reject);
|
38
|
+
|
39
|
+
// We need to make sure the new url has loaded before
|
40
|
+
// we try to execute any asynchronous scripts.
|
41
|
+
this.driver.wait(function() {
|
42
|
+
return self.executeScript_('return window.location.href;', msg('get url')).
|
43
|
+
then(function(url) {
|
44
|
+
return url !== self.resetUrl;
|
45
|
+
}, function(err) {
|
46
|
+
if (err.code == 13) {
|
47
|
+
// Ignore the error, and continue trying. This is because IE
|
48
|
+
// driver sometimes (~1%) will throw an unknown error from this
|
49
|
+
// execution. See https://github.com/angular/protractor/issues/841
|
50
|
+
// This shouldn't mask errors because it will fail with the timeout
|
51
|
+
// anyway.
|
52
|
+
return false;
|
53
|
+
} else {
|
54
|
+
throw err;
|
55
|
+
}
|
56
|
+
});
|
57
|
+
}, timeout,
|
58
|
+
'waiting for page to load for ' + timeout + 'ms')
|
59
|
+
.then(null, deferred.reject);
|
60
|
+
|
61
|
+
// Make sure the page is an Angular page.
|
62
|
+
self.executeAsyncScript_(clientSideScripts.testForAngular,
|
63
|
+
msg('test for angular'),
|
64
|
+
Math.floor(timeout / 1000)).
|
65
|
+
then(function(angularTestResult) {
|
66
|
+
var hasAngular = angularTestResult[0];
|
67
|
+
if (!hasAngular) {
|
68
|
+
var message = angularTestResult[1];
|
69
|
+
throw new Error('Angular could not be found on the page ' +
|
70
|
+
destination + ' : ' + message);
|
71
|
+
}
|
72
|
+
}, function(err) {
|
73
|
+
throw 'Error while running testForAngular: ' + err.message;
|
74
|
+
})
|
75
|
+
.then(null, deferred.reject);
|
76
|
+
|
77
|
+
// At this point, Angular will pause for us until angular.resumeBootstrap
|
78
|
+
// is called.
|
79
|
+
var moduleNames = [];
|
80
|
+
for (var i = 0; i < this.mockModules_.length; ++i) {
|
81
|
+
var mockModule = this.mockModules_[i];
|
82
|
+
var name = mockModule.name;
|
83
|
+
moduleNames.push(name);
|
84
|
+
var executeScriptArgs = [mockModule.script, msg('add mock module ' + name)].
|
85
|
+
concat(mockModule.args);
|
86
|
+
this.executeScript_.apply(this, executeScriptArgs).
|
87
|
+
then(null, function(err) {
|
88
|
+
throw 'Error while running module script ' + name +
|
89
|
+
': ' + err.message;
|
90
|
+
})
|
91
|
+
.then(null, deferred.reject);
|
92
|
+
}
|
93
|
+
|
94
|
+
this.executeScript_(
|
95
|
+
'angular.resumeBootstrap(arguments[0]);',
|
96
|
+
msg('resume bootstrap'),
|
97
|
+
moduleNames)
|
98
|
+
.then(deferred.fulfill, deferred.reject);
|
99
|
+
|
100
|
+
return deferred;
|
101
|
+
};
|
102
|
+
=end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
browser.ignoreSynchronization = true
|
2
|
+
browser.get('https://angularjs.org/')
|
3
|
+
|
4
|
+
12:45:29.891 INFO - Executing: [execute script: , []])
|
5
|
+
12:45:29.891 INFO - Executing: [execute script: , []])
|
6
|
+
12:45:29.891 INFO - Executing: [execute script: , []])
|
7
|
+
12:45:29.912 INFO - Done: [execute script: , []]
|
8
|
+
12:45:29.964 INFO - Done: [execute script: , []]
|
9
|
+
12:45:30.017 INFO - Done: [execute script: , []]
|
10
|
+
12:45:30.028 INFO - Executing: [get: https://angularjs.org/])
|
11
|
+
12:45:33.080 INFO - Done: [get: https://angularjs.org/]
|
@@ -0,0 +1,86 @@
|
|
1
|
+
|
2
|
+
12:41:51.320 INFO - Executing: [execute script: , []])
|
3
|
+
12:41:51.320 INFO - Executing: [get: data:text/html,<html></html>])
|
4
|
+
12:41:51.320 INFO - Executing: [execute script: , []])
|
5
|
+
12:41:51.334 INFO - Done: [execute script: , []]
|
6
|
+
12:41:51.424 INFO - Done: [get: data:text/html,<html></html>]
|
7
|
+
12:41:51.437 INFO - Executing: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("https://angularjs.org/");, []])
|
8
|
+
12:41:51.482 INFO - Done: [execute script: , []]
|
9
|
+
12:41:51.536 INFO - Done: [execute script: window.name = "NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("https://angularjs.org/");, []]
|
10
|
+
12:41:51.550 INFO - Executing: [execute script: return window.location.href;, []])
|
11
|
+
12:41:52.813 INFO - Done: [execute script: return window.location.href;, []]
|
12
|
+
|
13
|
+
testForAngular -- looks for resumeBootstrap, part of module mocking in
|
14
|
+
protractor get.
|
15
|
+
|
16
|
+
12:41:52.828 INFO - Executing: [execute async script: try { return (function (attempts, asyncCallback) {
|
17
|
+
var callback = function(args) {
|
18
|
+
setTimeout(function() {
|
19
|
+
asyncCallback(args);
|
20
|
+
}, 0);
|
21
|
+
};
|
22
|
+
var check = function(n) {
|
23
|
+
try {
|
24
|
+
if (window.angular && window.angular.resumeBootstrap) {
|
25
|
+
callback([true, null]);
|
26
|
+
} else if (n < 1) {
|
27
|
+
if (window.angular) {
|
28
|
+
callback([false, 'angular never provided resumeBootstrap']);
|
29
|
+
} else {
|
30
|
+
callback([false, 'retries looking for angular exceeded']);
|
31
|
+
}
|
32
|
+
} else {
|
33
|
+
window.setTimeout(function() {check(n - 1);}, 1000);
|
34
|
+
}
|
35
|
+
} catch (e) {
|
36
|
+
callback([false, e]);
|
37
|
+
}
|
38
|
+
};
|
39
|
+
check(attempts);
|
40
|
+
}).apply(this, arguments); }
|
41
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [10]])
|
42
|
+
12:41:52.910 INFO - Done: [execute async script: try { return (function (attempts, asyncCallback) {
|
43
|
+
var callback = function(args) {
|
44
|
+
setTimeout(function() {
|
45
|
+
asyncCallback(args);
|
46
|
+
}, 0);
|
47
|
+
};
|
48
|
+
var check = function(n) {
|
49
|
+
try {
|
50
|
+
if (window.angular && window.angular.resumeBootstrap) {
|
51
|
+
callback([true, null]);
|
52
|
+
} else if (n < 1) {
|
53
|
+
if (window.angular) {
|
54
|
+
callback([false, 'angular never provided resumeBootstrap']);
|
55
|
+
} else {
|
56
|
+
callback([false, 'retries looking for angular exceeded']);
|
57
|
+
}
|
58
|
+
} else {
|
59
|
+
window.setTimeout(function() {check(n - 1);}, 1000);
|
60
|
+
}
|
61
|
+
} catch (e) {
|
62
|
+
callback([false, e]);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
check(attempts);
|
66
|
+
}).apply(this, arguments); }
|
67
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [10]]
|
68
|
+
12:41:52.925 INFO - Executing: [execute script: return (function () {
|
69
|
+
angular.module('protractorBaseModule_', []).
|
70
|
+
config(['$compileProvider', function($compileProvider) {
|
71
|
+
if ($compileProvider.debugInfoEnabled) {
|
72
|
+
$compileProvider.debugInfoEnabled(true);
|
73
|
+
}
|
74
|
+
}]);
|
75
|
+
}).apply(null, arguments);, []])
|
76
|
+
12:41:52.980 INFO - Done: [execute script: return (function () {
|
77
|
+
angular.module('protractorBaseModule_', []).
|
78
|
+
config(['$compileProvider', function($compileProvider) {
|
79
|
+
if ($compileProvider.debugInfoEnabled) {
|
80
|
+
$compileProvider.debugInfoEnabled(true);
|
81
|
+
}
|
82
|
+
}]);
|
83
|
+
}).apply(null, arguments);, []]
|
84
|
+
12:41:52.991 INFO - Executing: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]])
|
85
|
+
12:41:54.096 INFO - Done: [execute script: angular.resumeBootstrap(arguments[0]);, [[protractorBaseModule_]]]
|
86
|
+
|
@@ -0,0 +1,150 @@
|
|
1
|
+
browser.get('http://localhost:8081/#/repeater')
|
2
|
+
var partialMatch = element(by.repeater('baz in days'));
|
3
|
+
partialMatch.getText()
|
4
|
+
|
5
|
+
|
6
|
+
16:09:01.247 INFO - Executing: [execute script: , []])
|
7
|
+
16:09:01.247 INFO - Executing: [execute script: , []])
|
8
|
+
16:09:01.248 INFO - Executing: [execute script: , []])
|
9
|
+
// wait for angular
|
10
|
+
16:09:01.247 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
|
11
|
+
var el = document.querySelector(rootSelector);
|
12
|
+
|
13
|
+
try {
|
14
|
+
if (!window.angular) {
|
15
|
+
throw new Error('angular could not be found on the window');
|
16
|
+
}
|
17
|
+
if (angular.getTestability) {
|
18
|
+
angular.getTestability(el).whenStable(callback);
|
19
|
+
} else {
|
20
|
+
if (!angular.element(el).injector()) {
|
21
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
22
|
+
' this may mean it is not inside ng-app.');
|
23
|
+
}
|
24
|
+
angular.element(el).injector().get('$browser').
|
25
|
+
notifyWhenNoOutstandingRequests(callback);
|
26
|
+
}
|
27
|
+
} catch (err) {
|
28
|
+
callback(err.message);
|
29
|
+
}
|
30
|
+
}).apply(this, arguments); }
|
31
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
|
32
|
+
16:09:01.274 INFO - Done: [execute script: , []]
|
33
|
+
16:09:01.338 INFO - Done: [execute script: , []]
|
34
|
+
16:09:01.392 INFO - Done: [execute script: , []]
|
35
|
+
16:09:01.450 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
|
36
|
+
var el = document.querySelector(rootSelector);
|
37
|
+
|
38
|
+
try {
|
39
|
+
if (!window.angular) {
|
40
|
+
throw new Error('angular could not be found on the window');
|
41
|
+
}
|
42
|
+
if (angular.getTestability) {
|
43
|
+
angular.getTestability(el).whenStable(callback);
|
44
|
+
} else {
|
45
|
+
if (!angular.element(el).injector()) {
|
46
|
+
throw new Error('root element (' + rootSelector + ') has no injector.' +
|
47
|
+
' this may mean it is not inside ng-app.');
|
48
|
+
}
|
49
|
+
angular.element(el).injector().get('$browser').
|
50
|
+
notifyWhenNoOutstandingRequests(callback);
|
51
|
+
}
|
52
|
+
} catch (err) {
|
53
|
+
callback(err.message);
|
54
|
+
}
|
55
|
+
}).apply(this, arguments); }
|
56
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
|
57
|
+
|
58
|
+
// -- function (repeater, exact, using)
|
59
|
+
// [baz in days, false, null, body]
|
60
|
+
// findAllRepeaterRows -- client side script
|
61
|
+
16:09:01.467 INFO - Executing: [execute script: try { return (function (repeater, exact, using) {
|
62
|
+
function repeaterMatch(ngRepeat, repeater, exact) {
|
63
|
+
if (exact) {
|
64
|
+
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
|
65
|
+
trim() == repeater;
|
66
|
+
} else {
|
67
|
+
return ngRepeat.indexOf(repeater) != -1;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
using = using || document;
|
72
|
+
|
73
|
+
var rows = [];
|
74
|
+
var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:'];
|
75
|
+
for (var p = 0; p < prefixes.length; ++p) {
|
76
|
+
var attr = prefixes[p] + 'repeat';
|
77
|
+
var repeatElems = using.querySelectorAll('[' + attr + ']');
|
78
|
+
attr = attr.replace(/\\/g, '');
|
79
|
+
for (var i = 0; i < repeatElems.length; ++i) {
|
80
|
+
if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
|
81
|
+
rows.push(repeatElems[i]);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
for (var p = 0; p < prefixes.length; ++p) {
|
86
|
+
var attr = prefixes[p] + 'repeat-start';
|
87
|
+
var repeatElems = using.querySelectorAll('[' + attr + ']');
|
88
|
+
attr = attr.replace(/\\/g, '');
|
89
|
+
for (var i = 0; i < repeatElems.length; ++i) {
|
90
|
+
if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
|
91
|
+
var elem = repeatElems[i];
|
92
|
+
while (elem.nodeType != 8 ||
|
93
|
+
!repeaterMatch(elem.nodeValue, repeater, exact)) {
|
94
|
+
if (elem.nodeType == 1) {
|
95
|
+
rows.push(elem);
|
96
|
+
}
|
97
|
+
elem = elem.nextSibling;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
return rows;
|
103
|
+
}).apply(this, arguments); }
|
104
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [baz in days, false, null, body]])
|
105
|
+
16:09:01.554 INFO - Done: [execute script: try { return (function (repeater, exact, using) {
|
106
|
+
function repeaterMatch(ngRepeat, repeater, exact) {
|
107
|
+
if (exact) {
|
108
|
+
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
|
109
|
+
trim() == repeater;
|
110
|
+
} else {
|
111
|
+
return ngRepeat.indexOf(repeater) != -1;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
using = using || document;
|
116
|
+
|
117
|
+
var rows = [];
|
118
|
+
var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:'];
|
119
|
+
for (var p = 0; p < prefixes.length; ++p) {
|
120
|
+
var attr = prefixes[p] + 'repeat';
|
121
|
+
var repeatElems = using.querySelectorAll('[' + attr + ']');
|
122
|
+
attr = attr.replace(/\\/g, '');
|
123
|
+
for (var i = 0; i < repeatElems.length; ++i) {
|
124
|
+
if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
|
125
|
+
rows.push(repeatElems[i]);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
for (var p = 0; p < prefixes.length; ++p) {
|
130
|
+
var attr = prefixes[p] + 'repeat-start';
|
131
|
+
var repeatElems = using.querySelectorAll('[' + attr + ']');
|
132
|
+
attr = attr.replace(/\\/g, '');
|
133
|
+
for (var i = 0; i < repeatElems.length; ++i) {
|
134
|
+
if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
|
135
|
+
var elem = repeatElems[i];
|
136
|
+
while (elem.nodeType != 8 ||
|
137
|
+
!repeaterMatch(elem.nodeValue, repeater, exact)) {
|
138
|
+
if (elem.nodeType == 1) {
|
139
|
+
rows.push(elem);
|
140
|
+
}
|
141
|
+
elem = elem.nextSibling;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
return rows;
|
147
|
+
}).apply(this, arguments); }
|
148
|
+
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [baz in days, false, null, body]]
|
149
|
+
16:09:01.570 INFO - Executing: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@a7eb949e -> unknown locator]])
|
150
|
+
16:09:01.623 INFO - Done: [get text: 0 [org.openqa.selenium.remote.RemoteWebElement@a7eb949e -> unknown locator]]
|