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'를 사용하기 전에 이것이 처음 존재하는지 확인하십시오. –