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

Commit 27a5706

Browse files
committed
fix(loading): fix timeouts with about:blank removal
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.
1 parent 546d41f commit 27a5706

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/protractor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ Protractor.prototype.get = function(destination, opt_timeout) {
891891
return this.driver.get(destination);
892892
}
893893

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

0 commit comments

Comments
 (0)