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
739d3898
Commit
739d3898
authored
Sep 07, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加秒杀预告的接口用例
parent
a5d6daf8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1260 additions
and
1112 deletions
+1260
-1112
RelativeLottery.java
...test/java/com/kjj/cases/live/lottery/RelativeLottery.java
+4
-2
Preview.java
src/test/java/com/kjj/cases/live/preview/Preview.java
+0
-1
ConfSecondKill.java
...st/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
+143
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+1112
-1106
liveTestNG.xml
src/test/liveTestNG.xml
+1
-3
No files found.
src/test/java/com/kjj/cases/live/lottery/RelativeLottery.java
View file @
739d3898
...
...
@@ -34,8 +34,10 @@ public class RelativeLottery implements Authorization {
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
MOBILE_allLottery
);
System
.
out
.
println
(
response
.
body
().
asString
());
int
fissionLotteryConfStatus
=
response
.
jsonPath
().
getInt
(
"data.on"
);
Assert
.
assertEquals
(
fissionLotteryConfStatus
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_allLottery
,
"亲友配置券未开启"
,
response
.
body
().
asString
()));
int
on
=
response
.
jsonPath
().
getInt
(
"data.on"
);
String
confStr
=
Integer
.
toBinaryString
(
on
);
char
fissionLotteryConfStatus
=
confStr
.
charAt
(
confStr
.
length
()-
1
);
Assert
.
assertEquals
(
fissionLotteryConfStatus
,
'1'
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_allLottery
,
"亲友配置券未开启"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"仅一度用户可以领取抽奖券"
,
priority
=
2
)
...
...
src/test/java/com/kjj/cases/live/preview/Preview.java
View file @
739d3898
...
...
@@ -40,7 +40,6 @@ public class Preview implements Authorization{
visitorAuth22
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
"Kj21NDM3OTE"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
ANCHOR_watchVideo
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_watchVideo
,
"访客观看视频的抽奖码失败"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
View file @
739d3898
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
739d3898
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/test/liveTestNG.xml
View file @
739d3898
...
...
@@ -29,7 +29,7 @@
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"配置秒杀轮次"
>
<test
preserve-order=
"true"
name=
"配置秒杀轮次
及秒杀预告
"
>
<classes>
<class
name=
"com.kjj.cases.live.secondKill.ConfSecondKill"
/>
</classes>
...
...
@@ -82,7 +82,6 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"指定中奖"
>
<classes>
<class
name=
"com.kjj.cases.live.lottery.DesignatedWinner"
/>
...
...
@@ -94,7 +93,6 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播前-我的客户页"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.LiveBefore"
/>
...
...
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