it
ブロックで連鎖を使用して複数の条件を使用できます。
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();
});;
});
私は報告するためにを使用します。
出典
2017-11-25 23:23:41
AKJ
なぜ 'it'ブロック内に複数のステップを使用しているのですか?1ステップ/ 1基本テストケースがあるのはなぜですか? –
複数のステップをカバーする必要がある場合は、サイドページオブジェクトに単一の関数としてバンドルし、specファイルから 'it'ブロック内の単一ステップとしてコールします。 –