Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
龚小红
oto
Commits
8a6b9b9c
Commit
8a6b9b9c
authored
Aug 31, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
秒杀互动
parent
9c826a5d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
112 deletions
+96
-112
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+11
-27
liveTestNG.xml
src/test/liveTestNG.xml
+85
-85
No files found.
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
8a6b9b9c
...
...
@@ -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
=
connectSuccess
Res
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
connectSuccessPar
,
BasicConfig
.
USER_connectSuccess
,
"代理人到场失败"
,
connectSuccess
Res
.
body
().
asString
()));
boolean
data
=
order
Res
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
orderPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrder
,
"下单失败"
,
order
Res
.
body
().
asString
()));
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
connectSuccessPar
,
BasicConfig
.
USER_connectSuccess
,
"数据获取失败"
,
connectSuccess
Res
.
body
().
asString
()));
Assert
.
fail
(
network
.
message
(
orderPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrder
,
"未获取到数据"
,
order
Res
.
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
();
...
...
src/test/liveTestNG.xml
View file @
8a6b9b9c
...
...
@@ -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>-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment