In the future the Control Flow will be disabled. With protractor you can now already disable it by adding this flag in your config SELENIUM_PROMISE_MANAGER = false, see also here.
When you now disable it you will get this error:
TypeError: deferred.fulfill is not a function
at /Users/wswebcreation/example/dist/ng-apimock/protractor.mock.js:166:26
This can easily be fixed with this in the protractor.mock.js-file.
/**
* Executes the api call with the provided information.
* @param httpMethod The http method.
* @param urlSuffix The url suffix.
* @param options The options object.
* @param errorMessage The error message.
* @return {Promise} The promise.
* @private
*/
function _execute(httpMethod, urlSuffix, options, errorMessage) {
const opts = {
headers: {
'Content-Type': 'application/json',
'ngapimockid': ngapimockid
}
};
if (options !== undefined) {
opts.json = options;
}
return new Promise((resolve, reject) => {
request(httpMethod, baseUrl + urlSuffix, opts).done((res) => res.statusCode === 200 ? resolve() : reject(errorMessage));
});
}
We need to create a PR and check alle the usages of protractor.promise.defer and replace it with native promises.
In the future the Control Flow will be disabled. With protractor you can now already disable it by adding this flag in your config
SELENIUM_PROMISE_MANAGER = false
, see also here.When you now disable it you will get this error:
This can easily be fixed with this in the
protractor.mock.js
-file.We need to create a PR and check alle the usages of
protractor.promise.defer
and replace it with native promises.