下面的代码段比较了两个列表。
在我的步骤中,我使用if语句来检查
然而,如果到达else语句,我是否有办法使cucumber测试失败?
destinationList
是否为空,如果是,则测试正确,并且cucumber步骤应继续进行。然而,如果到达else语句,我是否有办法使cucumber测试失败?
if (destinationList.isEmpty()) {
System.out.println("This report is correct");
} else {
System.out.println("This report is incorrect.");
System.out.println("This list conatains the expected values of the report and their locations:");
System.out.println("expected = "+sourceList);
System.out.println("This list contains the actual value from this report and their locations:");
System.out.println("actual = "+destinationList);
}