From 136f620da7ee34e77063fdbaaed04264be6e49a3 Mon Sep 17 00:00:00 2001 From: Martin Slota Date: Tue, 1 Aug 2017 23:42:55 +0200 Subject: [PATCH] Potential fix for issue 4151: Forked driver instance ignores waitForAngularEnabled --- lib/browser.ts | 6 +++--- lib/runner.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/browser.ts b/lib/browser.ts index 85d620451..ef9b401bb 100644 --- a/lib/browser.ts +++ b/lib/browser.ts @@ -417,8 +417,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { * Call waitForAngularEnabled() without passing a value to read the current * state without changing it. */ - waitForAngularEnabled(enabled: boolean|wdpromise.Promise = null): - wdpromise.Promise { + waitForAngularEnabled(enabled: boolean|wdpromise.Promise = null): boolean + |wdpromise.Promise { if (enabled != null) { const ret = this.driver.controlFlow().execute(() => { return wdpromise.when(enabled).then((enabled: boolean) => { @@ -433,7 +433,7 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { this.internalIgnoreSynchronization = !enabled; return ret; } - return wdpromise.when(!this.ignoreSynchronization); + return !this.ignoreSynchronization; } /** diff --git a/lib/runner.ts b/lib/runner.ts index 359e7428c..59dc6b7b2 100644 --- a/lib/runner.ts +++ b/lib/runner.ts @@ -290,7 +290,7 @@ export class Runner extends EventEmitter { browser_.forkNewDriverInstance = (useSameUrl: boolean, copyMockModules: boolean, copyConfigUpdates = true) => { - let newBrowser = this.createBrowser(plugins); + let newBrowser = this.createBrowser(plugins, browser_); if (copyMockModules) { newBrowser.mockModules_ = browser_.mockModules_; }