Protractor plugin to ignore specific async calls in angular application
npm install protractor-sync-options-pluginnpm i protractor-sync-options-plugin -D * for now, you should add
```
import 'zone.js/dist/task-tracking.js';
polyfills.ts
to your file right after import 'zone.js/dist/zone'; line.
(see github issues, help me to fix it)
* in your protractor.js file add plugins definition:`
`
exports.config = {
plugins: [
{
package: 'protractor-sync-options-plugin',
ignoreTasks: [
}
],
...
the filters are of type IgnoreTask
``
exports.config = {
plugins: [
{
package: 'protractor-sync-options-plugin',
ignoreTasks: [{creationLocation: 'lodash'}, {source: 'setInterval', creationLocation: 'MyComponent.checkEveryTime'}, {source: 'XMLHttpRequest.send'}],
}
],
* {creationLocation: 'lodash'} filters every promise, observable, setTimeout, setInterval etc from some code from lodash library {source: 'setInterval', creationLocation: 'MyComponent.checkEveryTime'}
* filters only setTinterval calls from MyComponent's checkEveryTime method {source: 'XMLHttpRequest.send'}
* filters all XHR requests
see also protractor.js file
array are joined over "OR" (disjunction)
The filter properties of one single element (creationLocation and source) are joined over "AND" (conjunction)
####
source option (task types):
* setTimeout
* setInterval
* setImmediate
* XMLHttpRequest.send
* requestAnimationFrame
* webkitRequestAnimationFrame
* mozRequestAnimationFramegot from angular/packages/zone.js/lib/zone-spec/fake-async-test.ts
promises and observables uses
setTimeout/setInterval in most cases.####
creationLocation` option