我正在使用protractor-jasmine框架和typescript -
所以我在describe中有多个it块,所以在每个it块中有许多我正在验证的方法或预期条件-
因此,当前当一个expect失败时,整个it块都会终止,所以我希望即使在一个步骤失败后也能继续执行。
下面是Spec.ts
it('Should display Introduction screen with title correctly', () => {
page.navigateTo('/');
console.log('Verifying Title is displayed...');
expect(page.getTitle()).toBe('Quick Refund Estimator');
console.log('Verifying button -Estimate my taxes is displayed..');
expect(page.getButtonText_EstimatesMyTaxes()).toEqual(true);
});
Po.ts如下所示-
export class IntroductionPage {
navigateTo(url: string): void {
browser.get(url);
browser.waitForAngular();
}
getTitle() {
return element(by.className('qreTitl')).getText();
}
getButtonText_EstimatesMyTaxes() {
return element(by.buttonText('Estimate my taxe')).isDisplayed();
}
在当前场景中,当以下方法失败时,将停止进一步的执行,但我希望继续执行所有步骤
getTitle() {
return element(by.className('qreTitl')).getText();
}
你能帮帮我吗,
https://stackoverflow.com/questions/50640562
复制相似问题