Commit a6f97eba authored by 张艳玲's avatar 张艳玲

update

parent 8d36761e
package com.kjj.cases.live;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
public class Agent implements AdminAuthorization {
@BeforeClass
public void setUp() {
agentAuth(); }
public String shareSign;
@Test(description = "分享直播间", priority = 1)
public void 分享直播间() {
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.shareSign = (String)data.get("shareSign");
System.out.println(shareSign);
LiveConstants.setValue(LiveConstants.StringKeyEnum.shareSign.getKey(),shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
}
}
......@@ -19,13 +19,7 @@ public class LiveAgent implements AdminAuthorization {
@BeforeClass
public void setUp() {
agentAuth(); }
public String liveid;
public String pageIndex;
public String pageSize;
public String agentId;
//代理人直播排行榜;
......@@ -35,7 +29,6 @@ public class LiveAgent implements AdminAuthorization {
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex",1);
params.put("pageSize",20);
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_AgentPersonalCharts);
boolean success = response.jsonPath().getBoolean("success");
......@@ -48,7 +41,6 @@ public class LiveAgent implements AdminAuthorization {
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex",1);
params.put("pageSize",20);
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_TeamTeamCharts);
boolean success = response.jsonPath().getBoolean("success");
......
......@@ -11,34 +11,17 @@ import java.util.List;
import java.util.Map;
public class User implements AdminAuthorization{
public String shareSign;
@BeforeClass
public void setUp() {
visitorAuth();
agentAuth();
}
//代理人分享直播链接
@Test(description = "分享直播间", priority = 1)
public void 分享直播间() {
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.shareSign = (String)data.get("shareSign");
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
}
@Test(description = "邀请关系绑定", priority = 2)
@Test(description = "邀请关系绑定", priority = 1)
public void 邀请关系绑定() {
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareType", shareSign);
bindingParam.put("shareType",LiveConstants.getValue(LiveConstants.StringKeyEnum.shareSign.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
......@@ -46,8 +29,7 @@ public class User implements AdminAuthorization{
}
@Test(description = "预约直播间", priority = 3)
@Test(description = "预约直播间", priority = 2)
public void 预约直播间() {
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("bizId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -63,7 +45,7 @@ public class User implements AdminAuthorization{
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "关注直播间", priority = 4)
@Test(description = "关注直播间", priority = 3)
public void 关注直播间() {
Map<String, Object> subscribeParam = new HashMap<>();
subscribeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -77,7 +59,7 @@ public class User implements AdminAuthorization{
Assert.assertTrue(data, network.message(subscribeParam, BasicConfig.USER_SUBSCRIBE, "关注失败", subscribeRes.body().asString()));
}
@Test(description = "查询关注状态", priority = 5)
@Test(description = "查询关注状态", priority = 4)
public void 查询关注状态() {
Map<String, Object> findParam = new HashMap<>();
findParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -88,7 +70,7 @@ public class User implements AdminAuthorization{
}
@Test(description = "保存海报获得抽奖码", priority = 6)
@Test(description = "保存海报获得抽奖码", priority = 5)
public void 保存海报获得抽奖码() {
Map<String, Object> savePosterParam = new HashMap<>();
savePosterParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -99,7 +81,7 @@ public class User implements AdminAuthorization{
}
@Test(description = "我的抽奖码数量", priority = 7)
@Test(description = "我的抽奖码数量", priority = 6)
public void 我的抽奖码数量() {
Map<String, Object> myCountParam = new HashMap<>();
myCountParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -3,6 +3,7 @@ package com.kjj.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.security.Key;
import java.util.HashMap;
import java.util.Map;
......@@ -22,7 +23,8 @@ public class LiveConstants {
public enum StringKeyEnum{
LIVE_ID(1,"直播ID的key"),
ENCODE_LIVE_ID(2,"直播加密ID的key"),
;
shareSign(3,"分享参数shareSign");
private Integer key;
private String desc;
}
......
......@@ -18,6 +18,12 @@
<classes>
<class name="com.kjj.cases.live.Procurator"/>
</classes>
</test>
<test preserve-order="true" name="代理人分享直播间">
<classes>
<class name="com.kjj.cases.live.Agent"/>
</classes>
</test>
<test preserve-order="true" name="访客券码领取">
......
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