protracor의 초보자는 조금 있지만 기본적으로 확인하려면 (다른 함수의) 체크를 수행 한 다음 작업을 수행 한 다음 (이전과 같은 함수에서) 동일한 검사를 수행하십시오.두 함수의 결과를 비교하십시오
나는 아래 시도했지만 unforunately 어떤 도움이 대규모 감사하겠습니다 Failed: first is not defined
checkCanvasWidth: {
value: function() {
return element(by.css("div[class='canvasWrapper'] > canvas")).getAttribute("width").then(function(width) {
return width;
});
}
},
zoomIn: {
value: function() {
this.checkCanvasWidth().then(function (width) {
var first = width;
console.log("before:" + width);
});
//performs a click
this.clickZoomIn();
this.checkCanvasWidth().then(function (width) {
var second = width;
console.log("after:" + width);
});
expect(first).toBeGreaterThan(second);
}
}
얻을 수있다!
감사합니다. Shilly, 나는 약속의 버전이 필요했습니다! 이것은 내가 고군분투하고 있었지만 깨닫지 못했던 것이다. –