Everything seems to be running smoothly with the code below, except for the assertion part. Whenever I run the test using Jasmine, it reports 0 assertions. Is there a way to include my assertions within promises so they are recognized?
it("should open save NTP server modal", function (done) {
var addModal = driver.findElement(By.className('modal-dialog'));
driver.wait(until.stalenessOf(addModal), 5000).then(function () {
return driver.wait(until.elementIsEnabled(driver.findElement(By.id('saveButton'))), 5000).then(function (element){
return element.click();
});
});
driver.findElement(By.className("modal-body")).then(function (element) {
return expect(element.isDisplayed()).toBeTruthy();
});
done();
});
In this specific case (my best example test), I could simply catch the element and then perform the expect outside of a promise:
var element = driver.findElement(By.className("modal-body"));
expect(element.isDisplayed()).toBeTruthy();
However, in other cases, I'm struggling to find a way to handle the assertion outside of a promise.