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
0e21d52c
Commit
0e21d52c
authored
Nov 30, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20211130-gxh' into 'master'
1.增加秒杀资格的0元支付下单流程。 See merge request test-group/kejiji!174
parents
9d6b2408
b18226ad
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
201 additions
and
83 deletions
+201
-83
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+6
-0
LiveLater.java
src/test/java/com/kjj/cases/live/agent/LiveLater.java
+0
-1
CloseLive.java
src/test/java/com/kjj/cases/live/anchor/CloseLive.java
+6
-5
OpenLive.java
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
+11
-16
LiveBinding.java
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
+4
-0
ConfSecondKill.java
...st/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
+1
-4
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+161
-42
GoldenEgg.java
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
+4
-15
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+8
-0
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
0e21d52c
...
...
@@ -241,4 +241,10 @@ public interface Authorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth27
);
}
//自动化假用户
// 用户ID:4054
default
void
visitorAuto1
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuto1
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuto1
);
}
}
src/test/java/com/kjj/cases/live/agent/LiveLater.java
View file @
0e21d52c
...
...
@@ -286,7 +286,6 @@ public class LiveLater implements Authorization {
Assert
.
assertEquals
(
evaLists
.
size
(),
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户参与测试数量错误"
,
response
.
body
().
asString
()));
String
evaTitle
=
(
String
)
evaLists
.
get
(
0
).
get
(
"resourceTitle"
);
Assert
.
assertEquals
(
evaTitle
,
"编辑后修改标题"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户参与测试标题错误"
,
response
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/live/anchor/CloseLive.java
View file @
0e21d52c
...
...
@@ -21,18 +21,19 @@ public class CloseLive implements Authorization {
adminAuth
();
}
@Test
(
description
=
"结束直播"
,
priority
=
1
)
public
void
closeLive
()
{
public
static
void
closeLive
(
String
liveId
)
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
())
);
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
()));
}
@Test
(
description
=
"结束直播"
,
priority
=
1
)
public
void
结束直播
()
{
closeLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
}
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
View file @
0e21d52c
...
...
@@ -10,6 +10,7 @@ import org.testng.annotations.Test;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
cases
.
live
.
anchor
.
CloseLive
.
closeLive
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
public
class
OpenLive
implements
Authorization
{
...
...
@@ -22,7 +23,7 @@ public class OpenLive implements Authorization {
@Test
(
description
=
"结束直直播中或断流中的场次"
,
priority
=
1
)
public
void
结束直直播中或断流中的场次
()
{
int
totalCount2
=
0
;
long
liveId
=
0L
;
String
liveId
=
null
;
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"companyId"
,
101
);
ConfDetailParam
.
put
(
"liveStatus"
,
3
);
...
...
@@ -40,21 +41,15 @@ public class OpenLive implements Authorization {
totalCount2
=
ConfDetailRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
if
(
totalCount2
==
1
)
{
System
.
out
.
println
(
"有一场直播正在直播中"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Lo
ng
(
"data.list.get(0).id"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Stri
ng
(
"data.list.get(0).id"
);
}
}
else
{
System
.
out
.
println
(
"有一场直播正在断流中"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Lo
ng
(
"data.list.get(0).id"
);
liveId
=
ConfDetailRes
.
jsonPath
().
get
Stri
ng
(
"data.list.get(0).id"
);
}
if
(
totalCount1
==
1
||
totalCount2
==
1
){
adminAuth
();
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
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
()));
closeLive
(
liveId
);
}
}
...
...
@@ -69,11 +64,9 @@ public class OpenLive implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
,
"获取直播配置详情失败"
,
ConfDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始直播"
,
priority
=
3
)
public
void
开启直播
()
{
public
static
void
openLive
(
String
liveId
)
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
())
);
openParam
.
put
(
"liveid"
,
liveId
);
openParam
.
put
(
"cid"
,
101
);
Response
openRes
=
network
.
postResponse
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
);
Object
data
=
openRes
.
jsonPath
().
getJsonObject
(
"data"
);
...
...
@@ -81,6 +74,8 @@ public class OpenLive implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
10000
);
}
@Test
(
description
=
"开始直播"
,
priority
=
3
)
public
void
开启直播
()
{
openLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
}
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
View file @
0e21d52c
...
...
@@ -145,6 +145,10 @@ public class LiveBinding implements Authorization {
binding
(
this
.
shareSign
);;
token
();
visitorAuto1
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客J_分享直播间"
,
priority
=
8
)
...
...
src/test/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
View file @
0e21d52c
...
...
@@ -65,7 +65,7 @@ public class ConfSecondKill implements Authorization {
@Test
(
description
=
"秒杀轮次上限限制"
,
priority
=
2
)
public
void
秒杀轮次上限限制
()
{
Map
<
String
,
Object
>
secKillAddPar
=
new
HashMap
<>();
secKillAddPar
.
put
(
"goodsId"
,
115
);
secKillAddPar
.
put
(
"goodsId"
,
secKillGoodsId
);
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
...
...
@@ -330,7 +330,6 @@ public class ConfSecondKill implements Authorization {
Map
<
String
,
Object
>
liveSecKillPar
=
new
HashMap
<>();
liveSecKillPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
liveSecKillRes
=
network
.
getResponse
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
);
System
.
out
.
println
(
liveSecKillRes
.
body
().
asString
());
List
<
AnchorGetSKList
>
secKillLists
;
try
{
secKillLists
=
JsonUtil
.
parseResponseToListBean
(
liveSecKillRes
,
AnchorGetSKList
.
class
);
...
...
@@ -345,7 +344,6 @@ public class ConfSecondKill implements Authorization {
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"未获取到数据"
,
liveSecKillRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"助播端编辑秒杀轮次"
,
priority
=
14
)
...
...
@@ -461,7 +459,6 @@ public class ConfSecondKill implements Authorization {
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
BasicConfig
.
ANCHOR_secondKillLists_goodsList
);
System
.
out
.
println
(
response
.
body
().
asString
());
try
{
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
int
isAppoint
=
response
.
jsonPath
().
getInt
(
"data.get(0).isAppoint"
);
...
...
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
0e21d52c
package
com
.
kjj
.
cases
.
live
.
secondKill
;
import
com.kjj.bean.agent.GrabWelfares
;
import
com.kjj.bean.secondKill.AnchorGetSKList
;
import
com.kjj.bean.secondKill.KillGoods
;
import
com.kjj.cases.admin.Authorization
;
...
...
@@ -24,6 +25,8 @@ public class SecondKill implements Authorization {
public
static
final
String
secKillGoodsIdEncode
=
IdMakeUtil
.
managerEncodingId
(
secKillGoodsId
);
public
String
shareSign
;
public
Object
timestamp
;
//领取秒杀资格的时间戳
public
String
orderId
;
//待退款的秒杀订单id
public
String
recordId
;
//待退款的秒杀记录id
@BeforeClass
public
void
setUp
(){
BaseUtils
.
ssoLogin
();
...
...
@@ -398,7 +401,6 @@ public class SecondKill implements Authorization {
@Test
(
description
=
"正常用户下单0元秒杀商品"
,
priority
=
21
)
public
void
正常用户下单
0
元秒杀商品
()
{
visitorAuth1
();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdThird
);
...
...
@@ -786,47 +788,6 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"用户成功支付"
,
priority
=
35
)
public
void
用户成功支付
()
{
visitorAuth1
();
// 新建订单
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
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
()));
}
Map
<
String
,
Object
>
orderResultPar
=
new
HashMap
<>();
orderResultPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderResultPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
Response
orderResultRes
=
null
;
Object
data
=
null
;
int
i
=
0
;
try
{
// 轮训下单接口
while
(
data
==
null
){
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
if
(
i
==
10
){
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"轮训下单结果超过10次"
,
orderResultRes
.
body
().
asString
()));
}
}
int
state
=
orderResultRes
.
jsonPath
().
getInt
(
"data.state"
);
Assert
.
assertEquals
(
state
,
3
,
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"下单未成功"
,
orderResultRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
orderResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"上架需要秒杀资格的商品"
,
priority
=
36
)
public
void
上架需要秒杀资格的商品
(){
adminAuth
();
...
...
@@ -926,4 +887,162 @@ public class SecondKill implements Authorization {
Assert
.
assertNotNull
(
cardConfigOne
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_getGoodsList
,
"配图1商品信息获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
cardConfigTwo
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_getGoodsList
,
"配图2商品信息获取失败"
,
response
.
body
().
asString
()));
}
//用于退款
@Test
(
description
=
"用户成功支付_秒杀资格"
,
priority
=
45
)
public
void
用户成功支付
_
秒杀资格
()
{
visitorAuth9
();
// 新建订单
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
QualifiedId
);
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
()));
}
Map
<
String
,
Object
>
orderResultPar
=
new
HashMap
<>();
orderResultPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderResultPar
.
put
(
"confId"
,
ConfSecondKill
.
QualifiedId
);
Response
orderResultRes
=
null
;
Object
data
=
null
;
int
i
=
0
;
try
{
// 轮训下单接口
while
(
data
==
null
){
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
if
(
i
==
10
){
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"轮训下单结果超过10次"
,
orderResultRes
.
body
().
asString
()));
}
}
int
state
=
orderResultRes
.
jsonPath
().
getInt
(
"data.state"
);
Assert
.
assertEquals
(
state
,
4
,
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"下单未成功"
,
orderResultRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
orderResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"管理后台查看秒杀资格商品进度"
,
priority
=
46
)
public
void
管理后台查看秒杀资格商品进度
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_goodsProgress
);
int
paidNum
=
response
.
jsonPath
().
getInt
(
"data.get(0).paidNum"
);
int
unpaidNum
=
response
.
jsonPath
().
getInt
(
"data.get(0).unpaidNum"
);
Assert
.
assertEquals
(
paidNum
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_goodsProgress
,
"已支付数据记录错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
unpaidNum
,
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_goodsProgress
,
"待支付数据记录错误"
,
response
.
body
().
asString
()));
}
//用于退款
@Test
(
description
=
"用户成功支付_待退款"
,
priority
=
47
)
public
void
用户成功支付
_
待退款
()
{
visitorAuto1
();
// 新建订单
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
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
()));
}
Map
<
String
,
Object
>
orderResultPar
=
new
HashMap
<>();
orderResultPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderResultPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
Response
orderResultRes
=
null
;
Object
data
=
null
;
int
i
=
0
;
try
{
// 轮训下单接口
while
(
data
==
null
){
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
if
(
i
==
10
){
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"轮训下单结果超过10次"
,
orderResultRes
.
body
().
asString
()));
}
}
int
state
=
orderResultRes
.
jsonPath
().
getInt
(
"data.state"
);
Assert
.
assertEquals
(
state
,
3
,
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"下单未成功"
,
orderResultRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
orderResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"管理后台查看用户秒杀订单"
,
priority
=
47
)
public
void
管理后台查看用户秒杀订单
(){
sleep
(
10000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"liveVisitorId"
,
81
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_order_detail
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_order_detail
,
"用户秒杀订单为空"
,
response
.
body
().
asString
()));
orderId
=
response
.
jsonPath
().
getString
(
"data.list.get(0).orderId"
);
}
@Test
(
description
=
"管理后台退款_用户秒杀订单"
,
priority
=
48
)
public
void
管理后台退款
_
用户秒杀订单
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveUserId"
,
81
);
params
.
put
(
"orderId"
,
orderId
);
params
.
put
(
"refundReason"
,
"自动化秒杀退款"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_order_refund
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_order_refund
,
"退款失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"用户查看秒杀列表"
,
priority
=
49
)
public
void
用户查看秒杀列表
(){
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_secondKill_getList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
int
refundStatus
=
response
.
jsonPath
().
getInt
(
"data.list.get(0).refundStatus"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_getList
,
"秒杀列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
refundStatus
,
5
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_order_detail
,
"用户秒杀订单退款状态错误"
,
response
.
body
().
asString
()));
recordId
=
response
.
jsonPath
().
getString
(
"data.list.get(0).recordId"
);
}
@Test
(
description
=
"用户查看退款详情"
,
priority
=
50
)
public
void
用户查看退款详情
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"recordId"
,
recordId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_secondKill_findDetailByRecordId
);
int
refundAmount
=
response
.
jsonPath
().
getInt
(
"data.refundDetail.refundAmount"
);
int
refundStatus
=
response
.
jsonPath
().
getInt
(
"data.refundDetail.refundStatus"
);
Assert
.
assertEquals
(
refundAmount
,
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_findDetailByRecordId
,
"退款金额错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
refundStatus
,
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_findDetailByRecordId
,
"用户秒杀订单退款状态错误"
,
response
.
body
().
asString
()));
}
//代理人查询客户退款详情
@Test
(
description
=
"查看客户A线索详情"
,
priority
=
51
)
public
void
查看客户
A
线索详情
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveUserId"
,
IdMakeUtil
.
encodingId
(
81L
));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_getClueDetail
);
int
refundStatus
=
response
.
jsonPath
().
getInt
(
"data.killGoods.get(0).refundStatus"
);
Assert
.
assertEquals
(
refundStatus
,
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"客户线索详情秒杀退款状态错误"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
View file @
0e21d52c
...
...
@@ -22,6 +22,8 @@ import java.util.HashMap;
import
java.util.List
;
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
.
ThreadSleepUtils
.
sleep
;
...
...
@@ -882,23 +884,10 @@ public class GoldenEgg implements Authorization {
@Test
(
description
=
"开始直播"
,
priority
=
53
)
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
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
);
openLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
@Test
(
description
=
"结束直播"
,
priority
=
54
)
public
void
结束直播
()
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
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
()));
closeLive
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
0e21d52c
...
...
@@ -69,6 +69,9 @@ public class BasicConfig {
//直播访客 (兑吧集团)ID:947
public
static
String
visitorAuth27
=
"LEH7epeHVDJWzhZ6DiexTHnfbvr9gocGu9ExJDb9xHoegrcNGiGyvUPrCXu5VECCsW6HDaVZMFu1Rph5WvdbB3jbkGcM9"
;
//自动化假用户 UserID:4055 ,liveUserID;81
public
static
String
visitorAuto1
=
"5MgSyboxqzAQZZJEsTf43nVX4vbZ5hG86sgJ5fSN7NzKxCH5WfE2XDHGMFm785nWo1pHKu5V5GPuQZHz3AfUEPenT5jh"
;
/**
* 集客助手授权key
*/
...
...
@@ -164,6 +167,11 @@ public class BasicConfig {
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
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_findDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/findDialogue"
;
...
...
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