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

Commit

Permalink
fix(plugins): do not force ManagedPromise in plugins.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sjelin committed Jan 31, 2017
1 parent cd084a0 commit 8d8f267
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as webdriver from 'selenium-webdriver';
import {Config} from './config';
import {ConfigParser} from './configParser';
import {Logger} from './logger';
import {protractor} from './ptor';

let logger = new Logger('plugins');

Expand Down Expand Up @@ -456,8 +457,13 @@ export class Plugins {
logError(e);
}
};
return promiseType == PromiseType.Q ? q.Promise(resolver) :
new webdriver.promise.Promise(resolver);
if (promiseType == PromiseType.Q) {
return q.Promise(resolver);
} else if (protractor.browsercontrolFlowIsEnabled()) {
return new webdriver.promise.Promise(resolver);
} else {
return new Promise(resolver);
}
}

/**
Expand Down

0 comments on commit 8d8f267

Please sign in to comment.