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

Commit

Permalink
fix(loading): fix timeouts with about:blank removal
Browse files Browse the repository at this point in the history
As documented at teamcapybara/capybara#1215
there are sometimes issues with webdriver and about:blank pages.

Switching instead to try a data url.

This has been tried 5x on Travis without any flakes.
  • Loading branch information
juliemr committed May 20, 2014
1 parent 546d41f commit 27a5706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ Protractor.prototype.get = function(destination, opt_timeout) {
return this.driver.get(destination);
}

this.driver.get('about:blank');
this.driver.get('data:text/html,<html></html>');
this.driver.executeScript(
'window.name = "' + DEFER_LABEL + '" + window.name;' +
'window.location.replace("' + destination + '");');
Expand All @@ -900,7 +900,7 @@ Protractor.prototype.get = function(destination, opt_timeout) {
// we try to execute any asynchronous scripts.
this.driver.wait(function() {
return self.driver.executeScript('return window.location.href;').then(function(url) {
return url !== 'about:blank';
return url !== 'data:text/html,<html></html>';
});
}, timeout * 1000, 'Timed out waiting for page to load');

Expand Down

0 comments on commit 27a5706

Please sign in to comment.