soft Assert 没有按预期使测试用例失败,该怎么办?
soft Assert is not failing the test case as expected, what to do?
我添加了一个验证标题断点,其中软断言正在比较两个字符串,这两个字符串将是两个标题,理想情况下,如果它不会进入下一页,那么 S1 仍然说 x,S2 也仍然是 x,然后 softAssert s.assertNotEquals(s1,s2) 变为假,测试用例失败,ITestResult return 类型为真。但它并没有使测试用例失败。
assertAll()方法需要在最后调用,如果你想判断结果是通过还是失败。 https://www.seleniumeasy.com/testng-tutorials/soft-asserts-in-testng-example
我添加了一个验证标题断点,其中软断言正在比较两个字符串,这两个字符串将是两个标题,理想情况下,如果它不会进入下一页,那么 S1 仍然说 x,S2 也仍然是 x,然后 softAssert s.assertNotEquals(s1,s2) 变为假,测试用例失败,ITestResult return 类型为真。但它并没有使测试用例失败。
assertAll()方法需要在最后调用,如果你想判断结果是通过还是失败。 https://www.seleniumeasy.com/testng-tutorials/soft-asserts-in-testng-example