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
0feab100
Commit
0feab100
authored
Oct 11, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化输出信息
parent
57234657
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
Pay.java
src/test/java/com/kjj/cases/assistant/pay/Pay.java
+1
-1
OpenLive.java
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
+1
-0
Answer.java
src/test/java/com/kjj/cases/live/answer/Answer.java
+6
-8
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+14
-7
No files found.
src/test/java/com/kjj/cases/assistant/pay/Pay.java
View file @
0feab100
...
...
@@ -253,5 +253,5 @@ public class Pay implements Authorization {
}
}
}
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
View file @
0feab100
...
...
@@ -61,6 +61,7 @@ public class OpenLive implements Authorization {
@Test
(
description
=
"获取直播配置详情"
,
priority
=
2
)
public
void
获取直播配置详情
()
{
adminAuth
();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
);
...
...
src/test/java/com/kjj/cases/live/answer/Answer.java
View file @
0feab100
...
...
@@ -256,8 +256,8 @@ public class Answer implements Authorization {
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
params
.
put
(
"optionId"
,
this
.
wronganswer
.
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
System
.
out
.
println
(
openResult
);
Assert
.
assertTrue
(
openResult
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"用户参与失败"
,
response
.
body
().
asString
()));
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
...
...
@@ -300,7 +300,7 @@ public class Answer implements Authorization {
System
.
out
.
println
(
" 查询用户A领取答题红包结果 timestamp:"
+
new
Date
().
getTime
()+
"quesConfId:"
+
quesConfId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
res
ult
);
System
.
out
.
println
(
res
ponse
.
body
().
asString
()
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
Integer
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
...
...
@@ -479,16 +479,14 @@ public class Answer implements Authorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
()
);
// params.put("liveId", "Kj21NTI3ODM");
// params.put("quesConfId","Kj21NzY1MTE");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
res
ult
);
System
.
out
.
println
(
res
ponse
.
body
().
asString
()
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"答题失败"
,
response
.
body
().
asString
()));
Object
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
System
.
out
.
println
(
amount
);
Assert
.
assertNull
(
amount
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"领取失败"
,
response
.
body
().
asString
()));
Assert
.
assertNull
(
amount
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"答题失败"
,
response
.
body
().
asString
()));
}
//*****************有奖答题福利类型*****************//
...
...
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
0feab100
...
...
@@ -19,6 +19,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
public
class
SecondKill
implements
Authorization
{
@BeforeClass
...
...
@@ -145,6 +147,7 @@ public class SecondKill implements Authorization {
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
goodsOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
Response
goodsOnRes
=
network
.
postResponse
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
);
System
.
out
.
println
(
goodsOnRes
.
body
().
asString
());
try
{
boolean
data
=
goodsOnRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"上架秒杀失败"
,
goodsOnRes
.
body
().
asString
()));
...
...
@@ -186,6 +189,7 @@ public class SecondKill implements Authorization {
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
goodsOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdThird
);
Response
goodsOnRes
=
network
.
postResponse
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
);
System
.
out
.
println
(
goodsOnRes
.
body
().
asString
());
try
{
boolean
data
=
goodsOnRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"上架0元商品秒杀失败"
,
goodsOnRes
.
body
().
asString
()));
...
...
@@ -199,6 +203,7 @@ public class SecondKill implements Authorization {
@Test
(
description
=
"查看当前秒杀商品"
,
priority
=
11
)
public
void
查看当前秒杀商品
()
{
visitorAuth
();
sleep
(
3000
);
Map
<
String
,
Object
>
goodsFirstPar
=
new
HashMap
<>();
goodsFirstPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
goodsFirstRes
=
network
.
getResponse
(
goodsFirstPar
,
BasicConfig
.
MOBILE_secondKill_goodsFirst
);
...
...
@@ -217,6 +222,7 @@ public class SecondKill implements Authorization {
Map
<
String
,
Object
>
downgradeGoodsPar
=
new
HashMap
<>();
downgradeGoodsPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
downgradeGoodsRes
=
network
.
getResponse
(
downgradeGoodsPar
,
BasicConfig
.
MOBILE_secondKill_downgradeGoodsFirst
);
System
.
out
.
println
(
downgradeGoodsRes
.
body
().
asString
());
try
{
String
confId
=
downgradeGoodsRes
.
jsonPath
().
getString
(
"data.confId"
);
//校验最新上架的商品
...
...
@@ -258,7 +264,7 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
...
...
@@ -311,7 +317,7 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
...
...
@@ -366,7 +372,7 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
...
...
@@ -410,8 +416,9 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
System
.
out
.
println
(
orderResultRes
.
body
().
asString
());
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
if
(
i
==
10
){
...
...
@@ -577,7 +584,7 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
...
...
@@ -619,7 +626,7 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
...
...
@@ -688,7 +695,7 @@ public class SecondKill implements Authorization {
try
{
// 轮训下单接口
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
...
...
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