茉莉花量角器打字稿在一个预期的失败后继续执行 [英] jasmine protractor typescript to continue execution after one expected failure in it block
问题描述
我正在使用带有量标脚本的量角器茉莉花框架-
I am using protractor-jasmine framework with typescript -
所以我在describe内有多个it块,因此在每个it块内有许多方法或我正在验证的期望条件-
so i have multiple it blocks within describe , so within each it block there are many methods or expect conditions i am verifying-
所以目前,当期望失败之一时,整个it块都终止了,所以我想即使一步失败也要继续执行.
so currently when one of the expect failed then whole it block is terminated , so i want to continue the execution even after one step fail.
以下是 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);
});
Pos.如下-
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();
}
在当前情况下,当以下方法失败时,将停止进一步执行,但我想继续执行所有步骤
In current scenario when below methods fail then further execution is stopped but i want to continue all step execution
getTitle() {
return element(by.className('qreTitl')).getText();
}
能请你帮我吗,
推荐答案
我认为停止的事实是预期的行为.
The fact that stops I believe is the intended behavior.
无论如何,您可以尝试以下方法:
Anyway, you could maybe try with:
jasmine --stop-on-failure=false
这是文档.
这篇关于茉莉花量角器打字稿在一个预期的失败后继续执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!