Commit 8a6b9b9c authored by xiamengchen's avatar xiamengchen

秒杀互动

parent 9c826a5d
......@@ -205,38 +205,22 @@ public class SecondKill implements Authorization {
* 下单失败
*/
// 秒杀配置代理人不可参与
@Test(description = "代理人到场", priority = 10)
public void 代理人到场() {
// agentAuth();
Map<String, Object> connectSuccessPar = new HashMap<>();
connectSuccessPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response connectSuccessRes = network.getResponse(connectSuccessPar, BasicConfig.USER_connectSuccess);
@Test(description = "代理人下单", priority = 11)
public void 代理人下单() {
agentAuth();
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", confId1);
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = connectSuccessRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(connectSuccessPar, BasicConfig.USER_connectSuccess, "代理人到场失败", connectSuccessRes.body().asString()));
boolean data = orderRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder, "下单失败", orderRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(connectSuccessPar, BasicConfig.USER_connectSuccess, "数据获取失败", connectSuccessRes.body().asString()));
Assert.fail(network.message(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder, "未获取到数据", orderRes.body().asString()));
}
}
// @Test(description = "代理人下单", priority = 11)
// public void 代理人下单() {
//// agentAuth();
// ThreadSleepUtils.sleep(10000); // 进入直播间10s
// Map<String, Object> orderPar = new HashMap<>();
// orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// orderPar.put("confId", confId1);
// Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
// try {
// boolean data = orderRes.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder, "下单失败", orderRes.body().asString()));
// }catch (NullPointerException e){
// e.printStackTrace();
// Assert.fail(network.message(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder, "未获取到数据", orderRes.body().asString()));
// }
// }
@Test(description = "代理人获取下单结果", priority = 12)
public void 代理人获取下单结果() {
Map<String, Object> orderResultPar = new HashMap<>();
......@@ -265,7 +249,7 @@ public class SecondKill implements Authorization {
Assert.assertEquals(code, 1, network.message(orderResultPar, BasicConfig.MOBILE_secondKill_goodsOrderResult, "失败原因不是代理人限制", orderResultRes.body().asString()));
}
}else {
Assert.fail(network.message(orderResultPar, BasicConfig.MOBILE_secondKill_goodsOrderResult, "代理人未到下单限制", orderResultRes.body().asString()));
Assert.fail(network.message(orderResultPar, BasicConfig.MOBILE_secondKill_goodsOrderResult, "代理人未到下单限制", orderResultRes.body().asString()));
}
}catch (Exception e){
e.printStackTrace();
......
......@@ -2,27 +2,27 @@
<!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.LiveMaterial"/>
</classes>
</test>
<test preserve-order="true" name="配置秒杀商品">
<classes>
<class name="com.kjj.cases.live.secondKill.ManagerConfGoods"/>
</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.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.Video"/>
</classes>
</test>
<test preserve-order="true" name="创建直播">
<classes>
......@@ -35,73 +35,73 @@
</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>-->
<!-- <class name="com.kjj.cases.live.liveConfig.Paster"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="资料贴片">
<classes>
<class name="com.kjj.cases.live.liveConfig.Paster"/>
</classes>
</test>
<!-- <test preserve-order="true" name="代理人首页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Agent"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="代理人首页">
<classes>
<class name="com.kjj.cases.live.agent.Agent"/>
</classes>
</test>
<!-- <test preserve-order="true" name="小程序分享">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.Share"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="小程序分享">
<classes>
<class name="com.kjj.cases.live.liveConfig.Share"/>
</classes>
</test>
<!-- <test preserve-order="true" name="获取抽奖码校验">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lotteryCode.LotteryCode"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="获取抽奖码校验">
<classes>
<class name="com.kjj.cases.live.lotteryCode.LotteryCode"/>
</classes>
</test>
<!-- <test preserve-order="false" name="预告页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.preview.Preview"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="false" name="预告页">
<classes>
<class name="com.kjj.cases.live.preview.Preview"/>
</classes>
</test>
<!-- <test preserve-order="true" name="亲友券">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lottery.RelativeLottery"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="false" name="翻牌集字红包">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.flipCard.FlipCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="亲友券">
<classes>
<class name="com.kjj.cases.live.lottery.RelativeLottery"/>
</classes>
</test>
<test preserve-order="false" name="翻牌集字红包">
<classes>
<class name="com.kjj.cases.live.flipCard.FlipCard"/>
</classes>
</test>
<!-- <test preserve-order="true" name="中奖规则配置">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.WinningRules"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="中奖规则配置">
<classes>
<class name="com.kjj.cases.live.liveConfig.WinningRules"/>
</classes>
</test>
<!-- <test preserve-order="true" name="指定中奖">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lottery.DesignatedWinner"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="指定中奖">
<classes>
<class name="com.kjj.cases.live.lottery.DesignatedWinner"/>
</classes>
</test>
<!-- <test preserve-order="true" name="直播前-我的客户页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveBefore"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="直播前-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveBefore"/>
</classes>
</test>
<test preserve-order="true" name="助播-开启直播">
......@@ -110,17 +110,17 @@
</classes>
</test>
<!-- <test preserve-order="true" name="访客签到">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lotteryCode.SignIn"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="访客签到">
<classes>
<class name="com.kjj.cases.live.lotteryCode.SignIn"/>
</classes>
</test>
<!-- <test preserve-order="true" name="宝箱裂变">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.treasure.Treasure"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="宝箱裂变">
<classes>
<class name="com.kjj.cases.live.treasure.Treasure"/>
</classes>
</test>
<test preserve-order="true" name="直播中抽奖">
<classes>
......@@ -204,11 +204,11 @@
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="助播-结束直播">
<classes>
<class name="com.kjj.cases.live.anchor.CloseLive"/>
</classes>
</test>
<!-- <test preserve-order="true" name="助播-结束直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.CloseLive"/>-->
<!-- </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