Skip to content

Commit cc6b7a4

Browse files
michaelbullniieani
authored andcommitted
fix(index): Replace executeAyncScript with executeScript (#4)
Fixes the issue described in: aurelia/skeleton-navigation#714 (comment) Previously when the app was larger it would wait to emit the events before protractor was loaded, however due to the speed increase introduced by the experimental webpack configuration, aurelia was initialising and emitting the event before protractor had a chance to listen to it, hence it would hang indefinitely. Telling the browser to execute the script synchronously will delay aurelia long enough for protractor to register its listeners before aurelia emits the event itself.
1 parent 9a1c9bf commit cc6b7a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function addValueBindLocator() {
2121

2222
function loadAndWaitForAureliaPage(pageUrl) {
2323
browser.get(pageUrl);
24-
return browser.executeAsyncScript(
24+
return browser.executeScript(
2525
'var cb = arguments[arguments.length - 1];' +
2626
'if (window.webpackJsonp && document.querySelector("[aurelia-app]")) { cb("Aurelia composed") }' +
2727
'document.addEventListener("aurelia-composed", function (e) {' +
@@ -33,7 +33,7 @@ function loadAndWaitForAureliaPage(pageUrl) {
3333
}
3434

3535
function waitForRouterComplete() {
36-
return browser.executeAsyncScript(
36+
return browser.executeScript(
3737
'var cb = arguments[arguments.length - 1];' +
3838
'document.querySelector("[aurelia-app]")' +
3939
'.aurelia.subscribeOnce("router:navigation:complete", function() {' +

0 commit comments

Comments
 (0)