Commit 16cf5618 authored by 郭姣's avatar 郭姣

翻牌红包等级优化接口

parent ac4118c7
...@@ -114,7 +114,7 @@ public class FlipCard implements Authorization { ...@@ -114,7 +114,7 @@ public class FlipCard implements Authorization {
Map<String, Object> Params = new HashMap<>(); Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey())); Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
//Params.put("liveId",6441); //Params.put("liveId",6441);
Params.put("freeNum",3); Params.put("freeNum",1);
Params.put("helpNum",1); Params.put("helpNum",1);
List<RedLevelBean> RedLevels = new ArrayList<>(); List<RedLevelBean> RedLevels = new ArrayList<>();
RedLevelBean redLevel1 = new RedLevelBean(); RedLevelBean redLevel1 = new RedLevelBean();
...@@ -149,7 +149,7 @@ public class FlipCard implements Authorization { ...@@ -149,7 +149,7 @@ public class FlipCard implements Authorization {
Map<String, Object> Params = new HashMap<>(); Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey())); Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
//Params.put("liveId",6451); //Params.put("liveId",6451);
Params.put("freeNum",3); Params.put("freeNum",1);
Params.put("helpNum",1); Params.put("helpNum",1);
List<RedLevelBean> RedLevels = new ArrayList<>(); List<RedLevelBean> RedLevels = new ArrayList<>();
RedLevelBean redLevel1 = new RedLevelBean(); RedLevelBean redLevel1 = new RedLevelBean();
...@@ -280,7 +280,7 @@ public class FlipCard implements Authorization { ...@@ -280,7 +280,7 @@ public class FlipCard implements Authorization {
infoParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); infoParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign); infoParam.put("shareSign",shareSign);
infoParam.put("shareType",12); infoParam.put("shareType",12);
infoParam.put("confId",this.redConfId); //infoParam.put("confId",this.redConfId);
visitorAuth22(); visitorAuth22();
Response response = network.getResponse(infoParam, BasicConfig.MOBILE_info); Response response = network.getResponse(infoParam, BasicConfig.MOBILE_info);
Object data = response.jsonPath().getJsonObject("data"); Object data = response.jsonPath().getJsonObject("data");
...@@ -312,7 +312,7 @@ public class FlipCard implements Authorization { ...@@ -312,7 +312,7 @@ public class FlipCard implements Authorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSign); params.put("shareSign",shareSign);
params.put("shareType",12); params.put("shareType",12);
params.put("confId",this.redConfId); //params.put("confId",this.redConfId);
response = network.postResponse(params, BasicConfig.MOBILE_assist); response = network.postResponse(params, BasicConfig.MOBILE_assist);
System.out.println(response.body().asString()); System.out.println(response.body().asString());
...@@ -349,7 +349,7 @@ public class FlipCard implements Authorization { ...@@ -349,7 +349,7 @@ public class FlipCard implements Authorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSign); params.put("shareSign",shareSign);
params.put("shareType",12); params.put("shareType",12);
params.put("confId",this.redConfId); //params.put("confId",this.redConfId);
visitorAuth9(); visitorAuth9();
Response response = network.postResponse(params, BasicConfig.MOBILE_assist); Response response = network.postResponse(params, BasicConfig.MOBILE_assist);
...@@ -580,18 +580,18 @@ public class FlipCard implements Authorization { ...@@ -580,18 +580,18 @@ public class FlipCard implements Authorization {
} }
@Test(description = "放弃开红包", priority = 23) // @Test(description = "放弃开红包", priority = 23)
public void 放弃开红包() { // public void 放弃开红包() {
visitorAuth22(); // visitorAuth22();
ThreadSleepUtils.sleep(1000); // ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>(); // Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); // params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.postResponse(params, BasicConfig.MOBILE_abort); // Response response = network.postResponse(params, BasicConfig.MOBILE_abort);
System.out.println(response.body().asString()); // System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data"); // boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString())); // Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString()));
//
} // }
@Test(description = "开红包", priority = 24) @Test(description = "开红包", priority = 24)
...@@ -604,6 +604,13 @@ public class FlipCard implements Authorization { ...@@ -604,6 +604,13 @@ public class FlipCard implements Authorization {
System.out.println(response.body().asString()); System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data"); boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response.body().asString())); Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response.body().asString()));
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_redOpen);
System.out.println(response2.body().asString());
boolean data2 =response2.jsonPath().getBoolean("data");
Assert.assertTrue(data2, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response2.body().asString()));
} }
@Test(description = "用户开红包状态查询", priority = 25) @Test(description = "用户开红包状态查询", priority = 25)
...@@ -624,13 +631,17 @@ public class FlipCard implements Authorization { ...@@ -624,13 +631,17 @@ public class FlipCard implements Authorization {
Response finishRes = network.getResponse(params, BasicConfig.MOBILE_finishStatus); Response finishRes = network.getResponse(params, BasicConfig.MOBILE_finishStatus);
System.out.println(finishRes.body().asString()); System.out.println(finishRes.body().asString());
int status1 =finishRes.jsonPath().getInt("data.status"); int status1 =finishRes.jsonPath().getInt("data.status");
Assert.assertTrue(status1==4, network.message(params, BasicConfig.MOBILE_finishStatus, "集字状态不对", finishRes.body().asString())); Assert.assertTrue(status1==3, network.message(params, BasicConfig.MOBILE_finishStatus, "集字状态不对", finishRes.body().asString()));
int redStatus2 =response.jsonPath().getInt("data.redStatus");
Assert.assertTrue(redStatus2==4, network.message(params, BasicConfig.MOBILE_finishStatus, "发钱异常", finishRes.body().asString()));
} }
//开启不同等级的红包
@Test(description = "开红包结果", priority = 26) @Test(description = "开红包结果", priority = 26)
public void 开红包结果() { public void 开红包结果() {
//红包等级I
visitorAuth9(); visitorAuth9();
ThreadSleepUtils.sleep(1000); ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
...@@ -640,9 +651,30 @@ public class FlipCard implements Authorization { ...@@ -640,9 +651,30 @@ public class FlipCard implements Authorization {
int redStatus =response.jsonPath().getInt("data.redStatus"); int redStatus =response.jsonPath().getInt("data.redStatus");
Assert.assertTrue(redStatus==4, network.message(params, BasicConfig.MOBILE_redOpenState, "红包领取状态不对", response.body().asString())); Assert.assertTrue(redStatus==4, network.message(params, BasicConfig.MOBILE_redOpenState, "红包领取状态不对", response.body().asString()));
int redAmount =response.jsonPath().getInt("data.redAmount"); int redAmount =response.jsonPath().getInt("data.redAmount");
Assert.assertTrue(redAmount==1000, network.message(params, BasicConfig.MOBILE_redOpenState, "红包金额不对", response.body().asString())); Assert.assertTrue(redAmount==30, network.message(params, BasicConfig.MOBILE_redOpenState, "红包金额不对", response.body().asString()));
} //红包等级II
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_redOpenState);
System.out.println(response2.body().asString());
int redStatus2 =response2.jsonPath().getInt("data.redStatus");
Assert.assertTrue(redStatus2==4, network.message(params, BasicConfig.MOBILE_redOpenState, "红包领取状态不对", response2.body().asString()));
int redAmount2 =response2.jsonPath().getInt("data.redAmount");
System.out.println(redAmount2);
Assert.assertTrue(redAmount2==40, network.message(params, BasicConfig.MOBILE_redOpenState, "红包金额不对", response2.body().asString()));
}
@Test(description = "翻牌集字配置详情",priority = 27)
public void 翻牌集字配置详情(){
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_confV2);
Object data = response.jsonPath().getJsonObject("data");
String titleImage = response.jsonPath().getString("data.titleImage");
Assert.assertNotNull(data, network.message(params,BasicConfig.MOBILE_confV2,"翻牌配置详情查询失败",response.body().asString()));
Assert.assertNull(titleImage, network.message(params,BasicConfig.MOBILE_confV2,"获取默认标题配图失败",response.body().asString()));
}
} }
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