Commit 403267d1 authored by 龚小红's avatar 龚小红

修改亲友券和客户承诺话术

parent 77bcddef
......@@ -254,8 +254,7 @@ public class Customer implements Authorization {
int chanceType=response.jsonPath().getInt("data.chanceType");
Assert.assertTrue(chanceType==1, network.message(BasicConfig.MOBILE_followChanceDetail, "跟进类型非咨询", response.body().asString()));
String question=response.jsonPath().getString("data.question");
Assert.assertEquals(question,"一度问题1",network.message(BasicConfig.MOBILE_followChanceDetail, "咨询问题为null", response.body().asString()));
Assert.assertTrue(question.equals("一度问题1")||question.equals("一度问题2")||question.equals("一度问题3"),network.message(BasicConfig.MOBILE_followChanceDetail, "咨询问题为null", response.body().asString()));
}
......
......@@ -358,9 +358,9 @@ public class LiveLater implements Authorization {
public void 直播后准客户数量统计(){
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_clueChanceList);
Response response = network.getResponse(params,BasicConfig.MOBILE_potentialNum);
System.out.println(response.body().asString());
int potentialNum = response.jsonPath().getInt("data.potentialNum");
Assert.assertEquals(potentialNum,1,network.message(params,BasicConfig.MOBILE_clueChanceList,"准客户数量错误",response.body().asString()));
Assert.assertTrue(potentialNum > 0,network.message(params,BasicConfig.MOBILE_potentialNum,"准客户数量错误",response.body().asString()));
}
}
......@@ -2485,7 +2485,7 @@ public class SaveLive implements Authorization {
public void 保存客户承诺话术配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", 5628);
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
ArrayList<Dialogue> dialogues = new ArrayList<>();
dialogues.add(new Dialogue(new ArrayList<>(Arrays.asList("一度问题1","一度问题2","一度问题3")),"一度代理人结束语","一度代理人欢迎语","一度承诺标题","一度承诺描述","一度承诺按钮文案","一度行动承诺",1));
dialogues.add(new Dialogue(new ArrayList<>(Arrays.asList("二度问题1","二度问题2","二度问题3")),"二度代理人结束语","二度代理人欢迎语","二度承诺标题","二度承诺描述","二度承诺按钮文案","二度行动承诺",0));
......@@ -2508,8 +2508,8 @@ public class SaveLive implements Authorization {
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2, network.message(Params, BasicConfig.MANAGER_findDialogue, "客户承诺话术错误", response.body().asString()));
String promiseTitle1 = response.jsonPath().getString("data.get[0].promiseTitle");
String promiseTitle2 = response.jsonPath().getString("data.get[1].promiseTitle");
String promiseTitle1 = response.jsonPath().getString("data.find{it.inviteType == 1}.promiseTitle");
String promiseTitle2 = response.jsonPath().getString("data.find{it.inviteType == 0}.promiseTitle");
Assert.assertEquals(promiseTitle1,"一度承诺标题", network.message(Params, BasicConfig.MANAGER_findDialogue, "一度客户承诺话术错误", response.body().asString()));
Assert.assertEquals(promiseTitle2,"二度承诺标题", network.message(Params, BasicConfig.MANAGER_findDialogue, "二度客户承诺话术错误", response.body().asString()));
}
......
......@@ -373,6 +373,7 @@ public class Lottery implements Authorization {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",11);
Params.put("userType","A");
Response response = network.getResponse(Params, BasicConfig.MOBILE_helpInfo);
System.out.println( response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
......
......@@ -16,31 +16,20 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class RelativeLottery implements Authorization {
public List<ConfIdList> List_ConfId;
public String confId;
public String shareSign;
@BeforeClass
public void setUp(){
agentAuth();
visitorAuth9();
}
@Test(description = "代理人查询抽奖奖品列表", priority = 1)
public void 查询抽奖奖品列表() {
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response getLiveAwardListRes = network.getResponse(getLiveAwardListParam, USER_getLiveAwardList);
List<ConfIdList> list = JsonUtil.parseResponseToListBean(getLiveAwardListRes, ConfIdList.class);
System.out.println(list);
this.List_ConfId = list;
Assert.assertNotNull(list, network.message(getLiveAwardListParam, USER_getLiveAwardList, "抽奖标记为false", getLiveAwardListRes.body().asString()));
}
@Test(description = "查询亲友配置开启状态", priority = 2)
@Test(description = "查询亲友配置开启状态", priority = 1)
public void 查询亲友配置开启状态() {
visitorAuth9();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_allLottery);
......@@ -49,7 +38,7 @@ public class RelativeLottery implements Authorization {
Assert.assertEquals(fissionLotteryConfStatus, 1,network.message(getLiveAwardListParam, MOBILE_allLottery, "亲友配置券未开启", response.body().asString()));
}
@Test(description = "仅一度用户可以领取抽奖券", priority = 3)
@Test(description = "仅一度用户可以领取抽奖券", priority = 2)
public void 仅一度用户可以领取抽奖券() {
visitorAuth9();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
......@@ -64,8 +53,9 @@ public class RelativeLottery implements Authorization {
Assert.assertEquals(userAcceptStatus, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户已领取亲友券", response.body().asString()));
Assert.assertEquals(receiverInfoList, 0,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券已接受人数错误", response.body().asString()));
Assert.assertEquals(lotteryNum, 3,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券数量错误", response.body().asString()));
confId = response.jsonPath().getString("data.confDetail.id");
visitorAuth5();
visitorAuth22();
getLiveAwardListParam.clear();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
......@@ -75,7 +65,7 @@ public class RelativeLottery implements Authorization {
}
@Test(description = "访客H收下抽奖券", priority = 4)
@Test(description = "访客H收下抽奖券", priority = 3)
public void 访客H收下抽奖券() {
visitorAuth9();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -87,8 +77,7 @@ public class RelativeLottery implements Authorization {
@Test(description = "访客H_分享直播间", priority = 5)
public void 访客H_分享直播间() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 10);
......@@ -102,10 +91,9 @@ public class RelativeLottery implements Authorization {
@Test(description = "根据分享类型获取分享内容", priority = 6)
public void 根据分享类型获取分享内容() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType",10);
params.put("shareType",14);
params.put("userType","A");
Response response = network.getResponse(params, BasicConfig.MOBILE_helpInfo);
System.out.println(response.body().asString());
......@@ -115,14 +103,19 @@ public class RelativeLottery implements Authorization {
@Test(description = "访客H_获取小程序分享码", priority = 7)
public void 访客H_获取小程序分享码() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response signRes = network.getResponse(signParam, MOBILE_codeLottery);
System.out.println(signRes.body().asString());
String qrCodeUrl = signRes.jsonPath().getString("data.qrCodeUrl");
Assert.assertNotNull(qrCodeUrl, network.message(signParam, MOBILE_codeLottery, "分享失败", signRes.body().asString()));
Response response = network.postResponse(signParam, MOBILE_codeLottery);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertNotNull(data, network.message(signParam, MOBILE_codeLottery, "分享失败", response.body().asString()));
sleep(3000);
response = network.getResponse(signParam, MOBILE_codeDetailLottery);
System.out.println(response.body().asString());
boolean qrCodeUrl = response.jsonPath().getBoolean("data.qrCodeUrl");
Assert.assertNotNull(qrCodeUrl, network.message(signParam, MOBILE_codeDetailLottery, "分享失败", response.body().asString()));
}
@Test(description = "访客H获取直播所有的订阅消息模板", priority = 8)
......@@ -151,7 +144,7 @@ public class RelativeLottery implements Authorization {
@Test(description = "查询访客Xmz绑定结果和绑定凭证", priority = 10)
public void 查询访客Xmz绑定结果和绑定凭证() {
visitorAuth26();
ThreadSleepUtils.sleep(2000);
sleep(2000);
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);
......@@ -180,7 +173,7 @@ public class RelativeLottery implements Authorization {
@Test(description = "访客Xmz给访客H助力", priority = 12)
public void 访客Xmz给访客H助力() {
visitorAuth26();
ThreadSleepUtils.sleep(2000);
sleep(2000);
//获取授权配置助力弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -194,7 +187,7 @@ public class RelativeLottery implements Authorization {
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareSign",shareSign);
Params.put("shareType",14);
Params.put("confId",this.List_ConfId.get(0).getWelfareConfId());
Params.put("confId",confId);
response = network.postResponse(Params, BasicConfig.MOBILE_assist);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
......@@ -208,11 +201,9 @@ public class RelativeLottery implements Authorization {
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
System.out.println(response.body().asString());
int userStatus = response.jsonPath().getInt("data.userDetail.userStatus");
int receiverInfoList = response.jsonPath().getInt("data.userDetail.receiverInfoList.size()");
String receiverName = response.jsonPath().getString("data.userDetail.receiverInfoList.get(0).receiverName");
Assert.assertEquals(userStatus, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户没有亲友券领取资格", response.body().asString()));
String nickname = response.jsonPath().getString("data.userDetail.receiverInfoList.get(0).nickname");
Assert.assertEquals(receiverInfoList, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券已接受人数错误", response.body().asString()));
Assert.assertEquals(receiverName, "小米粥",network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券领取人错误", response.body().asString()));
Assert.assertEquals(nickname, "小米粥",network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券领取人错误", response.body().asString()));
}
}
......@@ -521,7 +521,7 @@ public class TimeRed implements Authorization {
System.out.println(data);
Integer state = response.jsonPath().getInt("data.state");
System.out.println(state);
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第4轮红包", response.body().asString()));
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第5轮红包", response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(3000);
......@@ -530,7 +530,7 @@ public class TimeRed implements Authorization {
System.out.println(data1);
Integer state1 = stateRes.jsonPath().getInt("data.state");
System.out.println(state1);
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第4轮红包", stateRes.body().asString()));
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第5轮红包", stateRes.body().asString()));
}
@Test(description = "下架第6轮红包任务对应的权益", priority = 23)
......@@ -561,14 +561,14 @@ public class TimeRed implements Authorization {
Response response = network.getResponse(Params, BasicConfig.ANCHOR_tasks);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客H未完成表单任务",response.body().asString()));
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客H未完成任务",response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(1000);
response = network.getResponse(Params, BasicConfig.ANCHOR_tasks);
data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客H未完成表单任务",response.body().asString()));
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客I未完成任务",response.body().asString()));
}
@Test(description = "开启第6轮红包", priority = 25)
......@@ -581,14 +581,14 @@ public class TimeRed implements Authorization {
Response response = network.postResponse(Params, BasicConfig.ANCHOR_redOpen);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客H开启第4轮红包失败", response.body().asString()));
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客H开启第6轮红包失败", response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(3000);
Response redRes = network.postResponse(Params, BasicConfig.ANCHOR_redOpen);
boolean data1 = redRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客I开启第4轮红包失败", redRes.body().asString()));
Assert.assertTrue(data1, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客I开启第6轮红包失败", redRes.body().asString()));
}
@Test(description = "查询开启第6轮红包结果", priority = 26)
......@@ -604,7 +604,7 @@ public class TimeRed implements Authorization {
System.out.println(data);
Integer state = response.jsonPath().getInt("data.state");
System.out.println(response.body().asString());
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第4轮红包", response.body().asString()));
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第6轮红包", response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(3000);
......@@ -613,7 +613,7 @@ public class TimeRed implements Authorization {
System.out.println(data1);
Integer state1 = stateRes.jsonPath().getInt("data.state");
System.out.println(state1);
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第4轮红包", stateRes.body().asString()));
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第6f d s s d f轮红包", stateRes.body().asString()));
}
//提现
......
......@@ -99,6 +99,7 @@ public class Treasure implements Authorization {
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareType",7);
infoParam.put("userType","A");
Response response = network.getResponse(infoParam, BasicConfig.MOBILE_helpInfo);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
......
......@@ -104,7 +104,6 @@ public class BasicConfig {
// *************** 准客户 ***************
public static final String ANCHOR_card = MOBILE_HOST + "/clue/agent/card";
public static final String ANCHOR_questions = MOBILE_HOST + "/kjy/live/agent/potential/questions";
public static final String ANCHOR_submit = MOBILE_HOST + "/kjy/live/agent/potential/submit";
public static final String ANCHOR_agree = MOBILE_HOST + "/kjy/live/agent/potential/agree";
public static final String ANCHOR_questionSubmitted = MOBILE_HOST + "/kjy/live/agent/potential/questionSubmitted";
......@@ -302,6 +301,9 @@ public class BasicConfig {
public static final String MOBILE_allLottery = MOBILE_HOST + "/kjy/live/info/pre/data";
public static final String MOBILE_confLottery = MOBILE_HOST +"/kjy/live/fission/lottery/conf/all";
public static final String MOBILE_codeLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/code";
public static final String MOBILE_drawCode = MOBILE_HOST +"/kjy/live/fission/lottery/user/drawCode";
public static final String MOBILE_codeDetailLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/code/detail";
public static final String MOBILE_drawDetailLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/drawCode/detail";
public static final String MOBILE_acceptLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/accept";
// *************** 时长宝箱 ***************
......
......@@ -91,7 +91,6 @@ public class NetworkUtils {
// post 带参请求
public Response postResponse(Map<String, Object> params, String path) {
String jsonStr = JSONObject.toJSONString(params);
System.out.println(jsonStr);
Response response = given()
.cookies(agentCookies)
.headers(agentHeaders)
......
......@@ -2,33 +2,33 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="直播" verbose="1" thread-count="3">
<!-- <test preserve-order="true" name="直播素材">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.LiveMaterial"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="团队管理">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.Team"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="精彩视频">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.Video"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="直播素材">
<classes>
<class name="com.kjj.cases.live.liveConfig.LiveMaterial"/>
</classes>
</test>
<test preserve-order="true" name="团队管理">
<classes>
<class name="com.kjj.cases.live.liveConfig.Team"/>
</classes>
</test>
<test preserve-order="true" name="精彩视频">
<classes>
<class name="com.kjj.cases.live.liveConfig.Video"/>
</classes>
</test>
<test preserve-order="true" name="创建直播">
<classes>
<class name="com.kjj.cases.live.liveConfig.SaveLive"/>
</classes>
</test>
<!-- <test preserve-order="true" name="成功案例">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.LiveCase"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="成功案例">
<classes>
<class name="com.kjj.cases.live.liveConfig.LiveCase"/>
</classes>
</test>
<test preserve-order="true" name="资料贴片">
<classes>
......
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