0
私はエンドツーエンドのテストの分度器に取り組んでおり、ボタンをクリックする前にステータスインジケータが消えるのを確認する必要があります。今私はそれをすることができません。 invisibilityOf()
とstalenessOf()
を使用しようとしましたが、動作しません。分度器のステータスインジケータを確認できません
ここでのPageObjectの私のコードです:
public isNotPresent(elem) {
return browser.wait(protractor.ExpectedConditions.stalenessOf(elem), 5000).then(function() {
console.log("Status indicator is not present in DOM");
return true; //success
},function() {
console.log("Status indicator is present in DOM");
return false; //Failure
});
}
public waitForStatusIndicator(){
console.log('in method wait for status indicator');
return this.isNotPresent(element(by.css('#api-status-indicator'))).then((isNotPresent)=>{
return isNotPresent;
});
}
がここにあります:それは<#APIのステータス・インジケータ>、その他の要素は、クリックを受け取ることになるポイント(540823)でクリックできません」というエラーが表示さ私が間違っているつもりです
PageObject.waitForStatusIndicator().then(function (isNotPresent) {
if(isNotPresent == true) {
someButton.click();
return expect(browser.getCurrentUrl()).not.toBe(browser.baseUrl + "/login");
}
})
:どこでステータスインジケータをチェックしようとしていますか?
ノードを完全に削除すると、それはもう見つからないのが普通です。 'stalenessOf'を使う前に、それがすべて最初に存在するかどうかを確認してください。 –