【发布时间】:2020-11-17 04:41:25
【问题描述】:
我想继续执行我的场景,即使在黄瓜报告中有些失败,它应该将其显示为失败但不应该停止执行。
我尝试使用软断言类并使用它
SoftAssertion sa = new SoftAssertion();
if (response.getStatusCode() == 200) {
Sytem.out.println("pAASED")
} else {
sa.fail("this is the failure");
}
但假设我有两个场景,第一个场景的响应不是 200,否则它将阻塞并导致场景失败
java.lang.AssertionError: this is the failure
at org.junit.Assert.fail(Assert.java:88)
它甚至不适合第二种情况。有人可以帮助我如何实现预期的结果(即它应该继续执行而不管一个失败)
【问题讨论】: