Commit f890502b authored by 赵然's avatar 赵然

zr

parent 45ee2396
......@@ -198,38 +198,57 @@ public class 补签测试_signTest extends DuibaTestBase {
}
//@Test(description = "补签失败场景——积分不足")
// public void 补签_积分不足() throws Exception {
//
// //补签前一天(前2天-2,当天0,后一天+1)
// Response response = signactivityService.reSign(authorization.dafuwengLogin(uid), "80", null, getTime(-1));
// response.prettyPrint();
// //response.prettyPrint();
// String hasConsume = response.jsonPath().getString("data.hasConsume");
// //补签消耗数量
// String reSignConsumeCount = response.jsonPath().getString("data.reSignConsumeCount");
// //补签消耗类型
// String reSignConsumeTypeStr = response.jsonPath().getString("data.reSignConsumeTypeStr");
// Assert.assertEquals(hasConsume, "true", "补签是否消耗");
// Assert.assertEquals(reSignConsumeCount, "999999999", "补签消耗数量不正确");
// Assert.assertEquals(reSignConsumeTypeStr,"积分","补签消耗类型是否为积分");
// //补签logid
// String logId = response.jsonPath().getString("data.logId");
// response = signactivityService.getSignResult(authorization.dafuwengLogin(uid), logId);
// //签到状态
// String status = response.jsonPath().getString("status");
// //接口异步处理
// int i=10;
// while(status.equals("0")&&i>0){
// Thread.sleep(1000);
// response = signactivityService.getSignResult(authorization.dafuwengLogin(uid),logId);
// status = response.jsonPath().getString("status");
// i--;
// }
// String message = response.jsonPath().getString("message");
// //response.prettyPrint();
// //判断结果
// Assert.assertEquals(status,"1","补签失败状态不正确");
// Assert.assertEquals(message,"签到失败,用户积分余额不足","签到失败,用户积分余额不足");
//
// logger.info("补签失败用例成功,原因——积分不足");
//
// }
@Test(description = "补签失败场景——积分不足")
public void 补签_积分不足() throws Exception {
//补签前一天(前2天-2,当天0,后一天+1)
Response response = signactivityService.reSign(authorization.dafuwengLogin(uid), "80", null, getTime(-1));
response.prettyPrint();
//response.prettyPrint();
String hasConsume = response.jsonPath().getString("data.hasConsume");
//补签消耗数量
String reSignConsumeCount = response.jsonPath().getString("data.reSignConsumeCount");
//补签消耗类型
String reSignConsumeTypeStr = response.jsonPath().getString("data.reSignConsumeTypeStr");
Assert.assertEquals(hasConsume, "true", "补签是否消耗");
Assert.assertEquals(reSignConsumeCount, "999999999", "补签消耗数量不正确");
Assert.assertEquals(reSignConsumeTypeStr,"积分","补签消耗类型是否为积分");
//补签logid
String logId = response.jsonPath().getString("data.logId");
response = signactivityService.getSignResult(authorization.dafuwengLogin(uid), logId);
//签到状态
String status = response.jsonPath().getString("status");
//接口异步处理
int i=10;
while(status.equals("0")&&i>0){
Thread.sleep(1000);
response = signactivityService.getSignResult(authorization.dafuwengLogin(uid),logId);
status = response.jsonPath().getString("status");
i--;
}
String message = response.jsonPath().getString("message");
//response.prettyPrint();
String success = response.jsonPath().getString("success");
//判断结果
Assert.assertEquals(status,"1","补签失败状态不正确");
Assert.assertEquals(message,"签到失败,用户积分余额不足","签到失败,用户积分余额不足");
Assert.assertEquals(message,"您的积分不足","补签失败提示不正确");
Assert.assertEquals(success,"false","补签失败状态不正确");
logger.info("补签失败用例成功,原因——积分不足");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment