Commit fd64fe09 authored by 赵然's avatar 赵然

zr

parent cc7e74d3
......@@ -222,7 +222,7 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
@Test
public void 自有活动工具扣库存测试() throws Exception {
//获取兑换项库存
Response response = developerService.appItems("2239","【自动化勿动】自有优惠券");
Response response = developerService.appItems("2239","【自动化勿动】zr自有优惠券");
//response.prettyPrint();
String remind = response.jsonPath().getString("data.list[0].remaind");
logger.info("抽奖前兑换项库存为:"+remind);
......@@ -240,18 +240,18 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
response = this.新活动工具接口传参("28247","abcde","iOS");
Assert.assertEquals(response.jsonPath().getString("lottery.type"),"coupon","校验type失败");
Assert.assertEquals(response.jsonPath().getString("lottery.title"),"【自动化勿动】自有优惠券","校验title失败");
Assert.assertEquals(response.jsonPath().getString("lottery.title"),"【自动化勿动】zr自有优惠券","校验title失败");
Assert.assertTrue(response.jsonPath().getString("lottery.link").contains("/crecord/recordDetailNew?orderId="));
Assert.assertEquals(response.jsonPath().getString("lottery.id"), "16405", "校验id失败");
logger.info("校验实物商品:type,title,link,id成功");
//校验兑换项库存
response = developerService.appItems("2239","【自动化勿动】自有优惠券");
response = developerService.appItems("2239","【自动化勿动】zr自有优惠券");
String Newremind = response.jsonPath().getString("data.list[0].remaind");
int i= 10;
while(i>0 && !Newremind.equals(remind)){
Thread.sleep(500);
response = developerService.appItems("2239","【自动化勿动】自有优惠券");
response = developerService.appItems("2239","【自动化勿动】zr自有优惠券");
Newremind = response.jsonPath().getString("data.list[0].remaind");
i--;
}
......
......@@ -23,6 +23,7 @@ import static io.restassured.RestAssured.given;
/**
* Created by 赵然 on 2019/04/04
* AppId: 22565
*/
public class 总帐户提现页校验 extends DuibaTestBase{
@Value("${activity.host}")
......@@ -48,15 +49,39 @@ public class 总帐户提现页校验 extends DuibaTestBase{
Response response = globalRewardService.toWithdraw(uid);
response.print();
String expireTime = response.jsonPath().getString("expireTime");
String perLimitAmount = response.jsonPath().getString("perLimitAmount");
String periodOpen = response.jsonPath().getString("periodOpen");
String expireTime = response.jsonPath().getString("data.expireTime");
String perLimitAmount = response.jsonPath().getString("data.perLimitAmount");
String periodOpen = response.jsonPath().getString("data.periodOpen");
Assert.assertEquals(expireTime,"2021/01/31 00:00:00","提现页过期时间校验失败");
Assert.assertEquals(perLimitAmount,"2000","提现页满额提现金额校验失败");
Assert.assertEquals(periodOpen,"true","总帐户状态校验失败");
logger.info("总帐户提现页校验成功!");
}
@Test
public void 后台红包周期校验() throws Exception {
}
Response response = globalRewardService.periodList("18157163293","22565","2");
response.print();
String bonusLimit = response.jsonPath().getString("data[0].bonusLimit");
String forConfirm = response.jsonPath().getString("data[0].forConfirm");
String periodStatus = response.jsonPath().getString("data[0].periodStatus");
String withdrawThreshold = response.jsonPath().getString("data[0].withdrawThreshold");
String relType = response.jsonPath().getString("data[0].relList[0].relType");
String relTypeName = response.jsonPath().getString("data[0].relList[0].relTypeName");
Assert.assertEquals(bonusLimit,"40000","红包预算校验失败");
Assert.assertEquals(forConfirm,"false","确认按钮校验失败");
Assert.assertEquals(periodStatus,"OPEN","总帐户状态校验失败");
Assert.assertEquals(withdrawThreshold,"2000","用户提现限制校验失败");
Assert.assertEquals(relType,"PK","关联活动类型校验失败");
Assert.assertEquals(relTypeName,"组件pk","关联活动名称校验失败");
}
}
......@@ -24,6 +24,7 @@ import static io.restassured.RestAssured.given;
/**
* Created by 赵然 on 2019/03/29
* AppId: 22565
*/
public class 总帐户账户正常提现 extends DuibaTestBase{
@Value("${activity.host}")
......
......@@ -23,6 +23,8 @@ public class GlobalRewardService {
Authorization authorization;
@Value("${activity.host}")
String activityHost;
@Value("${hdserver.host}")
String hdHost;
private DuibaLog logger = DuibaLog.getLogger();
/**
......@@ -54,7 +56,12 @@ public class GlobalRewardService {
}
/**
* 红包账户提现页
* @param uid
* @return
* @throws Exception
*/
public Response toWithdraw(int uid) throws Exception {
logger.info("请求toWithdraw");
......@@ -72,4 +79,31 @@ public class GlobalRewardService {
}
/**
* 开发者后台红包周期列表
* @param account
* @param appId
* @param periodStatus 2:进行中
* @return
* @throws Exception
*/
public Response periodList(String account,String appId,String periodStatus) throws Exception {
logger.info("请求periodList");
Map<String,String> map = new HashMap<>();
map.put("periodStatus",periodStatus);
map.put("pageNum","1");
map.put("pageSize","10");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaasNew(account,appId)).params(map).post("http://"+hdHost+"/redpackets/manageTool/periodList");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/globalReward/toWithdraw接口失败");
}catch(Exception e){
throw new Exception("/redpackets/manageTool/periodList接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/redpackets/manageTool/periodList接口失败,返回信息:"+response.asString());
}
return response;
}
}
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