1
这里的a link任何方式TestNG的软断言显示的assertEquals错误信息与给定的自定义消息一起
有没有办法用软断言给出的自定义消息一起显示默认的assertEquals错误消息?
我的要求是有自定义消息和断言错误消息如下。 “brokedown预期[1],但发现[0]”
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
public class SoftAsert
{
@Test
public void test()
{
SoftAssert asert=new SoftAssert();
asert.assertEquals(false, true,"failed");
asert.assertEquals(0, 1,"brokedown");
asert.assertAll();
}
}
呀,好像这只是现在的解决方案。 –