我正在使用 Protractor-jasmine 框架和打字稿 -
所以我在describe中有多个it块,所以在每个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();
}
请你帮助我好吗,
我认为停止的事实是预期的行为。
无论如何,你也许可以尝试:
jasmine --stop-on-failure=false
这里是文档 https://jasmine.github.io/2.5/node.html#section-21.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)