尝试点击div时,我会继续- Failed: element not visible
Uitlis: openClosedSignElement(){
$('[ng-click="changeViewToggle(category, taskSetProperty);isOpen = !isOpen"]').click();
}
e2e: it('Should add another task to template successfully', () => {
taskUtils.openClosedSignElement();
}
tried also this inside Utilis: openClosedSignElement(){
browser.element(by.id('addTaskTemplate')).click();
}
Html
<div ng-show="header" id="closeSign"
class="closeSign" ng-init="isOpen = isOpen ? isOpen : false"
ng-click="changeViewToggle(category, taskSetProperty);isOpen = !isOpen">
</div>
答案 0 :(得分:0)
您可以通过检查isDisplayed
是否显示元素来实现所需的输出,否则请点击例如head
元素然后继续您的断言
$('[ng-show=saving].icon-spin').isDisplayed().then(function(result) { //check whether element is displaye
if (result) { //if yes go ahead
$('[ng-click="changeViewToggle(category, taskSetProperty);isOpen = !isOpen"]').click();
} else { //else by clickin relvent element make it display
$("#header").click().then(function() {
$('[ng-click="changeViewToggle(category, taskSetProperty);isOpen = !isOpen"]').click();
}
})
})