그것은 오랜만이야,하지만 난 다음 도우미 메서드와 각도기로 이온을 테스트하는 일부 성공을 거두었습니다 :
이
waitForIonic: function() {
//Register a promise with protractor, so the browser waits for it
var deferred = protractor.promise.defer();
let clickBlock = element(by.css('.click-block-active'));
//if there's a click block, wait for it to be gone, otherwise just wait 1 sec
if (clickBlock.isPresent()) {
var untilClickBlockIsGone = ExpectedConditions.not(ExpectedConditions.visibilityOf(clickBlock));
browser.wait(untilClickBlockIsGone, 20000).then(() => {
browser.driver.sleep(1000);
//We've fulfilled the promise, so
deferred.fulfill();
});
}
else {
browser.driver.sleep(1000);
//We've fulfilled the promise, so
deferred.fulfill();
}
//Return the promise (which hasn't been fulfilled yet)
return deferred.promise;
}
다음과 같이 사용 :
//Wait for ionic animiations, Click logout
module.exports.waitForIonic().then(() => {
logoutButton.click();
});
을 그것은 안드로이드 모바일 응용 프로그램입니다 ionic 2에서 개발되었으며 브라우저와 함께 처리되지 않습니다. 브라우저가 작동하지 않기 때문입니다. –
browser.driver.sleep (1000); 스레드를 기다릴 수 있습니다. 당신의 도움을 주셔서 감사합니다. 새해 복 많이 받으세요 2018 –