Reputation: 1
Am using Protractor Jasmine Framework along with jasmine allure reporter.Please give clarifications for following:
describe
it
blocks only?it
block. How can we add test step without
using it
blocks? Like each and every step needs to be reported.expect
statement in html file reporter?Upvotes: 0
Views: 476
Reputation: 328
You can use chaining to have multiple condition in an it
block.
it("checks URLs redirect to data browser after deletion.", function () {
var EC = protractor.ExpectedConditions,
modalTitle = modalInstance.recordPage.getConfirmDeleteTitle(),
config, redirectUrl;
browser.executeScript('return configObject;').then(function(configObject) {
config = configObject;
return modalInstance.recEditPage.getDeleteRecordButton().click()
}).then(function () {
browser.wait(EC.visibilityOf(modalTitle), browser.params.defaultTimeout);
// expect modal to open
return modalTitle.getText();
}).then(function (text) {
expect(text).toBe("Confirm Delete!!");
return modalInstance.recPage.getConfirmDeleteButton().click();
}).then(function () {
redirectUrl = "https://test/xyz";
browser.wait(function () {
return browser.driver.getCurrentUrl().then(function(url) {
return url.startsWith(redirectUrl);
})
});
return browser.driver.getCurrentUrl();
}).then(function (url) {
expect(url.startsWith(redirectUrl)).toBe(true);
}).catch(function(error) {
console.dir(error);
expect(error).not.toBeDefined();
});;
});
I use jasmin-spec-reporter for reporting.
Upvotes: -1