Commit b18226ad authored by 龚小红's avatar 龚小红

1.增加秒杀资格的0元支付下单流程。

2.增加秒杀退款。
parent 9d6b2408
...@@ -241,4 +241,10 @@ public interface Authorization { ...@@ -241,4 +241,10 @@ public interface Authorization {
System.out.println("用户AUTH_KEY:" + visitorAuth27); System.out.println("用户AUTH_KEY:" + visitorAuth27);
} }
//自动化假用户
// 用户ID:4054
default void visitorAuto1() {
network.agentCookies.put("authKey", visitorAuto1);
System.out.println("用户AUTH_KEY:" + visitorAuto1);
}
} }
...@@ -286,7 +286,6 @@ public class LiveLater implements Authorization { ...@@ -286,7 +286,6 @@ public class LiveLater implements Authorization {
Assert.assertEquals(evaLists.size(), 1, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户参与测试数量错误", response.body().asString())); Assert.assertEquals(evaLists.size(), 1, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户参与测试数量错误", response.body().asString()));
String evaTitle = (String) evaLists.get(0).get("resourceTitle"); String evaTitle = (String) evaLists.get(0).get("resourceTitle");
Assert.assertEquals(evaTitle, "编辑后修改标题", network.message(params, BasicConfig.MOBILE_getClueDetail, "用户参与测试标题错误", response.body().asString())); Assert.assertEquals(evaTitle, "编辑后修改标题", network.message(params, BasicConfig.MOBILE_getClueDetail, "用户参与测试标题错误", response.body().asString()));
} }
......
...@@ -21,18 +21,19 @@ public class CloseLive implements Authorization { ...@@ -21,18 +21,19 @@ public class CloseLive implements Authorization {
adminAuth(); adminAuth();
} }
public static void closeLive(String liveId) {
@Test(description = "结束直播", priority = 1)
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>(); Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey())); closeParam.put("liveid", liveId);
closeParam.put("cid", 101); closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE); Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data"); Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data); System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString())); Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
}
@Test(description = "结束直播", priority = 1)
public void 结束直播() {
closeLive(LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
} }
} }
...@@ -10,6 +10,7 @@ import org.testng.annotations.Test; ...@@ -10,6 +10,7 @@ import org.testng.annotations.Test;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static com.kjj.cases.live.anchor.CloseLive.closeLive;
import static com.kjj.utils.BaseUtils.ssoLogin; import static com.kjj.utils.BaseUtils.ssoLogin;
public class OpenLive implements Authorization { public class OpenLive implements Authorization {
...@@ -22,7 +23,7 @@ public class OpenLive implements Authorization { ...@@ -22,7 +23,7 @@ public class OpenLive implements Authorization {
@Test(description = "结束直直播中或断流中的场次", priority = 1) @Test(description = "结束直直播中或断流中的场次", priority = 1)
public void 结束直直播中或断流中的场次() { public void 结束直直播中或断流中的场次() {
int totalCount2 = 0; int totalCount2 = 0;
long liveId = 0L; String liveId = null;
Map<String, Object> ConfDetailParam = new HashMap<>(); Map<String, Object> ConfDetailParam = new HashMap<>();
ConfDetailParam.put("companyId", 101); ConfDetailParam.put("companyId", 101);
ConfDetailParam.put("liveStatus", 3); ConfDetailParam.put("liveStatus", 3);
...@@ -40,21 +41,15 @@ public class OpenLive implements Authorization { ...@@ -40,21 +41,15 @@ public class OpenLive implements Authorization {
totalCount2 = ConfDetailRes.jsonPath().getInt("data.totalCount"); totalCount2 = ConfDetailRes.jsonPath().getInt("data.totalCount");
if (totalCount2 == 1) { if (totalCount2 == 1) {
System.out.println("有一场直播正在直播中"); System.out.println("有一场直播正在直播中");
liveId = ConfDetailRes.jsonPath().getLong("data.list.get(0).id"); liveId = ConfDetailRes.jsonPath().getString("data.list.get(0).id");
} }
}else{ }else{
System.out.println("有一场直播正在断流中"); System.out.println("有一场直播正在断流中");
liveId = ConfDetailRes.jsonPath().getLong("data.list.get(0).id"); liveId = ConfDetailRes.jsonPath().getString("data.list.get(0).id");
} }
if(totalCount1 == 1 || totalCount2 == 1){ if(totalCount1 == 1 || totalCount2 == 1){
adminAuth(); adminAuth();
Map<String, Object> closeParam = new HashMap<>(); closeLive(liveId);
closeParam.put("liveid", liveId);
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
} }
} }
...@@ -69,11 +64,9 @@ public class OpenLive implements Authorization { ...@@ -69,11 +64,9 @@ public class OpenLive implements Authorization {
Assert.assertNotNull(data, network.message(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail, "获取直播配置详情失败", ConfDetailRes.body().asString())); Assert.assertNotNull(data, network.message(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail, "获取直播配置详情失败", ConfDetailRes.body().asString()));
} }
public static void openLive(String liveId) {
@Test(description = "开始直播", priority = 3)
public void 开启直播() {
Map<String, Object> openParam = new HashMap<>(); Map<String, Object> openParam = new HashMap<>();
openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey())); openParam.put("liveid", liveId);
openParam.put("cid", 101); openParam.put("cid", 101);
Response openRes = network.postResponse(openParam, BasicConfig.ANCHOR_OPEN); Response openRes = network.postResponse(openParam, BasicConfig.ANCHOR_OPEN);
Object data = openRes.jsonPath().getJsonObject("data"); Object data = openRes.jsonPath().getJsonObject("data");
...@@ -81,6 +74,8 @@ public class OpenLive implements Authorization { ...@@ -81,6 +74,8 @@ public class OpenLive implements Authorization {
Assert.assertNotNull(data, network.message(openParam, BasicConfig.ANCHOR_OPEN, "开启直播失败", openRes.body().asString())); Assert.assertNotNull(data, network.message(openParam, BasicConfig.ANCHOR_OPEN, "开启直播失败", openRes.body().asString()));
ThreadSleepUtils.sleep(10000); ThreadSleepUtils.sleep(10000);
} }
@Test(description = "开始直播", priority = 3)
public void 开启直播() {
openLive(LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
}
} }
...@@ -145,6 +145,10 @@ public class LiveBinding implements Authorization { ...@@ -145,6 +145,10 @@ public class LiveBinding implements Authorization {
binding(this.shareSign);; binding(this.shareSign);;
token(); token();
visitorAuto1();
binding(this.shareSign);;
token();
} }
@Test(description = "访客J_分享直播间", priority = 8) @Test(description = "访客J_分享直播间", priority = 8)
......
...@@ -65,7 +65,7 @@ public class ConfSecondKill implements Authorization { ...@@ -65,7 +65,7 @@ public class ConfSecondKill implements Authorization {
@Test(description = "秒杀轮次上限限制", priority = 2) @Test(description = "秒杀轮次上限限制", priority = 2)
public void 秒杀轮次上限限制() { public void 秒杀轮次上限限制() {
Map<String, Object> secKillAddPar = new HashMap<>(); Map<String, Object> secKillAddPar = new HashMap<>();
secKillAddPar.put("goodsId", 115); secKillAddPar.put("goodsId", secKillGoodsId);
secKillAddPar.put("goodsAmount", 1); // 1 == 0.01 secKillAddPar.put("goodsAmount", 1); // 1 == 0.01
secKillAddPar.put("interactNum", 3); secKillAddPar.put("interactNum", 3);
secKillAddPar.put("ableAgent", 0); secKillAddPar.put("ableAgent", 0);
...@@ -330,7 +330,6 @@ public class ConfSecondKill implements Authorization { ...@@ -330,7 +330,6 @@ public class ConfSecondKill implements Authorization {
Map<String, Object> liveSecKillPar = new HashMap<>(); Map<String, Object> liveSecKillPar = new HashMap<>();
liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response liveSecKillRes = network.getResponse(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists); Response liveSecKillRes = network.getResponse(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists);
System.out.println(liveSecKillRes.body().asString());
List<AnchorGetSKList> secKillLists; List<AnchorGetSKList> secKillLists;
try { try {
secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class); secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class);
...@@ -345,7 +344,6 @@ public class ConfSecondKill implements Authorization { ...@@ -345,7 +344,6 @@ public class ConfSecondKill implements Authorization {
e.printStackTrace(); e.printStackTrace();
Assert.fail(network.message(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists, "未获取到数据", liveSecKillRes.body().asString())); Assert.fail(network.message(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists, "未获取到数据", liveSecKillRes.body().asString()));
} }
} }
@Test(description = "助播端编辑秒杀轮次", priority = 14) @Test(description = "助播端编辑秒杀轮次", priority = 14)
...@@ -461,7 +459,6 @@ public class ConfSecondKill implements Authorization { ...@@ -461,7 +459,6 @@ public class ConfSecondKill implements Authorization {
Map<String, Object> getLiveAwardListParam = new HashMap<>(); Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, BasicConfig.ANCHOR_secondKillLists_goodsList); Response response = network.getResponse(getLiveAwardListParam, BasicConfig.ANCHOR_secondKillLists_goodsList);
System.out.println(response.body().asString());
try{ try{
int size = response.jsonPath().getInt("data.size()"); int size = response.jsonPath().getInt("data.size()");
int isAppoint = response.jsonPath().getInt("data.get(0).isAppoint"); int isAppoint = response.jsonPath().getInt("data.get(0).isAppoint");
......
...@@ -22,6 +22,8 @@ import java.util.HashMap; ...@@ -22,6 +22,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.kjj.cases.live.anchor.CloseLive.closeLive;
import static com.kjj.cases.live.anchor.OpenLive.openLive;
import static com.kjj.utils.BaseUtils.ssoLogin; import static com.kjj.utils.BaseUtils.ssoLogin;
import static com.kjj.utils.ThreadSleepUtils.sleep; import static com.kjj.utils.ThreadSleepUtils.sleep;
...@@ -882,23 +884,10 @@ public class GoldenEgg implements Authorization { ...@@ -882,23 +884,10 @@ public class GoldenEgg implements Authorization {
@Test(description = "开始直播", priority = 53) @Test(description = "开始直播", priority = 53)
public void 开启直播() { public void 开启直播() {
Map<String, Object> openParam = new HashMap<>(); openLive(LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
openParam.put("cid", 101);
Response openRes = network.postResponse(openParam, BasicConfig.ANCHOR_OPEN);
Object data = openRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(openParam, BasicConfig.ANCHOR_OPEN, "开启直播失败", openRes.body().asString()));
ThreadSleepUtils.sleep(10000);
} }
@Test(description = "结束直播", priority = 54) @Test(description = "结束直播", priority = 54)
public void 结束直播() { public void 结束直播() {
Map<String, Object> closeParam = new HashMap<>(); closeLive(LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
} }
} }
...@@ -69,6 +69,9 @@ public class BasicConfig { ...@@ -69,6 +69,9 @@ public class BasicConfig {
//直播访客 (兑吧集团)ID:947 //直播访客 (兑吧集团)ID:947
public static String visitorAuth27 ="LEH7epeHVDJWzhZ6DiexTHnfbvr9gocGu9ExJDb9xHoegrcNGiGyvUPrCXu5VECCsW6HDaVZMFu1Rph5WvdbB3jbkGcM9"; public static String visitorAuth27 ="LEH7epeHVDJWzhZ6DiexTHnfbvr9gocGu9ExJDb9xHoegrcNGiGyvUPrCXu5VECCsW6HDaVZMFu1Rph5WvdbB3jbkGcM9";
//自动化假用户 UserID:4055 ,liveUserID;81
public static String visitorAuto1 ="5MgSyboxqzAQZZJEsTf43nVX4vbZ5hG86sgJ5fSN7NzKxCH5WfE2XDHGMFm785nWo1pHKu5V5GPuQZHz3AfUEPenT5jh";
/** /**
* 集客助手授权key * 集客助手授权key
*/ */
...@@ -164,6 +167,11 @@ public class BasicConfig { ...@@ -164,6 +167,11 @@ public class BasicConfig {
public static final String MOBILE_receiveStatus = MOBILE_HOST + "/clue/goods/receive/status"; public static final String MOBILE_receiveStatus = MOBILE_HOST + "/clue/goods/receive/status";
public static final String MANAGER_goodsProgress = MANAGER_HOST + "/kjy/manager/live/second/kill/goods/progress"; public static final String MANAGER_goodsProgress = MANAGER_HOST + "/kjy/manager/live/second/kill/goods/progress";
public static final String MOBILE_goodsProgress = MOBILE_HOST + "/clue/goods/progress"; public static final String MOBILE_goodsProgress = MOBILE_HOST + "/clue/goods/progress";
public static final String MANAGER_order_detail= MANAGER_HOST + "/kjy/manager/live/second/kill/order/detail";
public static final String MANAGER_order_refund= MANAGER_HOST + "/kjy/manager/live/second/kill/order/refund";
public static final String MOBILE_secondKill_getList= MOBILE_HOST + "/kjy/live/user/goods/getList";
public static final String MOBILE_secondKill_findDetailByRecordId= MOBILE_HOST + "/kjy/live/user/goods/findDetailByRecordId";
//客户承诺话术配置 //客户承诺话术配置
public static final String MANAGER_saveDialogue = MANAGER_HOST + "/kjy/manager/live/potential/saveDialogue"; public static final String MANAGER_saveDialogue = MANAGER_HOST + "/kjy/manager/live/potential/saveDialogue";
public static final String MANAGER_findDialogue = MANAGER_HOST + "/kjy/manager/live/potential/findDialogue"; public static final String MANAGER_findDialogue = MANAGER_HOST + "/kjy/manager/live/potential/findDialogue";
......
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