我是新的量角器框架,即使预期的条件没有得到满足,测试也没有失败
这是我执行测试时的输出:
这是最后一步的代码
this.Then(/^"View All Interactions" link button should stay at the top of list$/, () => {
waitForPresence(mobileQADashboard.pageElements.viewAllInteractionsLink);
waitForPresence(mobileQADashboard.getVisibleDataContainer());
mobileQADashboard.getVisibleDataContainer().getLocation().then(function (ContainerLocation) {
return expect(mobileQADashboard.pageElements.viewAllInteractionsLink.getLocation(),"View Interactions Link is not above").to.eventually.have.property('y').that.is.below(
ContainerLocation.y
);
})
});
答案 0 :(得分:0)
您可以尝试使用回调:
this.Then(/^"View All Interactions" link button should stay at the top of list$/, (callback) => {
waitForPresence(mobileQADashboard.pageElements.viewAllInteractionsLink);
waitForPresence(mobileQADashboard.getVisibleDataContainer());
mobileQADashboard.getVisibleDataContainer().getLocation().then(function (ContainerLocation) {
expect(mobileQADashboard.pageElements.viewAllInteractionsLink.getLocation(),"View Interactions Link is not above").to.eventually.have.property('y').that.is.below(
ContainerLocation.y
).and.notify(callback);
})
});