protractor angular2 Timed out waiting for asynchronous Angular tasks to finish

Viewed 741

I know this is a common issue and there are lot of topics about it, but I did not manage to solve it for now. I use protractor 5.1.2 (with Cucumber-js) to test a fully Angular2 application. But waiting for angular fails:

E/launcher - Timed out waiting for asynchronous Angular tasks to finish after 27 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular
While waiting for element with locator - Locator: by.cssContainingText("preview-contract", "Box Internet")

my failing step:

this.When(/^I choose "([^"]*)" flow$/, function (flow, callback) {
    element(by.cssContainingText("preview-contract",flow)).element(by.linkText("Voir les offres")).click();
    callback();
});

And this works:

this.When(/^I choose "([^"]*)" flow$/, function (flow, callback) {
    browser.ignoreSynchronization = true;
    browser.sleep(10000);
    element(by.cssContainingText("preview-contract", flow)).element(by.linkText("Voir les offres")).click();
    callback();
});

And my config file:

exports.config = {
baseUrl: 'http://localhost:4200/',
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
capabilities: {
    browserName: 'chrome'
},

allScriptsTimeout: 27000,
getPageTimeout : 29000,

framework: 'custom',

frameworkPath: require.resolve('protractor-cucumber-framework'),

useAllAngular2AppRoots: true,
...

I have read stuff about ngZone, but I am not a developer, so I don't know how to make it work again. Anything wrong with my config?

1 Answers
Related