Commit 0f39d089 authored by 张震's avatar 张震

Merge remote-tracking branch 'origin/Feature/20210416_zz' into Feature/20210416_zz

parents 9bf7a955 6d2695ad
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class Ansernum {
private String answerId;
private int num;
}
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class AnswerList {
private String answer;
private int num;
private String resourceTitle;
}
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class AnswerVosList {
private String id;
private String answer;
private String relationResourcePushVo;
}
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class ChoiceList {
private String answer;
private String relationResourceId;
}
package com.kjj.bean.choice;
import lombok.Data;
import java.util.List;
@Data
public class GetChoiceArray {
private String id;
private String question;
private List<AnswerList> answerList;
private String resourceTitleList;
}
\ No newline at end of file
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class GetChoiceList {
private GetChoiceArray list;
private boolean hasNext;
}
package com.kjj.bean.choice;
import lombok.Data;
import java.util.List;
@Data
public class GetChoiceQues {
private QuestionVo questionVo;
private List<AnswerVosList> answerVos;
}
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class QuestionVo {
private String id;
private String question;
}
package com.kjj.bean.choice;
import lombok.Data;
@Data
public class answer {
private String answer;
private int num;
private String resourceTitle;
}
package com.kjj.bean.manager;
import lombok.Data;
@Data
public class TeamList {
public int id;
}
package com.kjj.cases.live.FreeReward;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
public class FreeReward implements AdminAuthorization {
public String configId;
@Test(description = "查询免费领福利", priority = 1)
public void 查询免费领福利() {
visitorAuth2();
Map<String, Object> FreeRewardParam = new HashMap<>();
FreeRewardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response FreeRewardRes = network.getResponse(FreeRewardParam, BasicConfig.ANCHOR_listLiveFreeReward);
HashMap data = FreeRewardRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.configId = (String) data.get("configId");
System.out.println(configId);
Assert.assertNotNull(configId, network.message(FreeRewardParam, BasicConfig.ANCHOR_listLiveFreeReward, "查询免费领福利失败", FreeRewardRes.body().asString()));
}
@Test(description = "领取免费福利", priority = 2)
public void 领取免费福利() {
visitorAuth2();
Map<String, Object> receiveParam = new HashMap<>();
receiveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
receiveParam.put("liveInteractConfId",configId );
Response receiveRes = network.getResponse(receiveParam, BasicConfig.ANCHOR_receive);
Object data = receiveRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(receiveParam, BasicConfig.ANCHOR_receive, "领取免费福利失败", receiveRes.body().asString()));
}
@Test(description = "提交免费福利姓名", priority = 3)
public void 提交免费福利姓名() {
visitorAuth2();
Map<String, Object> submitInfoParam = new HashMap<>();
submitInfoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
submitInfoParam.put("confId",configId );
submitInfoParam.put("winnerName", "中奖姓名YY");
Response submitInfoRes = network.postResponse(submitInfoParam, BasicConfig.USER_submitInfo);
Boolean result = submitInfoRes.jsonPath().getBoolean("success");
System.out.println(result);
Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交姓名失败", submitInfoRes.body().asString()));
}
}
package com.kjj.cases.live.choice;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.choice.Ansernum;
import com.kjj.bean.choice.ChoiceList;
import com.kjj.bean.choice.GetChoiceArray;
import com.kjj.bean.choice.GetChoiceQues;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Choice implements AdminAuthorization {
public String id;
public String answerid;
public String questionid;
//************助播端************//
/*助播端添加投票*/
@Test(description = "助播端添加投票", priority = 1)
public void 助播端添加投票()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("question", "投票问题");
List<ChoiceList> choicelist=new ArrayList<>();
ChoiceList list=new ChoiceList();
list.setAnswer("答案一");
list.setRelationResourceId("");
choicelist.add(list);
ChoiceList list1=new ChoiceList();
list1.setAnswer("答案二");
list1.setRelationResourceId("");
choicelist.add(list1);
params.put("answerList", choicelist);
System.out.println("params = "+ JSON.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MOBILE_AddChoice);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_AddChoice, "主播端添加投票失败", response.body().asString()));
}
/*助播端获取投票详情*/
@Test(description = "助播端获取投票详情", priority = 2)
public void 助播端获取投票详情()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ChoiceCurrentDetail);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_ChoiceCurrentDetail, "助播端获取投票详情失败", response.body().asString()));
}
/*助播端获取投票列表*/
@Test(description = "助播端获取投票列表", priority = 3)
public void 助播端获取投票列表()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageSize", 30);
params.put("pageIndex", 1);
Response response = network.getResponse(params, BasicConfig.MOBILE_ChoiceGetList);
List<GetChoiceArray> getchoicelist= JsonUtil.parseResponseToPageBean(response, GetChoiceArray.class);
GetChoiceArray one=getchoicelist.get(0);
id=one.getId();
System.out.println(id);
System.out.println(getchoicelist);
Assert.assertNotNull(getchoicelist, network.message(params, BasicConfig.MOBILE_ChoiceGetList, "助播端获取投票详情失败", response.body().asString()));
}
/*助播端上架*/
@Test(description = "助播端上架投票", priority = 4)
public void 助播端上架投票()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("id", id);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.postResponse(params, BasicConfig.MOBILE_ChoiceSend);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_ChoiceSend, "助播端上架投票失败", response.body().asString()));
}
//访客端
/*访客端获取正在答题中的选择题*/
@Test(description = "访客端获取正在答题中的选择题", priority = 5)
public void 访客端获取正在答题中的选择题()
{
ThreadSleepUtils.sleep(5000);
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_GetChoiceQuestion);
GetChoiceQues data=JsonUtil.parseResponseToBean(response, GetChoiceQues.class);
questionid=data.getQuestionVo().getId();
answerid=data.getAnswerVos().get(0).getId();
System.out.println(questionid);
System.out.println(answerid);
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_GetChoiceQuestion, "访客端获取正在答题中的选择题失败", response.body().asString()));
}
/*访客端提交答案*/
@Test(description = "访客端提交答案", priority = 6)
public void 访客端提交答案()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("answerId", answerid);
params.put("questionId", questionid);
Response response = network.postResponse(params, BasicConfig.MOBILE_SubmitAnswer);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_SubmitAnswer, "访客端提交答案失败", response.body().asString()));
}
/*访客端获取答案的数量*/
@Test(description = "访客端获取答案的数量", priority = 7)
public void 访客端获取答案的数量()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("questionId", questionid);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_AnswerNum);
List<Ansernum> data=JsonUtil.parseResponseToListBean(response, Ansernum.class);
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_AnswerNum, "访客端获取答案的数量失败", response.body().asString()));
}
//代理人端
/*代理人端获取正在答题中的选择题*/
@Test(description = "代理人端获取正在答题中的选择题", priority = 8)
public void 代理人端获取正在答题中的选择题()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_GetChoiceQuestion);
GetChoiceQues data=JsonUtil.parseResponseToBean(response, GetChoiceQues.class);
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_GetChoiceQuestion, "代理人端获取正在答题中的选择题失败", response.body().asString()));
}
/*代理人端提交答案*/
@Test(description = "代理人端提交答案", priority = 9)
public void 代理人端提交答案()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("answerId", answerid);
params.put("questionId", questionid);
Response response = network.postResponse(params, BasicConfig.MOBILE_SubmitAnswer);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_SubmitAnswer, "代理人端提交答案失败", response.body().asString()));
}
/*代理人端获取答案的数量*/
@Test(description = "代理人端获取答案的数量", priority = 10)
public void 代理人端获取答案的数量()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("questionId", questionid);
Response response = network.getResponse(params, BasicConfig.MOBILE_AnswerNum);
List<Ansernum> data=JsonUtil.parseResponseToListBean(response, Ansernum.class);
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_AnswerNum, "代理人端获取答案的数量失败", response.body().asString()));
}
/*助播端下架投票*/
@Test(description = "助播端下架投票", priority = 11)
public void 助播端下架投票()
{
ThreadSleepUtils.sleep(5000);
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("id", id);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.postResponse(params, BasicConfig.MOBILE_ChoiceClose);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_ChoiceClose, "助播端下架投票失败", response.body().asString()));
}
}
...@@ -13,13 +13,13 @@ import org.testng.annotations.Test; ...@@ -13,13 +13,13 @@ import org.testng.annotations.Test;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
public class Lottery implements AdminAuthorization { public class Lottery implements AdminAuthorization {
public List<ConfidList> List_Confid; public List<ConfidList> List_Confid;
public String shareSign; public String shareSign;
public String token; public String token;
public String drawDownNum;
@Test(description = "代理人抽奖活动弹层福利列表", priority = 1) @Test(description = "代理人抽奖活动弹层福利列表", priority = 1)
public void 抽奖活动弹层福利列表() { public void 抽奖活动弹层福利列表() {
...@@ -135,6 +135,7 @@ public class Lottery implements AdminAuthorization { ...@@ -135,6 +135,7 @@ public class Lottery implements AdminAuthorization {
@Test(description = "结束第一轮抽奖", priority = 10) @Test(description = "结束第一轮抽奖", priority = 10)
public void 结束第一轮抽奖() { public void 结束第一轮抽奖() {
adminAuth(); adminAuth();
ThreadSleepUtils.sleep(1000);
Map<String, Object> endParam = new HashMap<>(); Map<String, Object> endParam = new HashMap<>();
endParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); endParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
endParam.put("confId", this.List_Confid.get(0).getWelfareConfId()); endParam.put("confId", this.List_Confid.get(0).getWelfareConfId());
...@@ -277,10 +278,9 @@ public class Lottery implements AdminAuthorization { ...@@ -277,10 +278,9 @@ public class Lottery implements AdminAuthorization {
Boolean result = submitInfoRes.jsonPath().getBoolean("success"); Boolean result = submitInfoRes.jsonPath().getBoolean("success");
System.out.println(result); System.out.println(result);
Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交姓名失败", submitInfoRes.body().asString())); Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交姓名失败", submitInfoRes.body().asString()));
ThreadSleepUtils.sleep(3000);
} }
@Test(description = "访客A中奖任务", priority = 20) @Test(description = "访客A中奖任务", priority = 20)
public void 访客A中奖任务() { public void 访客A中奖任务() {
visitorAuth(); visitorAuth();
...@@ -420,8 +420,15 @@ public class Lottery implements AdminAuthorization { ...@@ -420,8 +420,15 @@ public class Lottery implements AdminAuthorization {
Response myLotteryCodeRes = network.getResponse(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode); Response myLotteryCodeRes = network.getResponse(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode);
Object data = myLotteryCodeRes.jsonPath().getJsonObject("data"); Object data = myLotteryCodeRes.jsonPath().getJsonObject("data");
System.out.println(data); System.out.println(data);
Assert.assertNotNull(data, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "查询邀请人抽奖券列表失败", myLotteryCodeRes.body().asString())); List<Object> values = myLotteryCodeRes.jsonPath().getList("data.list");
boolean result = false;
for (Object value : values){
if (Objects.equals(((Map)value).get("codeSource"),5)){
result = true;
break;
}
}
Assert.assertNotNull(result, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "查询访客A抽奖券列表失败", myLotteryCodeRes.body().asString()));
} }
@Test(description = "访客A抽奖码数量", priority = 31) @Test(description = "访客A抽奖码数量", priority = 31)
...@@ -450,7 +457,7 @@ public class Lottery implements AdminAuthorization { ...@@ -450,7 +457,7 @@ public class Lottery implements AdminAuthorization {
} }
//完成幸运任务逻辑
@Test(description = "访客B直播中分享直播间", priority = 33) @Test(description = "访客B直播中分享直播间", priority = 33)
public void 访客B直播中分享直播间() { public void 访客B直播中分享直播间() {
visitorAuth2(); visitorAuth2();
...@@ -577,6 +584,7 @@ public class Lottery implements AdminAuthorization { ...@@ -577,6 +584,7 @@ public class Lottery implements AdminAuthorization {
public void 幸运任务邀请F根据绑定凭证发放抽奖码() { public void 幸运任务邀请F根据绑定凭证发放抽奖码() {
visitorAuth6(); visitorAuth6();
Map<String, Object> codeParam = new HashMap<>(); Map<String, Object> codeParam = new HashMap<>();
ThreadSleepUtils.sleep(500);
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token); codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code); Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
...@@ -607,9 +615,16 @@ public class Lottery implements AdminAuthorization { ...@@ -607,9 +615,16 @@ public class Lottery implements AdminAuthorization {
myLotteryCodeParam.put("pageIndex", 1); myLotteryCodeParam.put("pageIndex", 1);
myLotteryCodeParam.put("pageSize", 30); myLotteryCodeParam.put("pageSize", 30);
Response myLotteryCodeRes = network.getResponse(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode); Response myLotteryCodeRes = network.getResponse(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode);
Object data = myLotteryCodeRes.jsonPath().getJsonObject("data"); List<Object> values = myLotteryCodeRes.jsonPath().getList("data.list");
System.out.println(JSON.toJSON(data)); boolean result = false;
Assert.assertNotNull(data, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "查询邀请人抽奖券列表失败", myLotteryCodeRes.body().asString())); for (Object value : values){
if (Objects.equals(((Map)value).get("codeSource"),8)){
result = true;
break;
}
}
Assert.assertTrue(result, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "获取抽奖码列表失败", myLotteryCodeRes.body().asString()));
} }
@Test(description = "访客B的抽奖码数量", priority = 45) @Test(description = "访客B的抽奖码数量", priority = 45)
...@@ -692,7 +707,6 @@ public class Lottery implements AdminAuthorization { ...@@ -692,7 +707,6 @@ public class Lottery implements AdminAuthorization {
} }
@Test(description = "获取第二轮喜报", priority = 51) @Test(description = "获取第二轮喜报", priority = 51)
public void 获取第二轮喜报() { public void 获取第二轮喜报() {
visitorAuth(); visitorAuth();
......
...@@ -13,9 +13,7 @@ import io.restassured.response.Response; ...@@ -13,9 +13,7 @@ import io.restassured.response.Response;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import java.util.*; import java.util.*;
public class SaveAndUpdate implements AdminAuthorization { public class SaveAndUpdate implements AdminAuthorization {
public String liveID; public String liveID;
public String EncodeLiveID; public String EncodeLiveID;
...@@ -60,7 +58,6 @@ public class SaveAndUpdate implements AdminAuthorization { ...@@ -60,7 +58,6 @@ public class SaveAndUpdate implements AdminAuthorization {
public void 查询直播配置() { public void 查询直播配置() {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", liveID); params.put("liveId", liveID);
Response response = network.getResponse(params, BasicConfig.MANAGER_GETCONFDETAIL); Response response = network.getResponse(params, BasicConfig.MANAGER_GETCONFDETAIL);
Object data = response.jsonPath().getJsonObject("data"); Object data = response.jsonPath().getJsonObject("data");
System.out.println(data); System.out.println(data);
......
package com.kjj.cases.live.manager;
import com.kjj.bean.manager.TeamList;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Team implements AdminAuthorization {
public List<TeamList> id;
@Test(description = "新增团队", priority = 1)
public void 新增团队() {
BaseUtils.ssoLogin();
Map<String, Object> saveOrUpdateParam = new HashMap<>();
saveOrUpdateParam.put("companyId", 101);
saveOrUpdateParam.put("teamName", "测试团队");
saveOrUpdateParam.put("expectedNum", 100);
saveOrUpdateParam.put("id", "");
Response response = network.postResponse(saveOrUpdateParam, BasicConfig.MANAGER_saveOrUpdate);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(saveOrUpdateParam, BasicConfig.MANAGER_saveOrUpdate, "新增团队失败", response.body().asString()));
}
@Test(description = "查询团队列表", priority = 2)
public void 查询团队列表() {
Map<String, Object> teamListParam = new HashMap<>();
teamListParam.put("companyId", 101);
teamListParam.put("pageIndex", 1);
teamListParam.put("pageSize", 20);
Response response = network.getResponse(teamListParam, BasicConfig.MANAGER_teamList);
List<TeamList> list = JsonUtil.parseResponseToPageBean(response, TeamList.class);
System.out.println(list);
this.id = list;
Assert.assertNotNull(list, network.message(teamListParam, BasicConfig.MANAGER_teamList, "查询新增团队失败", response.body().asString()));
}
@Test(description = "修改团队", priority = 3)
public void 修改团队() {
Map<String, Object> saveOrUpdateParam = new HashMap<>();
saveOrUpdateParam.put("companyId", 101);
saveOrUpdateParam.put("id", this.id.get(0).getId());
saveOrUpdateParam.put("teamName", "测试团队");
Response response = network.postResponse(saveOrUpdateParam, BasicConfig.MANAGER_saveOrUpdate);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(saveOrUpdateParam, BasicConfig.MANAGER_saveOrUpdate, "修改新增团队失败", response.body().asString()));
}
@Test(description = "删除团队", priority = 4)
public void 删除团队() {
Map<String, Object> deleteParam = new HashMap<>();
deleteParam.put("id", this.id.get(0).getId());
Response response = network.postResponse(deleteParam, BasicConfig.MANAGER_del);
boolean deta =response.jsonPath().getBoolean("data");
System.out.println(deta);
Assert.assertTrue(deta, network.message(deleteParam, BasicConfig.MANAGER_del, "查询新增团队失败", response.body().asString()));
}
@Test(description = "设置内勤标识", priority = 5)
public void 设置内勤标识() {
Map<String, Object> teamFlagParam = new HashMap<>();
teamFlagParam.put("id", this.id.get(0).getId());
teamFlagParam.put("teamFlag", 1);
Response response = network.postResponse(teamFlagParam, BasicConfig.MANAGER_teamFlag);
boolean deta =response.jsonPath().getBoolean("data");
System.out.println(deta);
Assert.assertTrue(deta, network.message(teamFlagParam, BasicConfig.MANAGER_teamFlag, "查询新增团队失败", response.body().asString()));
}
@Test(description = "查询设置团队内勤标识", priority = 6)
public void 查询设置团队内勤标识() {
Map<String, Object> teamListParam = new HashMap<>();
teamListParam.put("companyId", 101);
teamListParam.put("pageIndex", 1);
teamListParam.put("pageSize", 20);
Response response = network.getResponse(teamListParam, BasicConfig.MANAGER_teamList);
List<TeamList> list = JsonUtil.parseResponseToPageBean(response, TeamList.class);
System.out.println(list);
this.id = list;
Assert.assertNotNull(list, network.message(teamListParam, BasicConfig.MANAGER_teamList, "查询设置团队内勤标识失败", response.body().asString()));
}
@Test(description = "取消团队内勤标识", priority = 7)
public void 取消内勤标识() {
Map<String, Object> teamFlagParam = new HashMap<>();
teamFlagParam.put("id", this.id.get(0).getId());
teamFlagParam.put("teamFlag", 0);
Response response = network.postResponse(teamFlagParam, BasicConfig.MANAGER_teamFlag);
boolean deta =response.jsonPath().getBoolean("data");
System.out.println(deta);
Assert.assertTrue(deta, network.message(teamFlagParam, BasicConfig.MANAGER_teamFlag, "查询新增团队失败", response.body().asString()));
}
@Test(description = "查询取消团队内勤标识", priority = 8)
public void 查询取消团队内勤标识() {
Map<String, Object> teamListParam = new HashMap<>();
teamListParam.put("companyId", 101);
teamListParam.put("pageIndex", 1);
teamListParam.put("pageSize", 20);
Response response = network.getResponse(teamListParam, BasicConfig.MANAGER_teamList);
List<TeamList> list = JsonUtil.parseResponseToPageBean(response, TeamList.class);
System.out.println(list);
this.id = list;
Assert.assertNotNull(list, network.message(teamListParam, BasicConfig.MANAGER_teamList, "查询取消内勤标识失败", response.body().asString()));
}
}
...@@ -2,6 +2,7 @@ package com.kjj.cases.live.user; ...@@ -2,6 +2,7 @@ package com.kjj.cases.live.user;
import com.kjj.cases.live.admin.AdminAuthorization; import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants; import com.kjj.constants.LiveConstants;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response; import io.restassured.response.Response;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
...@@ -46,6 +47,7 @@ public class User implements AdminAuthorization { ...@@ -46,6 +47,7 @@ public class User implements AdminAuthorization {
@Test(description = "根据绑定凭证发放抽奖码", priority = 3) @Test(description = "根据绑定凭证发放抽奖码", priority = 3)
public void 根据绑定凭证发放抽奖码() { public void 根据绑定凭证发放抽奖码() {
ThreadSleepUtils.sleep(500);
Map<String, Object> codeParam = new HashMap<>(); Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token); codeParam.put("token", token);
...@@ -138,8 +140,6 @@ public class User implements AdminAuthorization { ...@@ -138,8 +140,6 @@ public class User implements AdminAuthorization {
} }
//访客分享直播间
@Test(description = "访客分享直播间", priority = 10) @Test(description = "访客分享直播间", priority = 10)
public void 访客分享直播间() { public void 访客分享直播间() {
Map<String, Object> signParam = new HashMap<>(); Map<String, Object> signParam = new HashMap<>();
...@@ -153,8 +153,6 @@ public class User implements AdminAuthorization { ...@@ -153,8 +153,6 @@ public class User implements AdminAuthorization {
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString())); Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
} }
//访客邀请绑定
@Test(description = "访客邀请关系绑定", priority = 11) @Test(description = "访客邀请关系绑定", priority = 11)
public void 访客邀请关系绑定() { public void 访客邀请关系绑定() {
visitorAuth2(); visitorAuth2();
...@@ -167,8 +165,6 @@ public class User implements AdminAuthorization { ...@@ -167,8 +165,6 @@ public class User implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString())); Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
} }
@Test(description = "访客获取绑定结果和绑定凭证", priority = 12) @Test(description = "访客获取绑定结果和绑定凭证", priority = 12)
public void 访客获取绑定结果和绑定凭证() { public void 访客获取绑定结果和绑定凭证() {
visitorAuth2(); visitorAuth2();
...@@ -183,10 +179,10 @@ public class User implements AdminAuthorization { ...@@ -183,10 +179,10 @@ public class User implements AdminAuthorization {
Assert.assertNotNull(token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString())); Assert.assertNotNull(token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
} }
@Test(description = "访客根据绑定凭证发放抽奖码", priority = 13) @Test(description = "访客根据绑定凭证发放抽奖码", priority = 13)
public void 访客根据绑定凭证发放抽奖码() { public void 访客根据绑定凭证发放抽奖码() {
visitorAuth2(); visitorAuth2();
ThreadSleepUtils.sleep(500);
Map<String, Object> codeParam = new HashMap<>(); Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token); codeParam.put("token", token);
......
...@@ -3,9 +3,9 @@ package com.kjj.config; ...@@ -3,9 +3,9 @@ package com.kjj.config;
public class BasicConfig { public class BasicConfig {
public static int apiCount; //接口数量统计 public static int apiCount; //接口数量统计
// 是否开启钉钉机器人推送 // 是否开启钉钉机器人推送
public static final boolean isPushReport =false; //true public static final boolean isPushReport =true; //true
// 代理人微信昵称 // 代理人微信昵称
public static final String WECHAT_NAME = "嘿保险"; //true public static final String WECHAT_NAME = "吉吉"; //true
// 代理人的openid(固定) // 代理人的openid(固定)
public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08"; public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08";
//直播管理员(嘿 保险) //直播管理员(嘿 保险)
...@@ -52,7 +52,9 @@ public class BasicConfig { ...@@ -52,7 +52,9 @@ public class BasicConfig {
public static final String ANCHOR_OPEN = MOBILE_HOST + "/conf/live/open"; public static final String ANCHOR_OPEN = MOBILE_HOST + "/conf/live/open";
public static final String ANCHOR_getConfDetail = MOBILE_HOST + "/conf/pre/getConfDetail"; public static final String ANCHOR_getConfDetail = MOBILE_HOST + "/conf/pre/getConfDetail";
public static final String ANCHOR_CLOSE = MOBILE_HOST + "/conf/live/close"; public static final String ANCHOR_CLOSE = MOBILE_HOST + "/conf/live/close";
// *************** 免费领福利 ***************
public static final String ANCHOR_listLiveFreeReward = MOBILE_HOST + "/kjy/live/lottery/listLiveFreeReward";
public static final String ANCHOR_receive = MOBILE_HOST + "/kjy/live/user/lottery/receive";
// *************** 代理人指定中奖 *************** // *************** 代理人指定中奖 ***************
public static final String MOBILE_getSpecifyAwardConf = MOBILE_HOST + "/conf/pre/specifyAward/getSpecifyAwardConf"; public static final String MOBILE_getSpecifyAwardConf = MOBILE_HOST + "/conf/pre/specifyAward/getSpecifyAwardConf";
public static final String MOBILE_getAgentParticipateCond = MOBILE_HOST + "/conf/pre/specifyAward/getAgentParticipateCond"; public static final String MOBILE_getAgentParticipateCond = MOBILE_HOST + "/conf/pre/specifyAward/getAgentParticipateCond";
...@@ -149,7 +151,6 @@ public class BasicConfig { ...@@ -149,7 +151,6 @@ public class BasicConfig {
//查询资料列表// //查询资料列表//
public static final String MOBILE_Resource = MOBILE_HOST + "/clue/resource/list"; public static final String MOBILE_Resource = MOBILE_HOST + "/clue/resource/list";
public static final String MOBILE_ResourceOn = MOBILE_HOST + "/conf/live/push/on"; public static final String MOBILE_ResourceOn = MOBILE_HOST + "/conf/live/push/on";
...@@ -172,14 +173,15 @@ public class BasicConfig { ...@@ -172,14 +173,15 @@ public class BasicConfig {
public static final String MOBILE_Code = MOBILE_HOST + "/clue/invitation/code"; public static final String MOBILE_Code = MOBILE_HOST + "/clue/invitation/code";
public static final String MOBILE_MyLotteryCode = MOBILE_HOST + "/kjy/live/lottery/myLotteryCode"; public static final String MOBILE_MyLotteryCode = MOBILE_HOST + "/kjy/live/lottery/myLotteryCode";
//投票 //投票
public static final String MOBILE_ChoiceCurrentDetail = MOBILE_HOST + "/conf/live/choice/currentDetail"; public static final String MOBILE_ChoiceCurrentDetail = MOBILE_HOST + "/conf/live/choice/currentDetail";
public static final String MOBILE_AddChoice = MOBILE_HOST + "/conf/live/choice/addChoice"; public static final String MOBILE_AddChoice = MOBILE_HOST + "/conf/live/choice/addChoice";
public static final String MOBILE_ChoiceGetList = MOBILE_HOST + "/conf/live/choice/getList"; public static final String MOBILE_ChoiceGetList = MOBILE_HOST + "/conf/live/choice/getList";
public static final String MOBILE_ChoiceSend = MOBILE_HOST + "/conf/live/choice/send"; public static final String MOBILE_ChoiceSend = MOBILE_HOST + "/conf/live/choice/send";
public static final String MOBILE_ChoiceClose = MOBILE_HOST + "/conf/live/choice/close"; public static final String MOBILE_ChoiceClose = MOBILE_HOST + "/conf/live/choice/close";
public static final String MOBILE_GetChoiceQuestion = MOBILE_HOST + "/clue/choice/getChoiceQuestion";
public static final String MOBILE_SubmitAnswer = MOBILE_HOST + "/clue/choice/submitAnswer";
public static final String MOBILE_AnswerNum = MOBILE_HOST + "/clue/choice/answerNum";
//红包// //红包//
public static final String MOBILE_AnchorRedList = MOBILE_HOST + "/conf/live/red/findRedList"; public static final String MOBILE_AnchorRedList = MOBILE_HOST + "/conf/live/red/findRedList";
...@@ -232,7 +234,11 @@ public class BasicConfig { ...@@ -232,7 +234,11 @@ public class BasicConfig {
public static final String MANAGER_FREE= MANAGER_HOST+ "/kjy/manager/live/resource/saveOrUpdateFree"; public static final String MANAGER_FREE= MANAGER_HOST+ "/kjy/manager/live/resource/saveOrUpdateFree";
public static final String MANAGER_TEST= MANAGER_HOST+ "/kjy/manager/live/resource/saveOrUpdateTest"; public static final String MANAGER_TEST= MANAGER_HOST+ "/kjy/manager/live/resource/saveOrUpdateTest";
//***************直播团队管理*****************
public static final String MANAGER_teamList = MANAGER_HOST+ "/kjy/manager/live/company/team/teamList";
public static final String MANAGER_saveOrUpdate = MANAGER_HOST+ "/kjy/manager/live/company/team/saveOrUpdate";
public static final String MANAGER_del = MANAGER_HOST+ "/kjy/manager/live/company/team/delete";
public static final String MANAGER_teamFlag = MANAGER_HOST+ "/kjy/manager/live/company/team/teamFlag";
// *************** 素材ID *************** // *************** 素材ID ***************
public static final String ARTICLE_CONTENTID = "Kj21NjM4NDc"; public static final String ARTICLE_CONTENTID = "Kj21NjM4NDc";
......
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
<class name="com.kjj.cases.live.manager.LiveMaterial"/> <class name="com.kjj.cases.live.manager.LiveMaterial"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="团队管理">
<classes>
<class name="com.kjj.cases.live.manager.Team"/>
</classes>
</test>
<test preserve-order="true" name="创建直播"> <test preserve-order="true" name="创建直播">
<classes> <classes>
...@@ -52,6 +57,12 @@ ...@@ -52,6 +57,12 @@
<class name="com.kjj.cases.live.lottery.Lottery"/> <class name="com.kjj.cases.live.lottery.Lottery"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="免费领福利">
<classes>
<class name="com.kjj.cases.live.FreeReward.FreeReward"/>
</classes>
</test>
<test preserve-order="true" name="访客领取资料"> <test preserve-order="true" name="访客领取资料">
<classes> <classes>
<class name="com.kjj.cases.live.anchor.LiveVisitors"/> <class name="com.kjj.cases.live.anchor.LiveVisitors"/>
...@@ -73,6 +84,11 @@ ...@@ -73,6 +84,11 @@
<class name="com.kjj.cases.live.red.QuestionAwards"/> <class name="com.kjj.cases.live.red.QuestionAwards"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="投票">
<classes>
<class name="com.kjj.cases.live.choice.Choice"/>
</classes>
</test>
<test preserve-order="true" name="助播-结束直播"> <test preserve-order="true" name="助播-结束直播">
<classes> <classes>
<class name="com.kjj.cases.live.anchor.CloseLive"/> <class name="com.kjj.cases.live.anchor.CloseLive"/>
......
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