const deleteGlobalButton = element.all(by.buttonText("Delete"));
element(by.id("sequences-list-checkbox")).click();
deleteGlobalButton.isEnabled().then(function(isEnabled) {
console.log("var" + " " + isEnabled);
if (isEnabled) {
deleteGlobalButton.click();
browser.sleep(2000);
element(by.buttonText("YES")).click();
console.log("Start test - all sequences deletes");
expect(element(by.className("list-table-footer")).getText()).toBe(
"Total items: 0"
);
} else {
console.log("Start test - Anything to delete");
}
});
为什么总是执行if?
是true还是false? 始终执行deleteGlobalButton单击。
这个问题我待了将近2个小时...我无法解决。