Commit 4bcd04ae authored by 张艳玲's avatar 张艳玲

奖品签收

parent fbdde173
package com.kjj.bean.answer;
import lombok.Data;
import java.util.List;
@Data
public class RewardDetail {
private String quesConfId;
private String quesType;
private RedDetail redDetail;
@Data
public static class RedDetail{
private String redConfId;
private int showAmount;
}
private String welfareDetail;
private int quesRewardSeconds;
private String quesRewardEndTime;
private int rewardStatus;
private String quesId;
private String questionDetail;
private List<QuestionLists> questionList;
@Data
public static class QuestionLists{
private String id;
private int optionType;
private String optionDetail;
}
}
......@@ -14,11 +14,10 @@ public interface AdminAuthorization {
// 创建用户 并传到network里
network.agentCookies.put("authKey",ADMIN_KEY);
System.out.println("用户AUTH_KEY:"+ADMIN_KEY);
}
/**
* 代理人授权
* 代理人(yl)授权
*/
default void agentAuth(){
// 创建用户 并传到network里
......@@ -26,6 +25,15 @@ public interface AdminAuthorization {
System.out.println("用户AUTH_KEY:"+AUTH_KEY);
}
/**
* 代理人(小疙瘩人寿)授权,ID:815
*/
default void agentAuth1(){
// 创建用户 并传到network里
network.agentCookies.put("authKey",agentAuth);
System.out.println("用户AUTH_KEY:"+agentAuth);
}
/**
* 访客A(志勇)授权,代理人指定中奖用户
*/
......@@ -82,14 +90,14 @@ public interface AdminAuthorization {
}
/**
* 访客H(喜洋洋)授权
* 访客I(喜洋洋)授权
*/
default void visitorAuth8() {
network.agentCookies.put("authKey", VISITORKEY8);
System.out.println("用户AUTH_KEY:" + VISITORKEY8);
}
/**
* 访客I(嘿保险)授权,ID:907
* 访客H(嘿保险)授权,ID:907
*/
default void visitorAuth9() {
network.agentCookies.put("authKey", VISITORKEY9);
......
......@@ -3,9 +3,9 @@ package com.kjj.cases.live.agent;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
......@@ -13,13 +13,13 @@ import java.util.Map;
public class Agent implements AdminAuthorization {
@BeforeClass
public void setUp() {
agentAuth(); }
public String shareSign;
public String shareSign1;
public String token;
@Test(description = "分享直播间", priority = 1)
public void 分享直播间() {
@Test(description = "代理人A分享直播间", priority = 1)
public void 代理人A分享直播间() {
agentAuth();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 1);
......@@ -30,4 +30,104 @@ public class Agent implements AdminAuthorization {
LiveConstants.setValue(LiveConstants.StringKeyEnum.shareSign.getKey(),shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
}
@Test(description = "代理人B分享直播间", priority = 2)
public void 代理人B分享直播间() {
agentAuth1();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 1);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
this.shareSign1 = (String)data.get("shareSign");
System.out.println(shareSign1);
Assert.assertNotNull(shareSign1, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
}
@Test(description = "访客H关系绑定", priority = 3)
public void 访客H关系绑定() {
visitorAuth9();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign1);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "中奖任务邀请H绑定结果和绑定凭证", priority = 4)
public void 获取访客H绑定结果和绑定凭证() {
visitorAuth9();
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Object token = tokenRes.jsonPath().getJsonObject("data");
Assert.assertNotNull(token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "中奖任务邀请H根据绑定凭证发放抽奖码", priority = 5)
public void 中奖任务邀请H根据绑定凭证发放抽奖码() {
visitorAuth9();
ThreadSleepUtils.sleep(500);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
}
@Test(description = "访客I关系绑定", priority = 6)
public void 访客I关系绑定() {
visitorAuth8();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign1);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "中奖任务邀请I绑定结果和绑定凭证", priority = 7)
public void 获取访客I绑定结果和绑定凭证() {
visitorAuth8();
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Object token = tokenRes.jsonPath().getJsonObject("data");
Assert.assertNotNull(token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "邀请I根据绑定凭证发放抽奖码", priority = 8)
public void 邀请I根据绑定凭证发放抽奖码() {
visitorAuth8();
ThreadSleepUtils.sleep(500);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
}
}
......@@ -582,10 +582,4 @@ public class LiveAgent implements AdminAuthorization {
}
\ No newline at end of file
......@@ -1039,81 +1039,7 @@ public class Lottery implements AdminAuthorization {
throw e;
}
}
@Test(description = "代理人分享直播间", priority = 74)
public void 代理人分享直播间() {
agentAuth();
ThreadSleepUtils.sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.shareSign = (String) data.get("shareSign");
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
}
@Test(description = "访客H关系绑定", priority = 75)
public void 访客H关系绑定() {
visitorAuth9();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "中奖任务邀请H绑定结果和绑定凭证", priority = 76)
public void 获取访客H绑定结果和绑定凭证() {
visitorAuth9();
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Object token = tokenRes.jsonPath().getJsonObject("data");
Assert.assertNotNull(token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "中奖任务邀请H根据绑定凭证发放抽奖码", priority = 77)
public void 中奖任务邀请H根据绑定凭证发放抽奖码() {
visitorAuth9();
ThreadSleepUtils.sleep(500);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
}
@Test(description = "访客H到场", priority = 78)
public void 访客H到场() {
visitorAuth9();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response connectSuccessoRes = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = connectSuccessoRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
}
}
......@@ -220,6 +220,7 @@ public class LiveMaterial implements AdminAuthorization {
saveOrUpdateLinkParam.put("companyId", 101);
saveOrUpdateLinkParam.put("resourceTitle", "图文资料2");
saveOrUpdateLinkParam.put("resourceButtonTitle", "我要报名");
saveOrUpdateLinkParam.put("outLinkType", 2);
saveOrUpdateLinkParam.put("outLink", "http://www.baidu.com");
saveOrUpdateLinkParam.put("resourceImg", "https://yun.dui88.com/kjy/image/20210306/1615026240244.jpeg");
......
......@@ -236,7 +236,7 @@ public class Add implements AdminAuthorization {
add1Param.put("questionConf", bean1);
add1Param.put("redConf", null);
AddWelfareConf welfareConf1 = new AddWelfareConf();
welfareConf1.setWelfareId(190);
welfareConf1.setWelfareId(191);
welfareConf1.setNum(100);
add1Param.put("welfareConf", welfareConf1);
Response add1Res = network.postResponse(add1Param, BasicConfig.MANAGER_add);
......
......@@ -12,6 +12,8 @@ public class BasicConfig {
public static String ADMIN_KEY="LEH7epeHVDJWzhZ6DiexTHnsy28ubjrAPGJYU3yPhwb8v3QC3S7b3s2kv18XVBS3CMLT1cmiLu1BdrrC3xbx1EHzWNbcL";
// 直播代理人 (艳玲)
public static String AUTH_KEY ="LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu";
// 直播代理人 (小疙瘩人寿)
public static String agentAuth ="LEH7epeHVDJWzhZ6DiexTHnsaPwVcYuMTJoYBwNRVTjB7uoajfndh6tsKxDJtDvxrpqcVjD3AUENBnMSmqdPjtjyZrTG8";
//直播访客 (志勇)
public static String VISITORKEY ="zFNkBc7JtvLPL6ifAfXbcgYH7WruadyTs58VQNVezBEHURWFkb861yA3TQfkngLojnBnDenawiYNbNADYRdv1vFcDi";
//直播访客 (茶仔)
......
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