Specflow 绕过失败后的后续场景
Specflow bypasses subsequent scenarios after a failure
所有场景都按预期运行,但到目前为止,我只有 1 个。
既然有了第二种情况,就会出现下面的问题。
如果场景 1 断言失败,则跳过后续场景。
请参阅下面跳过的场景。
Setup: ConfigFileTransformation (thread #0)
Scenario: Shows telephone numbers on the header in ShowContactInformation
(target: BrowserBrowserStack_Win8_Chrome_52) -> Succeeded on thread #0
Scenario: Shows telephone numbers on the contact sidebar box in
ShowContactInformation (target: BrowserBrowserStack_Win8_Chrome_52)
-> Failed on thread #0
[ERROR] 2 assertions failed.
Restore: ConfigFileTransformation (thread #0)
Scenario: Shows telephone numbers on the header in ShowContactInformation
(target: BrowserBrowserStack_Win8_Firefox_42)
-> Skipped on thread #-1
Scenario: Shows telephone numbers on the contact sidebar box in
ShowContactInformation
(target: BrowserBrowserStack_Win8_Firefox_42)
-> Skipped on thread #-1
Result: 1 failed
Total: 4
Succeeded: 1
Ignored: 0
Pending: 0
Skipped: 2 <--- **** Other scenarios must be executed regardless of anything else.
Failed: 1
如何防止 specflow 跳过后续场景?
将测试配置文件的执行元素更新为:
<Execution retryFor="None" stopAfterFailures="0" testThreadCount="1" testSchedulingMode="Sequential" />
关键好像是stopAfterFailures="0"
.
所有场景都按预期运行,但到目前为止,我只有 1 个。
既然有了第二种情况,就会出现下面的问题。
如果场景 1 断言失败,则跳过后续场景。
请参阅下面跳过的场景。
Setup: ConfigFileTransformation (thread #0)
Scenario: Shows telephone numbers on the header in ShowContactInformation
(target: BrowserBrowserStack_Win8_Chrome_52) -> Succeeded on thread #0
Scenario: Shows telephone numbers on the contact sidebar box in
ShowContactInformation (target: BrowserBrowserStack_Win8_Chrome_52)
-> Failed on thread #0
[ERROR] 2 assertions failed.
Restore: ConfigFileTransformation (thread #0)
Scenario: Shows telephone numbers on the header in ShowContactInformation
(target: BrowserBrowserStack_Win8_Firefox_42)
-> Skipped on thread #-1
Scenario: Shows telephone numbers on the contact sidebar box in
ShowContactInformation
(target: BrowserBrowserStack_Win8_Firefox_42)
-> Skipped on thread #-1
Result: 1 failed
Total: 4
Succeeded: 1
Ignored: 0
Pending: 0
Skipped: 2 <--- **** Other scenarios must be executed regardless of anything else.
Failed: 1
如何防止 specflow 跳过后续场景?
将测试配置文件的执行元素更新为:
<Execution retryFor="None" stopAfterFailures="0" testThreadCount="1" testSchedulingMode="Sequential" />
关键好像是stopAfterFailures="0"
.