0
각도기를 사용하여 오이 테스트 단계를 만들고 싶었지만 '2019'가 쓸 수 없다는 예상 단계가있었습니다. . 여기 내 소스 코드는 다음 기대 (yearString) .to.eventually.contain에서TypeError '2019'는 변경할 수 없습니다.
this.Then(/^I check that the calculated year from the current month\(if current month >= 6 ==> current year = current year \+ 2,else current year = current year \+ 1\)$/,function(callback) {
var actualDate=new Date();
var actualYear=actualDate.getFullYear();
var actualMonth=actualDate.getMonth()+1;
//expect(targetAmountPO.getYesInflationLabel().isDisplayed()).eventually.to.equal(true).then(callback);
targetAmountPO.getYesInflationLabel().isDisplayed().then(function() {
targetAmountPO.getYesInflationCorrectionAnswer().isSelected().then(function(){
targetAmountPO.getYesInflationLabel().getAttribute("outerText").then(function(text,callback){
//console.log(text);
var splittedString=text.split(":");
//console.log(splittedString[1]);
if(actualMonth>=6)
{
actualYear+=2;
var yearString=actualYear.toString();
console.log(yearString);
expect(yearString).to.eventually.contain(splittedString[1]).and.notify(callback);
//console.log(actualYear);
}
else
{
expect(actualYear+1).to.include(splittedString[1]).and.notify(callback);
}
})
})
})
})
(splittedString [1]) (콜백) and.notify;
나는 '2019'를 얻을 수 없습니다. yearString은 2019가 좋습니다. 하지만 왜 그럴 수없는거야?
도와 주시겠습니까?
감사합니다. 로스. 약속을 이해해야합니다, beacuse 저는 JAVA 개발자이지만 AngularJS E2E 테스트를 받았습니다. – user3654435