Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit bac36d2

Browse files
David Simonjuliemr
David Simon
authored andcommitted
feat(api): optional timeout on Protractor.get
1 parent d383770 commit bac36d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/protractor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,20 @@ Protractor.prototype.clearMockModules = function() {
471471
*
472472
* Navigate to the given destination and loads mock modules before
473473
* Angular.
474+
*
475+
* Optional 2nd argument: Number of seconds to wait for Angular to start.
474476
*/
475-
Protractor.prototype.get = function(destination) {
477+
Protractor.prototype.get = function(destination, timeout) {
476478
destination = url.resolve(this.baseUrl, destination);
479+
timeout = timeout || 10;
477480

478481
this.driver.get('about:blank');
479482
this.driver.executeScript(
480483
'window.name = "' + DEFER_LABEL + '" + window.name;' +
481484
'window.location.href = "' + destination + '"');
482485

483486
// Make sure the page is an Angular page.
484-
this.driver.executeAsyncScript(clientSideScripts.testForAngular, 10).
487+
this.driver.executeAsyncScript(clientSideScripts.testForAngular, timeout).
485488
then(function(arr) {
486489
var hasAngular = arr[0];
487490
if (!hasAngular) {

0 commit comments

Comments
 (0)