code: function loadAndWaitForAureliaPage(pageUrl) {
    function onAureliaComposed(onReady) {
      var aa = document.querySelector("[aurelia-app]");
      if (!!aa && aa.aurelia) {
        // aurelia is already loaded and available:
        onReady();
      } else {
        // we need to wait until it composes:
        document.addEventListener("aurelia-composed", function (e) {
          onReady();
        }, false);
      }
    }
  
    return browser.get(pageUrl).then(
      () => browser.executeAsyncScript(onAureliaComposed)
    );
  }
docs: Browser Helpers