@测试 public static void TheAuditor() 抛出 IOException { 对于 (int i = 1; i < 318; i++) {
String api = excelRead(i, 0);
System.out.println(api);
String Roles = excelRead(0, 6);
System.out.println(Roles);
String status = excelRead(i, 6);
System.out.println(status);
String type = excelRead(i, 14);
System.out.println(Roles +"token"+ AuditorToken);
System.out.println(type);
if (type.equals("POST")) {
String payload = excelReadPayload(i, 6);
System.out.println(payload);
res = given().spec(requestSpecification(AuditorToken)).body(payload).log().all();
response = res.when().post(api).then().log().all().extract()
.response();
int stat = response.getStatusCode();
System.out.println(stat);
if (stat==200) {
assertEqual(status, "TRUE'", Roles+" "+" Condition for "+" "+type+" "+api+" is TRUE");
}else {
assertEqual(status, "FALSE'", Roles+" "+" Condition for "+" "+type+" "+api+" is FALSE");
}
}else {
res = given().spec(requestSpecification(AuditorToken)).log().all();
response = res.when().get(api).then().log().all().extract()
.response();
int stat = response.getStatusCode();
System.out.println(stat);
if (stat==200) {
assertEqual(status, "TRUE'", Roles+" "+" Condition for "+" "+type+" "+api+" is TRUE");
}else {
assertEqual(status, "FALSE'", Roles+" "+" Condition for "+" "+type+" "+api+" is FALSE");
}
}
}
}
在我使用的上述代码中,在循环内的每次运行中检查断言等于后,我需要在范围报告中获得通过或失败,并且在循环内每次点击断言等于后,我需要在范围报告中获得通过或失败, 任何人请给我解决方案