2017-07-13 6 views
3

これはよくある問題であり、それに関する話題はたくさんありますが、今は解決できませんでした。 完全にAngular2のアプリケーションをテストするために分度器5.1.2(Cucumber-js付き)を使用します。分度器angular2非同期の角型タスクが完了するのを待ってタイムアウトしました

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") 

私の失敗ステップ:

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

をそして、これは動作します。しかし、角度を待っているとすると、失敗し

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(); 
}); 

そして、私の設定ファイル:私は読んだことがある

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, 
... 

ngZoneについてのものですが、私は開発者ではありません私はそれを再び働かせる方法を知らない。私の設定に何か間違っていますか?

+0

あなたの設定で 'allScriptsTimeout'と' getPageTimeout'オプションを増やしてみて、それが問題を修正するかどうかを確認します。 –

+0

が両方とも60000に増加し、同じ結果になりました。ブラウザは期待されたページで開き、リンクをクリックすべき場所を何もしません。 – nitche

答えて

-1

ブラウザを起動した直後に角度待機を定義してみてください。

例:loginPage.getPage();//launch the browser url. browser.waitForAngularEnabled(true);

+0

同じ結果、同じ出力。 – nitche

関連する問題