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
c8539426
Commit
c8539426
authored
Oct 20, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/20211020-xmc
parents
c6329439
5c13533a
Changes
38
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1126 additions
and
1629 deletions
+1126
-1629
AgentBean.java
src/test/java/com/kjj/bean/agent/AgentBean.java
+2
-0
Dialogue.java
src/test/java/com/kjj/bean/issue/Dialogue.java
+1
-5
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+1
-1
HomePage.java
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
+5
-4
GameLottery.java
...java/com/kjj/cases/assistant/markettools/GameLottery.java
+5
-5
Pay.java
src/test/java/com/kjj/cases/assistant/pay/Pay.java
+1
-1
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+0
-56
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+1
-3
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+2
-2
Agent.java
src/test/java/com/kjj/cases/live/agent/Agent.java
+10
-5
Customer.java
src/test/java/com/kjj/cases/live/agent/Customer.java
+42
-18
LiveLater.java
src/test/java/com/kjj/cases/live/agent/LiveLater.java
+40
-1
Potential.java
src/test/java/com/kjj/cases/live/agent/Potential.java
+1
-1
LiveVisitors.java
src/test/java/com/kjj/cases/live/anchor/LiveVisitors.java
+13
-16
OpenLive.java
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
+7
-5
Answer.java
src/test/java/com/kjj/cases/live/answer/Answer.java
+4
-8
Choice.java
src/test/java/com/kjj/cases/live/choice/Choice.java
+3
-3
AfterLive.java
src/test/java/com/kjj/cases/live/customer/AfterLive.java
+1
-2
PersonalPage.java
src/test/java/com/kjj/cases/live/customer/PersonalPage.java
+2
-1
FlipCard.java
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
+292
-280
LiveGuess.java
src/test/java/com/kjj/cases/live/guess/LiveGuess.java
+0
-1
Comment.java
src/test/java/com/kjj/cases/live/liveConfig/Comment.java
+3
-4
LiveBinding.java
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
+233
-0
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+2
-2
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+86
-409
RelativeLottery.java
...test/java/com/kjj/cases/live/lottery/RelativeLottery.java
+34
-40
LotteryCode.java
...test/java/com/kjj/cases/live/lotteryCode/LotteryCode.java
+17
-158
SignIn.java
src/test/java/com/kjj/cases/live/lotteryCode/SignIn.java
+2
-2
Question.java
src/test/java/com/kjj/cases/live/question/Question.java
+3
-6
ConfSecondKill.java
...st/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
+7
-0
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+125
-32
GoldenEgg.java
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
+117
-309
TimeRed.java
src/test/java/com/kjj/cases/live/treasure/TimeRed.java
+0
-4
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+0
-238
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+9
-1
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+38
-0
NetworkUtils.java
src/test/java/com/kjj/utils/NetworkUtils.java
+5
-0
liveTestNG.xml
src/test/liveTestNG.xml
+12
-6
No files found.
src/test/java/com/kjj/bean/agent/AgentBean.java
View file @
c8539426
...
@@ -21,4 +21,6 @@ public class AgentBean {
...
@@ -21,4 +21,6 @@ public class AgentBean {
private
String
companyLogo
;
private
String
companyLogo
;
private
Long
appointmentNum
;
private
Long
appointmentNum
;
private
int
inviteAuthStatus
;
private
int
inviteAuthStatus
;
private
int
agentAwardOpenFlag
;
// 是否开启代理人邀约奖励
private
int
agentNeedInviteNum
;
// 还需邀请多少人才能开启红包
}
}
src/test/java/com/kjj/bean/issue/Dialogue.java
View file @
c8539426
...
@@ -10,19 +10,15 @@ public class Dialogue {
...
@@ -10,19 +10,15 @@ public class Dialogue {
private
String
agentConclusion
;
private
String
agentConclusion
;
private
String
agentGreet
;
private
String
agentGreet
;
private
String
promiseTitle
;
private
String
promiseTitle
;
private
String
promiseDesc
;
private
String
promiseButton
;
private
String
promiseButton
;
private
String
customerActionPromise
;
private
int
inviteType
;
private
int
inviteType
;
public
Dialogue
(
ArrayList
<
String
>
quesList
,
String
agentConclusion
,
String
agentGreet
,
String
promiseTitle
,
String
promise
Desc
,
String
promiseButton
,
String
customerActionPromise
,
int
inviteType
)
{
public
Dialogue
(
ArrayList
<
String
>
quesList
,
String
agentConclusion
,
String
agentGreet
,
String
promiseTitle
,
String
promise
Button
,
int
inviteType
)
{
this
.
quesList
=
quesList
;
this
.
quesList
=
quesList
;
this
.
agentConclusion
=
agentConclusion
;
this
.
agentConclusion
=
agentConclusion
;
this
.
agentGreet
=
agentGreet
;
this
.
agentGreet
=
agentGreet
;
this
.
promiseTitle
=
promiseTitle
;
this
.
promiseTitle
=
promiseTitle
;
this
.
promiseDesc
=
promiseDesc
;
this
.
promiseButton
=
promiseButton
;
this
.
promiseButton
=
promiseButton
;
this
.
customerActionPromise
=
customerActionPromise
;
this
.
inviteType
=
inviteType
;
this
.
inviteType
=
inviteType
;
}
}
}
}
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
c8539426
...
@@ -81,7 +81,7 @@ public interface Authorization {
...
@@ -81,7 +81,7 @@ public interface Authorization {
}
}
//访客A(志勇)授权,代理人指定中奖用户,ID:107
//访客A(志勇)授权,代理人指定中奖用户,ID:107
default
void
visitorAuth
()
{
default
void
visitorAuth
1
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth
);
}
}
...
...
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
c8539426
...
@@ -38,6 +38,7 @@ public class HomePage implements Authorization {
...
@@ -38,6 +38,7 @@ public class HomePage implements Authorization {
public
String
visitId
;
//用户的visitId
public
String
visitId
;
//用户的visitId
public
String
activityScid
;
//测评对应的scid
public
String
activityScid
;
//测评对应的scid
public
long
articleId
;
//解密后的的文章id
public
long
articleId
;
//解密后的的文章id
public
int
totalCount
;
//视频数量
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
...
@@ -289,8 +290,8 @@ public class HomePage implements Authorization {
...
@@ -289,8 +290,8 @@ public class HomePage implements Authorization {
params
.
put
(
"secondTagId"
,
724
);
//二级标签
params
.
put
(
"secondTagId"
,
724
);
//二级标签
params
.
put
(
"contentType"
,
"video"
);
params
.
put
(
"contentType"
,
"video"
);
Response
response
=
network
.
getResponse
(
params
,
HOME_getContentList
);
Response
response
=
network
.
getResponse
(
params
,
HOME_getContentList
);
Object
obj
=
response
.
jsonPath
().
getJsonObjec
t
(
"data.totalCount"
);
totalCount
=
response
.
jsonPath
().
getIn
t
(
"data.totalCount"
);
Assert
.
assert
Equals
(
obj
,
3
,
network
.
message
(
params
,
HOME_getContentList
,
"获取首页视频列表失败"
,
response
.
body
().
asString
()));
Assert
.
assert
True
(
totalCount
>
0
,
network
.
message
(
params
,
HOME_getContentList
,
"获取首页视频列表失败"
,
response
.
body
().
asString
()));
}
}
//验证视频是否下架成功
//验证视频是否下架成功
...
@@ -313,8 +314,8 @@ public class HomePage implements Authorization {
...
@@ -313,8 +314,8 @@ public class HomePage implements Authorization {
params
.
put
(
"secondTagId"
,
724
);
params
.
put
(
"secondTagId"
,
724
);
params
.
put
(
"contentType"
,
"video"
);
params
.
put
(
"contentType"
,
"video"
);
Response
response
=
network
.
getResponse
(
params
,
HOME_getContentList
);
Response
response
=
network
.
getResponse
(
params
,
HOME_getContentList
);
Object
obj
=
response
.
jsonPath
().
getJsonObjec
t
(
"data.totalCount"
);
int
obj
=
response
.
jsonPath
().
getIn
t
(
"data.totalCount"
);
Assert
.
assertEquals
(
obj
,
2
,
network
.
message
(
params
,
HOME_getContentList
,
"获取首页视频列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
obj
,
totalCount
-
1
,
network
.
message
(
params
,
HOME_getContentList
,
"获取首页视频列表失败"
,
response
.
body
().
asString
()));
}
}
//管理后台新增公司专区内容
//管理后台新增公司专区内容
...
...
src/test/java/com/kjj/cases/assistant/markettools/GameLottery.java
View file @
c8539426
...
@@ -150,7 +150,7 @@ public class GameLottery implements Authorization {
...
@@ -150,7 +150,7 @@ public class GameLottery implements Authorization {
//获取客户列表
//获取客户列表
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
2
0
);
params
.
put
(
"pageSize"
,
5
0
);
params
.
put
(
"visitorNickname"
,
""
);
params
.
put
(
"visitorNickname"
,
""
);
Response
response
=
network
.
getResponse
(
params
,
LOTTERRY_customerList
);
Response
response
=
network
.
getResponse
(
params
,
LOTTERRY_customerList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
...
@@ -298,7 +298,7 @@ public class GameLottery implements Authorization {
...
@@ -298,7 +298,7 @@ public class GameLottery implements Authorization {
@Test
(
description
=
"访客_打开抽奖链接"
,
priority
=
13
)
@Test
(
description
=
"访客_打开抽奖链接"
,
priority
=
13
)
public
void
访客
_
打开抽奖链接
(){
public
void
访客
_
打开抽奖链接
(){
//切换为访客-请勿打扰
//切换为访客-请勿打扰
//
userTku1();
userTku1
();
//添加访问记录
//添加访问记录
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
@@ -362,7 +362,7 @@ public class GameLottery implements Authorization {
...
@@ -362,7 +362,7 @@ public class GameLottery implements Authorization {
int
state
=
response
.
jsonPath
().
getInt
(
"data.state"
);
int
state
=
response
.
jsonPath
().
getInt
(
"data.state"
);
int
prizeType
=
response
.
jsonPath
().
getInt
(
"data.prizeType"
);
int
prizeType
=
response
.
jsonPath
().
getInt
(
"data.prizeType"
);
Assert
.
assertTrue
(
state
==
2
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"订单出奖状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
state
==
2
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"订单出奖状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
prizeType
==
1
||
prizeType
==
2
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"抽奖结果错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
prizeType
==
1
||
prizeType
==
2
||
prizeType
==
4
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"抽奖结果错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客_指定客户中奖"
,
priority
=
15
)
@Test
(
description
=
"访客_指定客户中奖"
,
priority
=
15
)
...
@@ -550,7 +550,7 @@ public class GameLottery implements Authorization {
...
@@ -550,7 +550,7 @@ public class GameLottery implements Authorization {
@Test
(
description
=
"访客_第二个客户未中奖"
,
priority
=
21
)
@Test
(
description
=
"访客_第二个客户未中奖"
,
priority
=
21
)
public
void
访客
_
第二个客户未中奖
(){
public
void
访客
_
第二个客户未中奖
(){
//切换为请勿打扰
//切换为请勿打扰
//
userTku1();
userTku1
();
//添加访问记录
//添加访问记录
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
@@ -588,7 +588,7 @@ public class GameLottery implements Authorization {
...
@@ -588,7 +588,7 @@ public class GameLottery implements Authorization {
int
state
=
response
.
jsonPath
().
getInt
(
"data.state"
);
int
state
=
response
.
jsonPath
().
getInt
(
"data.state"
);
int
prizeType
=
response
.
jsonPath
().
getInt
(
"data.prizeType"
);
int
prizeType
=
response
.
jsonPath
().
getInt
(
"data.prizeType"
);
Assert
.
assertTrue
(
state
==
2
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"订单出奖状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
state
==
2
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"订单出奖状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
prizeType
==
1
||
prizeType
==
2
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"抽奖结果错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
prizeType
==
1
||
prizeType
==
2
||
prizeType
==
4
,
network
.
message
(
params
,
LOTTERRY_getOrderStatus
,
"抽奖结果错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人_查询发起抽奖列表"
,
priority
=
22
)
@Test
(
description
=
"代理人_查询发起抽奖列表"
,
priority
=
22
)
...
...
src/test/java/com/kjj/cases/assistant/pay/Pay.java
View file @
c8539426
...
@@ -253,5 +253,5 @@ public class Pay implements Authorization {
...
@@ -253,5 +253,5 @@ public class Pay implements Authorization {
}
}
}
}
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
c8539426
...
@@ -22,7 +22,6 @@ public class ForwardAndRead implements Authorization {
...
@@ -22,7 +22,6 @@ public class ForwardAndRead implements Authorization {
private
String
articleScId
;
private
String
articleScId
;
private
Long
sellerId
;
private
Long
sellerId
;
private
String
jjvisitId
;
private
String
jjvisitId
;
private
String
insuranceId
;
private
long
forwardTime
;
private
long
forwardTime
;
private
String
questionId
;
private
String
questionId
;
public
static
Map
<
String
,
Integer
>
custClueStatistics
;
public
static
Map
<
String
,
Integer
>
custClueStatistics
;
...
@@ -42,11 +41,9 @@ public class ForwardAndRead implements Authorization {
...
@@ -42,11 +41,9 @@ public class ForwardAndRead implements Authorization {
param
.
put
(
"userId"
,
userId
);
param
.
put
(
"userId"
,
userId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
int
drawMaterial
=
response
.
jsonPath
().
getInt
(
"data.drawMaterial"
);
int
drawMaterial
=
response
.
jsonPath
().
getInt
(
"data.drawMaterial"
);
int
drawPresentInsuranceCount
=
response
.
jsonPath
().
getInt
(
"data.drawPresentInsuranceCount"
);
int
grassCount
=
response
.
jsonPath
().
getInt
(
"data.grassCount"
);
int
grassCount
=
response
.
jsonPath
().
getInt
(
"data.grassCount"
);
int
visitCount
=
response
.
jsonPath
().
getInt
(
"data.visitCount"
);
int
visitCount
=
response
.
jsonPath
().
getInt
(
"data.visitCount"
);
custClueStatistics
.
put
(
"drawMaterial"
,
drawMaterial
);
custClueStatistics
.
put
(
"drawMaterial"
,
drawMaterial
);
custClueStatistics
.
put
(
"drawPresentInsuranceCount"
,
drawPresentInsuranceCount
);
custClueStatistics
.
put
(
"grassCount"
,
grassCount
);
custClueStatistics
.
put
(
"grassCount"
,
grassCount
);
custClueStatistics
.
put
(
"visitCount"
,
visitCount
);
custClueStatistics
.
put
(
"visitCount"
,
visitCount
);
}
}
...
@@ -99,28 +96,6 @@ public class ForwardAndRead implements Authorization {
...
@@ -99,28 +96,6 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertNotNull
(
jjvisitId
,
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"visitId为空"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
jjvisitId
,
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"visitId为空"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客领取赠险"
,
priority
=
5
)
public
void
领取赠险
()
throws
IOException
{
// 获取赠险insuranceId
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
articleScId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
SELLERCARD_RECOMMENDLISTV3
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_RECOMMENDLISTV3
,
"接口调用失败"
,
response
.
body
().
asString
()));
insuranceId
=
response
.
jsonPath
().
getString
(
"data.insuranceVos[0].id"
);
// 领取赠险
param
=
new
HashMap
<>();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
param
.
put
(
"insuranceId"
,
insuranceId
);
param
.
put
(
"locationSource"
,
1
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"接口调用失败"
,
response
.
body
().
asString
()));
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客转发文章"
,
priority
=
6
)
@Test
(
description
=
"访客转发文章"
,
priority
=
6
)
public
void
访客转发文章
()
throws
IOException
{
public
void
访客转发文章
()
throws
IOException
{
...
@@ -151,22 +126,6 @@ public class ForwardAndRead implements Authorization {
...
@@ -151,22 +126,6 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
}
}
// 新用户领取赠险
@Test
(
description
=
"新用户领取赠险"
,
priority
=
8
)
public
void
新用户领取赠险
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
param
.
put
(
"insuranceId"
,
insuranceId
);
param
.
put
(
"locationSource"
,
1
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
System
.
out
.
println
(
response
.
body
().
asString
());
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
public
void
二度访客阅读文章
()
throws
IOException
{
public
void
二度访客阅读文章
()
throws
IOException
{
ThreadSleepUtils
.
sleep
(
5000
);
ThreadSleepUtils
.
sleep
(
5000
);
...
@@ -190,21 +149,6 @@ public class ForwardAndRead implements Authorization {
...
@@ -190,21 +149,6 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
,
"添加访问记录失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
,
"添加访问记录失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"二度访客领取赠险"
,
priority
=
11
)
public
void
二度访客领取赠险
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
param
.
put
(
"insuranceId"
,
insuranceId
);
param
.
put
(
"locationSource"
,
1
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"接口调用失败"
,
response
.
body
().
asString
()));
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取文章FAQs"
,
priority
=
12
)
@Test
(
description
=
"获取文章FAQs"
,
priority
=
12
)
public
void
获取文章
FAQs
()
throws
IOException
{
public
void
获取文章
FAQs
()
throws
IOException
{
param
.
clear
();
param
.
clear
();
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
c8539426
...
@@ -355,11 +355,9 @@ public class MyCustomer implements Authorization {
...
@@ -355,11 +355,9 @@ public class MyCustomer implements Authorization {
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"接口请求失败"
,
response
.
body
().
asString
()));
ClueStatistics
clueStatistics
=
JsonUtil
.
parseResponseToBean
(
response
,
ClueStatistics
.
class
);
ClueStatistics
clueStatistics
=
JsonUtil
.
parseResponseToBean
(
response
,
ClueStatistics
.
class
);
int
drawPresentInsuranceCount
=
clueStatistics
.
getDrawPresentInsuranceCount
();
int
grassCount
=
clueStatistics
.
getGrassCount
();
int
grassCount
=
clueStatistics
.
getGrassCount
();
int
visitCount
=
clueStatistics
.
getVisitCount
();
int
visitCount
=
clueStatistics
.
getVisitCount
();
int
drawMaterial
=
clueStatistics
.
getDrawMaterial
();
int
drawMaterial
=
clueStatistics
.
getDrawMaterial
();
Assert
.
assertEquals
(
drawPresentInsuranceCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"drawPresentInsuranceCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客领取赠险记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
grassCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"grassCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客阅读种草文章记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
grassCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"grassCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客阅读种草文章记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"visitCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客来访记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"visitCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客来访记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
drawMaterial
,
ForwardAndRead
.
custClueStatistics
.
get
(
"drawMaterial"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客领取资料次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
drawMaterial
,
ForwardAndRead
.
custClueStatistics
.
get
(
"drawMaterial"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客领取资料次数未正确增加"
,
response
.
body
().
asString
()));
...
@@ -405,7 +403,7 @@ public class MyCustomer implements Authorization {
...
@@ -405,7 +403,7 @@ public class MyCustomer implements Authorization {
String
contentId
=
recordsOfContent
.
getContentId
();
String
contentId
=
recordsOfContent
.
getContentId
();
int
clueType
=
recordsOfClue
.
getClueType
();
int
clueType
=
recordsOfClue
.
getClueType
();
Assert
.
assertEquals
(
contentId
,
BasicConfig
.
ARTICLE_CONTENTID
,
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"访问记录详情有误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
contentId
,
BasicConfig
.
ARTICLE_CONTENTID
,
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"访问记录详情有误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
clueType
,
31
,
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"访问记录详情有误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
clueType
,
29
,
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"访问记录详情有误"
,
response
.
body
().
asString
()));
}
}
// 客户线索跟进
// 客户线索跟进
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
c8539426
...
@@ -144,7 +144,7 @@ public class WhoSawMe implements Authorization {
...
@@ -144,7 +144,7 @@ public class WhoSawMe implements Authorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
todayClueNum
=
response
.
jsonPath
().
getInt
(
"data.todayClueNum"
);
int
todayClueNum
=
response
.
jsonPath
().
getInt
(
"data.todayClueNum"
);
int
todayVisitNum
=
response
.
jsonPath
().
getInt
(
"data.todayVisitNum"
);
int
todayVisitNum
=
response
.
jsonPath
().
getInt
(
"data.todayVisitNum"
);
Assert
.
assertTrue
(
todayClueNum
>=
2
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日线索数有误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
todayClueNum
>=
0
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日线索数有误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
todayVisitNum
>=
2
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日访问数有误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
todayVisitNum
>=
2
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日访问数有误"
,
response
.
body
().
asString
()));
}
}
...
@@ -842,7 +842,7 @@ public class WhoSawMe implements Authorization {
...
@@ -842,7 +842,7 @@ public class WhoSawMe implements Authorization {
int
visitClueType
=
response
.
jsonPath
().
getInt
(
"data.visitClueType"
);
int
visitClueType
=
response
.
jsonPath
().
getInt
(
"data.visitClueType"
);
Long
custUserId
=
response
.
jsonPath
().
getLong
(
"data.custUserId"
);
Long
custUserId
=
response
.
jsonPath
().
getLong
(
"data.custUserId"
);
String
contentScid
=
response
.
jsonPath
().
getString
(
"data.fromContent.scid"
);
String
contentScid
=
response
.
jsonPath
().
getString
(
"data.fromContent.scid"
);
Assert
.
assertEquals
(
visitClueType
,
31
,
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索类型错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitClueType
,
29
,
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索类型错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custUserId
,
ForwardAndRead
.
decodeTku
(
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源访客userId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custUserId
,
ForwardAndRead
.
decodeTku
(
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源访客userId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
contentScid
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源素材id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
contentScid
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源素材id错误"
,
response
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/cases/live/agent/Agent.java
View file @
c8539426
...
@@ -115,16 +115,21 @@ public class Agent implements Authorization {
...
@@ -115,16 +115,21 @@ public class Agent implements Authorization {
@Test
(
description
=
"获取直播列表 "
,
priority
=
7
)
@Test
(
description
=
"获取直播列表 "
,
priority
=
7
)
public
void
获取直播列表
()
{
public
void
获取直播列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
1
0
);
params
.
put
(
"pageSize"
,
2
0
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Procurator
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Procurator
);
List
<
AgentBean
>
agentBeans
=
JsonUtil
.
parseResponseToPageBean
(
response
,
AgentBean
.
class
);
List
<
AgentBean
>
agentBeans
=
JsonUtil
.
parseResponseToPageBean
(
response
,
AgentBean
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
if
(
agentBeans
.
size
()
>
0
)
{
AgentBean
bean
=
agentBeans
.
get
(
0
);
for
(
AgentBean
item:
agentBeans
)
{
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
if
(
item
.
getLiveId
().
equals
(
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()))){
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Procurator
,
"查询直播列表失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
JSON
.
toJSONString
(
item
));
Assert
.
assertNotNull
(
item
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Procurator
,
"查询直播列表失败"
,
response
.
body
().
asString
()));
// 判断代理人邀约奖励openFlag是否为开
Assert
.
assertEquals
(
item
.
getAgentAwardOpenFlag
(),
1
,
network
.
message
(
params
,
MOBILE_Procurator
,
"代理人邀约奖励开启状态错误"
,
response
.
body
().
asString
()));
break
;
}
}
}
}
}
}
...
...
src/test/java/com/kjj/cases/live/agent/Customer.java
View file @
c8539426
...
@@ -23,15 +23,19 @@ public class Customer implements Authorization {
...
@@ -23,15 +23,19 @@ public class Customer implements Authorization {
@Test
(
description
=
"客户数量统计"
,
priority
=
1
)
@Test
(
description
=
"客户数量统计"
,
priority
=
1
)
public
void
客户数量统计
()
{
public
void
客户数量统计
()
{
Response
response
=
network
.
getResponse
(
BasicConfig
.
MOBILE_potentialCount
);
Response
cusStatRes
=
network
.
getResponse
(
BasicConfig
.
MOBILE_cusStat
);
System
.
out
.
println
(
response
.
body
().
asString
());
try
{
int
sumCount
=
response
.
jsonPath
().
getInt
(
"data.sumCount"
);
int
total
=
cusStatRes
.
jsonPath
().
getInt
(
"data.totalCustomer"
);
Assert
.
assertTrue
(
sumCount
>
26
,
network
.
message
(
BasicConfig
.
MOBILE_potentialCount
,
"总客户数量不对"
,
response
.
body
().
asString
()));
int
award
=
cusStatRes
.
jsonPath
().
getInt
(
"data.awardNum"
);
int
lastLiveCount
=
response
.
jsonPath
().
getJsonObject
(
"data.lastLiveCount"
);
int
purchase
=
cusStatRes
.
jsonPath
().
getInt
(
"data.purchaseNum"
);
Assert
.
assertTrue
(
lastLiveCount
>
1
,
network
.
message
(
BasicConfig
.
MOBILE_potentialCount
,
"最近一场直播客户数量为null"
,
response
.
body
().
asString
()));
int
indirectNum
=
cusStatRes
.
jsonPath
().
getInt
(
"data.indirectNum"
);
int
potentialCount
=
response
.
jsonPath
().
getJsonObject
(
"data.potentialCount"
);
if
(
total
<
0
||
award
<
0
||
purchase
<
0
||
indirectNum
<
0
){
Assert
.
assertTrue
(
potentialCount
>
1
,
network
.
message
(
BasicConfig
.
MOBILE_potentialCount
,
"准客户数量为null"
,
response
.
body
().
asString
()));
Assert
.
fail
(
network
.
message
(
BasicConfig
.
MOBILE_cusStat
,
"客户数量有误"
,
cusStatRes
.
body
().
asString
()));
lastLiveId
=
response
.
jsonPath
().
getString
(
"data.lastLiveId"
);
}
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
BasicConfig
.
MOBILE_cusStat
,
"获取数据失败"
,
cusStatRes
.
body
().
asString
()));
}
}
}
@Test
(
description
=
"代理人最近一场直播客户列表"
,
priority
=
2
)
@Test
(
description
=
"代理人最近一场直播客户列表"
,
priority
=
2
)
...
@@ -76,8 +80,28 @@ public class Customer implements Authorization {
...
@@ -76,8 +80,28 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"查询代理人转介绍客户列表"
,
priority
=
5
)
public
void
查询代理人转介绍客户列表
()
{
Map
<
String
,
Object
>
custListPar
=
new
HashMap
<>();
custListPar
.
put
(
"actionTypeList"
,
31
);
Response
custListRes
=
network
.
getResponse
(
custListPar
,
BasicConfig
.
MOBILE_custList
);
try
{
List
<
Map
<
String
,
Object
>>
cL
=
custListRes
.
jsonPath
().
getList
(
"data.list"
);
if
(
cL
.
size
()
>
0
){
for
(
Map
<
String
,
Object
>
cust
:
cL
){
Assert
.
assertEquals
((
int
)
cust
.
get
(
"firstInvitedFlag"
),
0
,
network
.
message
(
custListPar
,
BasicConfig
.
MOBILE_custList
,
"有非转介绍客户"
,
custListRes
.
body
().
asString
()));
}
}
else
{
Assert
.
fail
(
network
.
message
(
custListPar
,
BasicConfig
.
MOBILE_custList
,
"转介绍客户数量错误"
,
custListRes
.
body
().
asString
()));
}
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
custListPar
,
BasicConfig
.
MOBILE_custList
,
"获取数据失败"
,
custListRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询客户直播线索汇总信息"
,
priority
=
5
)
@Test
(
description
=
"查询客户直播线索汇总信息"
,
priority
=
6
)
public
void
查询客户直播线索汇总信息
()
{
public
void
查询客户直播线索汇总信息
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"customerId"
,
customerId
);
Params
.
put
(
"customerId"
,
customerId
);
...
@@ -91,7 +115,7 @@ public class Customer implements Authorization {
...
@@ -91,7 +115,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"编辑客户基本信息"
,
priority
=
6
)
@Test
(
description
=
"编辑客户基本信息"
,
priority
=
7
)
public
void
编辑客户基本信息
()
{
public
void
编辑客户基本信息
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"customerId"
,
customerId
);
Params
.
put
(
"customerId"
,
customerId
);
...
@@ -168,7 +192,7 @@ public class Customer implements Authorization {
...
@@ -168,7 +192,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"查询客户基本信息"
,
priority
=
7
)
@Test
(
description
=
"查询客户基本信息"
,
priority
=
8
)
public
void
查询客户基本信息
()
{
public
void
查询客户基本信息
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"customerId"
,
customerId
);
Params
.
put
(
"customerId"
,
customerId
);
...
@@ -179,7 +203,7 @@ public class Customer implements Authorization {
...
@@ -179,7 +203,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"查询客户详情头像信息栏"
,
priority
=
8
)
@Test
(
description
=
"查询客户详情头像信息栏"
,
priority
=
9
)
public
void
查询客户详情头像信息栏
()
{
public
void
查询客户详情头像信息栏
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"customerId"
,
customerId
);
Params
.
put
(
"customerId"
,
customerId
);
...
@@ -194,7 +218,7 @@ public class Customer implements Authorization {
...
@@ -194,7 +218,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"查询客户直播场次详情信息"
,
priority
=
9
)
@Test
(
description
=
"查询客户直播场次详情信息"
,
priority
=
10
)
public
void
查询客户直播场次详情信息
()
{
public
void
查询客户直播场次详情信息
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"customerId"
,
customerId
);
Params
.
put
(
"customerId"
,
customerId
);
...
@@ -208,7 +232,7 @@ public class Customer implements Authorization {
...
@@ -208,7 +232,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"修改客户备注名"
,
priority
=
1
0
)
@Test
(
description
=
"修改客户备注名"
,
priority
=
1
1
)
public
void
修改客户备注名
()
{
public
void
修改客户备注名
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveUserId"
,
customerId
);
Params
.
put
(
"liveUserId"
,
customerId
);
...
@@ -220,7 +244,7 @@ public class Customer implements Authorization {
...
@@ -220,7 +244,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"跟进机会列表"
,
priority
=
1
1
)
@Test
(
description
=
"跟进机会列表"
,
priority
=
1
2
)
public
void
跟进机会列表
()
{
public
void
跟进机会列表
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveVisitorId"
,
customerId
);
Params
.
put
(
"liveVisitorId"
,
customerId
);
...
@@ -233,7 +257,7 @@ public class Customer implements Authorization {
...
@@ -233,7 +257,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"获取跟进机会回复建议"
,
priority
=
1
2
)
@Test
(
description
=
"获取跟进机会回复建议"
,
priority
=
1
3
)
public
void
获取跟进机会回复建议
()
{
public
void
获取跟进机会回复建议
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveVisitorId"
,
customerId
);
Params
.
put
(
"liveVisitorId"
,
customerId
);
...
@@ -245,7 +269,7 @@ public class Customer implements Authorization {
...
@@ -245,7 +269,7 @@ public class Customer implements Authorization {
}
}
@Test
(
description
=
"跟进机会详情"
,
priority
=
1
2
)
@Test
(
description
=
"跟进机会详情"
,
priority
=
1
4
)
public
void
跟进机会详情
()
{
public
void
跟进机会详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"id"
,
id
);
Params
.
put
(
"id"
,
id
);
...
...
src/test/java/com/kjj/cases/live/agent/LiveLater.java
View file @
c8539426
...
@@ -117,7 +117,8 @@ public class LiveLater implements Authorization {
...
@@ -117,7 +117,8 @@ public class LiveLater implements Authorization {
}
}
// 代理人端改版,客户页不再调用clueList接口
/*
// 获取直播结束我的客户页面直接邀请tab;
// 获取直播结束我的客户页面直接邀请tab;
@Test(description="直接邀请tab数据",priority = 6)
@Test(description="直接邀请tab数据",priority = 6)
public void 直接邀请tab数据() {
public void 直接邀请tab数据() {
...
@@ -185,6 +186,7 @@ public class LiveLater implements Authorization {
...
@@ -185,6 +186,7 @@ public class LiveLater implements Authorization {
}
}
// 获取直播结束我的客户页面观看20分钟+tab;
// 获取直播结束我的客户页面观看20分钟+tab;
@Test(description="观看20分钟+tab数据",priority = 10)
@Test(description="观看20分钟+tab数据",priority = 10)
public void 观看20分钟以上tab数据() {
public void 观看20分钟以上tab数据() {
...
@@ -201,6 +203,43 @@ public class LiveLater implements Authorization {
...
@@ -201,6 +203,43 @@ public class LiveLater implements Authorization {
}
}
*/
@Test
(
description
=
"获取本场直播客户统计"
,
priority
=
8
)
public
void
获取本场直播客户统计
()
{
Map
<
String
,
Object
>
custStatPar
=
new
HashMap
<>();
custStatPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
custStatRes
=
network
.
getResponse
(
custStatPar
,
BasicConfig
.
MOBILE_custStat
);
try
{
int
totalNum
=
custStatRes
.
jsonPath
().
getInt
(
"data.totalNum"
);
int
awardNum
=
custStatRes
.
jsonPath
().
getInt
(
"data.awardNum"
);
int
purchaseNum
=
custStatRes
.
jsonPath
().
getInt
(
"data.purchaseNum"
);
int
indirectNum
=
custStatRes
.
jsonPath
().
getInt
(
"data.indirectNum"
);
if
(
totalNum
<
0
||
awardNum
<
0
||
purchaseNum
<
0
||
indirectNum
<
0
){
Assert
.
fail
(
network
.
message
(
custStatPar
,
BasicConfig
.
MOBILE_custStat
,
"本场直播客户统计数错误"
,
custStatRes
.
body
().
asString
()));
}
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
custStatPar
,
BasicConfig
.
MOBILE_custStat
,
"数据获取失败"
,
custStatRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"直播中客户列表"
,
priority
=
9
)
public
void
直播中客户列表
()
{
Map
<
String
,
Object
>
custListPar
=
new
HashMap
<>();
custListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
custListRes
=
network
.
getResponse
(
custListPar
,
BasicConfig
.
MOBILE_liveCustList
);
try
{
List
<
Map
<
String
,
Object
>>
visitorLists
=
custListRes
.
jsonPath
().
getList
(
"data.list"
);
List
<
String
>
goodsList
=
(
List
<
String
>)
visitorLists
.
get
(
0
).
get
(
"goodsList"
);
Assert
.
assertTrue
(
goodsList
.
get
(
0
).
equals
(
"自动化专用商品"
),
network
.
message
(
custListPar
,
BasicConfig
.
MOBILE_liveCustList
,
"客户购买商品名称错误"
,
custListRes
.
body
().
asString
()));
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
custListPar
,
BasicConfig
.
MOBILE_liveCustList
,
"获取数据失败"
,
custListRes
.
body
().
asString
()));
}
}
//查看客户线索详情
//查看客户线索详情
@Test
(
description
=
"客户A线索已读"
,
priority
=
11
)
@Test
(
description
=
"客户A线索已读"
,
priority
=
11
)
...
...
src/test/java/com/kjj/cases/live/agent/Potential.java
View file @
c8539426
...
@@ -15,7 +15,7 @@ public class Potential implements Authorization {
...
@@ -15,7 +15,7 @@ public class Potential implements Authorization {
public
String
bizConfId
;
public
String
bizConfId
;
@BeforeClass
@BeforeClass
public
void
setUp
()
{
visitorAuth
();
}
public
void
setUp
()
{
visitorAuth
1
();
}
@Test
(
description
=
"直播间名片"
,
priority
=
1
)
@Test
(
description
=
"直播间名片"
,
priority
=
1
)
public
void
直播间名片
()
{
public
void
直播间名片
()
{
...
...
src/test/java/com/kjj/cases/live/anchor/LiveVisitors.java
View file @
c8539426
...
@@ -5,17 +5,14 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,17 +5,14 @@ import com.alibaba.fastjson.JSONObject;
import
com.kjj.bean.manager.EvaluationDetail
;
import
com.kjj.bean.manager.EvaluationDetail
;
import
com.kjj.bean.resources.*
;
import
com.kjj.bean.resources.*
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.live.liveConfig.EvaluationConf
;
import
com.kjj.cases.live.liveConfig.LiveMaterial
;
import
com.kjj.cases.live.liveConfig.LiveMaterial
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.IdMakeUtil
;
import
com.kjj.utils.IdMakeUtil
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.*
;
import
java.util.*
;
...
@@ -71,7 +68,7 @@ public class LiveVisitors implements Authorization
...
@@ -71,7 +68,7 @@ public class LiveVisitors implements Authorization
public
void
访客端权益列表
()
public
void
访客端权益列表
()
{
{
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Resource
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Resource
);
...
@@ -111,7 +108,7 @@ public class LiveVisitors implements Authorization
...
@@ -111,7 +108,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端表单资料查询"
,
priority
=
4
)
@Test
(
description
=
"访客端表单资料查询"
,
priority
=
4
)
public
ResourceForm
访客端系统表单资料查询
()
public
ResourceForm
访客端系统表单资料查询
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_form
);
params
.
put
(
"confId"
,
confId_form
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Form
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Form
);
...
@@ -126,7 +123,7 @@ public class LiveVisitors implements Authorization
...
@@ -126,7 +123,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端表单资料提交"
,
priority
=
5
)
@Test
(
description
=
"访客端表单资料提交"
,
priority
=
5
)
public
void
访客端系统表单资料提交
()
public
void
访客端系统表单资料提交
()
{
{
visitorAuth
();
visitorAuth
1
();
ResourceForm
list
=
访客端系统表单资料查询
();
ResourceForm
list
=
访客端系统表单资料查询
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_form
);
params
.
put
(
"confId"
,
confId_form
);
...
@@ -168,7 +165,7 @@ public class LiveVisitors implements Authorization
...
@@ -168,7 +165,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端免费领资料查询"
,
priority
=
7
)
@Test
(
description
=
"访客端免费领资料查询"
,
priority
=
7
)
public
void
访客端免费领资料查询
()
public
void
访客端免费领资料查询
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_free
);
params
.
put
(
"confId"
,
confId_free
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -182,7 +179,7 @@ public class LiveVisitors implements Authorization
...
@@ -182,7 +179,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端免费领资料领取"
,
priority
=
8
)
@Test
(
description
=
"访客端免费领资料领取"
,
priority
=
8
)
public
void
访客端免费领资料领取
()
public
void
访客端免费领资料领取
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_free
);
params
.
put
(
"confId"
,
confId_free
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -212,7 +209,7 @@ public class LiveVisitors implements Authorization
...
@@ -212,7 +209,7 @@ public class LiveVisitors implements Authorization
/*访客端参与测试权益*/
/*访客端参与测试权益*/
@Test
(
description
=
"访客端获取测试权益详情"
,
priority
=
10
)
@Test
(
description
=
"访客端获取测试权益详情"
,
priority
=
10
)
public
void
访客端获取测试权益详情
()
{
public
void
访客端获取测试权益详情
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
evaDetailPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
evaDetailPar
=
new
HashMap
<>();
evaDetailPar
.
put
(
"confId"
,
confId_eva
);
evaDetailPar
.
put
(
"confId"
,
confId_eva
);
...
@@ -311,7 +308,7 @@ public class LiveVisitors implements Authorization
...
@@ -311,7 +308,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客领取关联测试表单"
,
priority
=
16
)
@Test
(
description
=
"访客领取关联测试表单"
,
priority
=
16
)
public
void
访客领取关联测试表单
()
{
public
void
访客领取关联测试表单
()
{
visitorAuth
();
visitorAuth
1
();
ResourceForm
list
=
访客端系统表单资料查询
();
ResourceForm
list
=
访客端系统表单资料查询
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_formWithEva
);
params
.
put
(
"confId"
,
confId_formWithEva
);
...
@@ -337,7 +334,7 @@ public class LiveVisitors implements Authorization
...
@@ -337,7 +334,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端获取关联测试表单权益详情"
,
priority
=
17
)
@Test
(
description
=
"访客端获取关联测试表单权益详情"
,
priority
=
17
)
public
void
访客端获取关联测试表单权益详情
()
{
public
void
访客端获取关联测试表单权益详情
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_formWithEva
);
params
.
put
(
"confId"
,
confId_formWithEva
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Form
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Form
);
...
@@ -356,7 +353,7 @@ public class LiveVisitors implements Authorization
...
@@ -356,7 +353,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端获取关联测试免费领权益详情"
,
priority
=
18
)
@Test
(
description
=
"访客端获取关联测试免费领权益详情"
,
priority
=
18
)
public
void
访客端获取关联测试免费领权益详情
()
{
public
void
访客端获取关联测试免费领权益详情
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_freeWithEva
);
params
.
put
(
"confId"
,
confId_freeWithEva
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -377,7 +374,7 @@ public class LiveVisitors implements Authorization
...
@@ -377,7 +374,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"领取关联测试免费领"
,
priority
=
19
)
@Test
(
description
=
"领取关联测试免费领"
,
priority
=
19
)
public
void
领取关联测试免费领
()
{
public
void
领取关联测试免费领
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_freeWithEva
);
params
.
put
(
"confId"
,
confId_freeWithEva
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -392,7 +389,7 @@ public class LiveVisitors implements Authorization
...
@@ -392,7 +389,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端链接资料查询"
,
priority
=
20
)
@Test
(
description
=
"访客端链接资料查询"
,
priority
=
20
)
public
void
访客端链接小程序资料查询
()
public
void
访客端链接小程序资料查询
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_link
);
params
.
put
(
"confId"
,
confId_link
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Link1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Link1
);
...
@@ -406,7 +403,7 @@ public class LiveVisitors implements Authorization
...
@@ -406,7 +403,7 @@ public class LiveVisitors implements Authorization
@Test
(
description
=
"访客端链接资料领取"
,
priority
=
21
)
@Test
(
description
=
"访客端链接资料领取"
,
priority
=
21
)
public
void
访客端链接小程序资料领取
()
public
void
访客端链接小程序资料领取
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_link
);
params
.
put
(
"confId"
,
confId_link
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -533,7 +530,7 @@ public class LiveVisitors implements Authorization
...
@@ -533,7 +530,7 @@ public class LiveVisitors implements Authorization
public
void
访客获取贴片信息
()
public
void
访客获取贴片信息
()
{
{
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_pasterInfo
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_pasterInfo
);
...
...
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
View file @
c8539426
...
@@ -3,7 +3,6 @@ import com.kjj.cases.admin.Authorization;
...
@@ -3,7 +3,6 @@ import com.kjj.cases.admin.Authorization;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.sun.org.apache.xalan.internal.xsltc.trax.XSLTCSource
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.BeforeClass
;
...
@@ -23,7 +22,7 @@ public class OpenLive implements Authorization {
...
@@ -23,7 +22,7 @@ public class OpenLive implements Authorization {
@Test
(
description
=
"结束直直播中或断流中的场次"
,
priority
=
1
)
@Test
(
description
=
"结束直直播中或断流中的场次"
,
priority
=
1
)
public
void
结束直直播中或断流中的场次
()
{
public
void
结束直直播中或断流中的场次
()
{
int
totalCount2
=
0
;
int
totalCount2
=
0
;
long
live
i
d
=
0L
;
long
live
I
d
=
0L
;
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"companyId"
,
101
);
ConfDetailParam
.
put
(
"companyId"
,
101
);
ConfDetailParam
.
put
(
"liveStatus"
,
3
);
ConfDetailParam
.
put
(
"liveStatus"
,
3
);
...
@@ -41,16 +40,16 @@ public class OpenLive implements Authorization {
...
@@ -41,16 +40,16 @@ public class OpenLive implements Authorization {
totalCount2
=
ConfDetailRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
totalCount2
=
ConfDetailRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
if
(
totalCount2
==
1
)
{
if
(
totalCount2
==
1
)
{
System
.
out
.
println
(
"有一场直播正在直播中"
);
System
.
out
.
println
(
"有一场直播正在直播中"
);
live
i
d
=
ConfDetailRes
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
live
I
d
=
ConfDetailRes
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
}
}
}
else
{
}
else
{
System
.
out
.
println
(
"有一场直播正在断流中"
);
System
.
out
.
println
(
"有一场直播正在断流中"
);
live
i
d
=
ConfDetailRes
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
live
I
d
=
ConfDetailRes
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
}
}
if
(
totalCount1
==
1
||
totalCount2
==
1
){
if
(
totalCount1
==
1
||
totalCount2
==
1
){
adminAuth
();
adminAuth
();
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
live
i
d
);
closeParam
.
put
(
"liveid"
,
live
I
d
);
closeParam
.
put
(
"cid"
,
101
);
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
...
@@ -61,6 +60,7 @@ public class OpenLive implements Authorization {
...
@@ -61,6 +60,7 @@ public class OpenLive implements Authorization {
@Test
(
description
=
"获取直播配置详情"
,
priority
=
2
)
@Test
(
description
=
"获取直播配置详情"
,
priority
=
2
)
public
void
获取直播配置详情
()
{
public
void
获取直播配置详情
()
{
adminAuth
();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
);
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
);
...
@@ -81,4 +81,6 @@ public class OpenLive implements Authorization {
...
@@ -81,4 +81,6 @@ public class OpenLive implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
10000
);
ThreadSleepUtils
.
sleep
(
10000
);
}
}
}
}
src/test/java/com/kjj/cases/live/answer/Answer.java
View file @
c8539426
...
@@ -256,8 +256,8 @@ public class Answer implements Authorization {
...
@@ -256,8 +256,8 @@ public class Answer implements Authorization {
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
params
.
put
(
"optionId"
,
this
.
wronganswer
.
getId
());
params
.
put
(
"optionId"
,
this
.
wronganswer
.
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
System
.
out
.
println
(
openResult
);
Assert
.
assertTrue
(
openResult
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"用户参与失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
openResult
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"用户参与失败"
,
response
.
body
().
asString
()));
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
...
@@ -300,7 +300,7 @@ public class Answer implements Authorization {
...
@@ -300,7 +300,7 @@ public class Answer implements Authorization {
System
.
out
.
println
(
" 查询用户A领取答题红包结果 timestamp:"
+
new
Date
().
getTime
()+
"quesConfId:"
+
quesConfId
);
System
.
out
.
println
(
" 查询用户A领取答题红包结果 timestamp:"
+
new
Date
().
getTime
()+
"quesConfId:"
+
quesConfId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
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
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
Integer
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
Integer
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
...
@@ -481,14 +481,10 @@ public class Answer implements Authorization {
...
@@ -481,14 +481,10 @@ public class Answer implements Authorization {
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
()
);
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
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
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"答题失败"
,
response
.
body
().
asString
()));
Object
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
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/choice/Choice.java
View file @
c8539426
...
@@ -105,7 +105,7 @@ public class Choice implements Authorization {
...
@@ -105,7 +105,7 @@ public class Choice implements Authorization {
public
void
访客端获取正在答题中的选择题
()
public
void
访客端获取正在答题中的选择题
()
{
{
ThreadSleepUtils
.
sleep
(
5000
);
ThreadSleepUtils
.
sleep
(
5000
);
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetChoiceQuestion
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetChoiceQuestion
);
...
@@ -122,7 +122,7 @@ public class Choice implements Authorization {
...
@@ -122,7 +122,7 @@ public class Choice implements Authorization {
@Test
(
description
=
"访客端提交答案"
,
priority
=
6
)
@Test
(
description
=
"访客端提交答案"
,
priority
=
6
)
public
void
访客端提交答案
()
public
void
访客端提交答案
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"answerId"
,
answerid
);
params
.
put
(
"answerId"
,
answerid
);
...
@@ -137,7 +137,7 @@ public class Choice implements Authorization {
...
@@ -137,7 +137,7 @@ public class Choice implements Authorization {
@Test
(
description
=
"访客端获取答案的数量"
,
priority
=
7
)
@Test
(
description
=
"访客端获取答案的数量"
,
priority
=
7
)
public
void
访客端获取答案的数量
()
public
void
访客端获取答案的数量
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionId"
,
questionid
);
params
.
put
(
"questionId"
,
questionid
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/cases/live/customer/AfterLive.java
View file @
c8539426
...
@@ -3,7 +3,6 @@ package com.kjj.cases.live.customer;
...
@@ -3,7 +3,6 @@ package com.kjj.cases.live.customer;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.live.agent.Agent
;
import
com.kjj.cases.live.agent.Agent
;
import
com.kjj.cases.live.anchor.LiveVisitors
;
import
com.kjj.cases.live.anchor.LiveVisitors
;
import
com.kjj.cases.live.liveConfig.LiveMaterial
;
import
com.kjj.cases.live.lottery.Lottery
;
import
com.kjj.cases.live.lottery.Lottery
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.constants.LiveConstants
;
...
@@ -21,7 +20,7 @@ public class AfterLive implements Authorization {
...
@@ -21,7 +20,7 @@ public class AfterLive implements Authorization {
private
String
encodeLiveId
;
private
String
encodeLiveId
;
@BeforeClass
@BeforeClass
public
void
SetUp
(){
visitorAuth
();
}
public
void
SetUp
(){
visitorAuth
1
();
}
// 获取访客直播结束页样式
// 获取访客直播结束页样式
@Test
(
description
=
"获取访客直播结束页样式"
,
priority
=
1
)
@Test
(
description
=
"获取访客直播结束页样式"
,
priority
=
1
)
...
...
src/test/java/com/kjj/cases/live/customer/PersonalPage.java
View file @
c8539426
...
@@ -28,7 +28,8 @@ public class PersonalPage implements Authorization {
...
@@ -28,7 +28,8 @@ public class PersonalPage implements Authorization {
private
String
sourceRecordId
;
// 资料领取记录id
private
String
sourceRecordId
;
// 资料领取记录id
@BeforeClass
@BeforeClass
public
void
setUp
(){
visitorAuth
();
public
void
setUp
(){
visitorAuth1
();
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
}
}
...
...
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
View file @
c8539426
...
@@ -18,6 +18,7 @@ public class FlipCard implements Authorization {
...
@@ -18,6 +18,7 @@ public class FlipCard implements Authorization {
public
String
redConfId
;
public
String
redConfId
;
public
String
shareSign
;
public
String
shareSign
;
public
String
shareSignV
;
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
...
@@ -25,97 +26,13 @@ public class FlipCard implements Authorization {
...
@@ -25,97 +26,13 @@ public class FlipCard implements Authorization {
/**
/**
* 翻牌集字活动配置
* 翻牌集字活动配置
*/
*/
/*
@Test
(
description
=
"保存翻牌配置"
,
priority
=
1
)
@Test
(
description
=
"保存翻牌配置"
,
priority
=
1
)
public
void
保存翻牌配置
()
{
public
void
保存翻牌配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params.put("amount", 1000);
Params
.
put
(
"firstInviteStatus"
,
2
);
Params.put("helpNum", 1);
Params
.
put
(
"freeNum"
,
3
);
Params.put("num",2);
Params
.
put
(
"helpNum"
,
2
);
Params.put("showAmount",1000);
Params.put("showMaxAmount",1000);
Params.put("poolType",1);
Params.put("openSceneType",1);
Params.put("freeNum",1);
Response response = network.postResponse(Params, BasicConfig.MANAGER_flipWord);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_flipWord, "保存翻牌配置失败", response.body().asString()));
}
@Test(description = "查看直播翻牌配置详情", priority = 2)
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_wordDetail);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_wordDetail, "查看直播翻牌配置详情失败", response.body().asString()));
}
@Test(description = "开启翻牌配置", priority = 3)
public void 开启翻牌配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("confStatus",2);
Response response = network.postResponse(Params, BasicConfig.MANAGER_wordSwitchStatus);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_wordSwitchStatus, "开启翻牌配置失败", response.body().asString()));
}
@Test(description = "查看直播配置", priority = 4)
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_getConfDetail);
boolean flipWordConfBuildStatus = response.jsonPath().getBoolean("data.flipWordConfBuildStatus");
System.out.println(flipWordConfBuildStatus);
Assert.assertTrue(flipWordConfBuildStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置翻牌", response.body().asString()));
boolean flipWordConfStatus = response.jsonPath().getBoolean("data.flipWordConfStatus");
System.out.println(flipWordConfStatus);
Assert.assertTrue(flipWordConfStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未开启翻牌", response.body().asString()));
}
@Test(description = "查询翻牌集字配置状态", priority = 5)
public void 查询翻牌集字配置状态() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_status);
System.out.println(response.body().asString());
int confStatus = response.jsonPath().getInt("data.confStatus");
Assert.assertTrue(confStatus==2, network.message(params, BasicConfig.MOBILE_status, "未开启", response.body().asString()));
}
@Test(description = "查询翻牌集字配置详情", priority = 6)
public void 查询翻牌集字配置详情() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_wordConf);
System.out.println(response.body().asString());
String redConfId = response.jsonPath().getString("data.redConfId");
this.redConfId=redConfId;
Assert.assertNotNull(redConfId, network.message(params, BasicConfig.MOBILE_wordConf, "查询直播翻牌配置详情失败", response.body().asString()));
}
*/
@Test
(
description
=
"保存翻牌配置"
,
priority
=
1
)
public
void
保存翻牌配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//Params.put("liveId",6441);
Params
.
put
(
"freeNum"
,
1
);
Params
.
put
(
"helpNum"
,
1
);
List
<
RedLevelBean
>
RedLevels
=
new
ArrayList
<>();
List
<
RedLevelBean
>
RedLevels
=
new
ArrayList
<>();
RedLevelBean
redLevel1
=
new
RedLevelBean
();
RedLevelBean
redLevel1
=
new
RedLevelBean
();
redLevel1
.
setAmount
(
30
);
//红包金额为0.3
redLevel1
.
setAmount
(
30
);
//红包金额为0.3
...
@@ -149,13 +66,14 @@ public class FlipCard implements Authorization {
...
@@ -149,13 +66,14 @@ public class FlipCard implements Authorization {
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//Params.put("liveId",6451);
//Params.put("liveId",6451);
Params
.
put
(
"freeNum"
,
1
);
Params
.
put
(
"firstInviteStatus"
,
2
);
Params
.
put
(
"helpNum"
,
1
);
Params
.
put
(
"freeNum"
,
3
);
Params
.
put
(
"helpNum"
,
2
);
List
<
RedLevelBean
>
RedLevels
=
new
ArrayList
<>();
List
<
RedLevelBean
>
RedLevels
=
new
ArrayList
<>();
RedLevelBean
redLevel
1
=
new
RedLevelBean
();
RedLevelBean
redLevel
3
=
new
RedLevelBean
();
redLevel
1
.
setAmount
(
50
);
//红包金额为0.5
redLevel
3
.
setAmount
(
50
);
//红包金额为0.5
redLevel
1
.
setNum
(
1
);
//红包数量
redLevel
3
.
setNum
(
1
);
//红包数量
RedLevels
.
add
(
redLevel
1
);
//红包等级III
RedLevels
.
add
(
redLevel
3
);
//红包等级III
Params
.
put
(
"stepReds"
,
RedLevels
);
Params
.
put
(
"stepReds"
,
RedLevels
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveOrUpdateV2
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveOrUpdateV2
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -202,22 +120,33 @@ public class FlipCard implements Authorization {
...
@@ -202,22 +120,33 @@ public class FlipCard implements Authorization {
Assert
.
assertTrue
(
flipWordConfStatus
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
,
"未开启翻牌"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
flipWordConfStatus
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
,
"未开启翻牌"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"翻牌集字配置详情"
,
priority
=
7
)
public
void
翻牌集字配置详情
(){
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_confV2
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
String
titleImage
=
response
.
jsonPath
().
getString
(
"data.titleImage"
);
int
firstInviteStatus
=
response
.
jsonPath
().
getInt
(
"data.firstInviteStatus"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"翻牌配置详情查询失败"
,
response
.
body
().
asString
()));
Assert
.
assertNull
(
titleImage
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"获取默认标题配图失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
firstInviteStatus
,
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"获取首邀+必得配置失败"
,
response
.
body
().
asString
()));
}
//用户任务完成
//用户任务完成
@Test
(
description
=
"访客H分享直播间"
,
priority
=
7
)
@Test
(
description
=
"访客H分享直播间"
,
priority
=
8
)
public
void
访客
H
分享直播间
()
{
public
void
访客
H
分享直播间
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareType"
,
2
);
params
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_sign
);
Response
signRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"根据分享类型获取分享内容"
,
priority
=
9
)
@Test
(
description
=
"根据分享类型获取分享内容"
,
priority
=
8
)
public
void
根据分享类型获取分享内容
()
{
public
void
根据分享类型获取分享内容
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -229,82 +158,133 @@ public class FlipCard implements Authorization {
...
@@ -229,82 +158,133 @@ public class FlipCard implements Authorization {
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_helpInfo
,
"根据分享类型获取分享内容"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_helpInfo
,
"根据分享类型获取分享内容"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"已登录查询分享人头像昵称"
,
priority
=
10
)
public
void
已登录查询分享人头像昵称
()
{
@Test
(
description
=
"访客邀请关系绑定"
,
priority
=
9
)
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
public
void
访客邀请关系绑定
()
{
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
infoParam
.
put
(
"shareType"
,
12
);
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//infoParam.put("confId",this.redConfId);
bindingParam
.
put
(
"shareSign"
,
shareSign
);
visitorAuth22
();
visitorAuth22
();
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_info
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success
"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data
"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
data
);
Assert
.
assert
True
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assert
NotNull
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_info
,
"已登录查询分享人头像昵称失败"
,
response
.
body
().
asString
()));
visitorAuth25
();
visitorAuth25
();
Response
response
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
Response
infoRes
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_info
);
boolean
success1
=
response
.
jsonPath
().
getJsonObject
(
"success
"
);
Object
data1
=
infoRes
.
jsonPath
().
getJsonObject
(
"data
"
);
System
.
out
.
println
(
success
1
);
System
.
out
.
println
(
data
1
);
Assert
.
assert
True
(
success1
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
response
.
body
().
asString
()));
Assert
.
assert
NotNull
(
data1
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_info
,
"已登录查询分享人头像昵称失败"
,
infoRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取绑定结果和绑定凭证"
,
priority
=
10
)
//预约,不增加翻牌机会
public
void
获取绑定结果和绑定凭证
()
{
@Test
(
description
=
"翻牌集字_预约"
,
priority
=
11
)
public
void
翻牌集字
_
预约
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"bizType"
,
1
);
params
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"markIds"
,
Collections
.
singleton
(
144
));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_appointment
);
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
visitorAuth22
();
System
.
out
.
println
(
data
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_appointment
,
"预约失败"
,
response
.
body
().
asString
()));
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
visitorAuth25
();
visitorAuth22
();
Response
response
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
ThreadSleepUtils
.
sleep
(
2000
);
Integer
type1
=
response
.
jsonPath
().
getInt
(
"data.type"
);
Response
appointmentRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_appointment
);
System
.
out
.
println
(
type1
);
boolean
data1
=
appointmentRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
type1
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_appointment
,
"预约失败"
,
appointmentRes
.
body
().
asString
()));
}
}
//关注,增加翻牌机会
@Test
(
description
=
"翻牌集字_关注"
,
priority
=
12
)
public
void
翻牌集字
_
关注
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List
list
=
new
ArrayList
<>();
list
.
add
(
146
);
list
.
add
(
144
);
params
.
put
(
"markIds"
,
list
);
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
response
.
body
().
asString
()));
@Test
(
description
=
"已登录查询分享人头像昵称"
,
priority
=
11
)
public
void
已登录查询分享人头像昵称
()
{
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
12
);
//infoParam.put("confId",this.redConfId);
visitorAuth22
();
visitorAuth22
();
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_info
);
ThreadSleepUtils
.
sleep
(
2000
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Response
subscribeRes
=
network
.
postResponse
(
params
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data1
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
USER_SUBSCRIBE
,
"预约失败"
,
subscribeRes
.
body
().
asString
()));
}
//翻牌,关注和3次的免费次数
@Test
(
description
=
"翻牌"
,
priority
=
13
)
public
void
翻牌
()
{
for
(
int
i
=
0
;
i
<
4
;
i
++){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"turnType"
,
1
);
//1-活动页翻牌,2-助力翻牌
params
.
put
(
"pos"
,
i
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth9
();
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_turn
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_info
,
"已登录查询分享人头像昵称
失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turn
,
"翻牌开启
失败"
,
response
.
body
().
asString
()));
visitorAuth25
();
ThreadSleepUtils
.
sleep
(
5000
);
Response
infoRes
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_info
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"turnType"
,
1
);
infoParam
.
put
(
"pos"
,
i
);
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
infoRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Object
data1
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data1
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
System
.
out
.
println
(
data1
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_info
,
"已登录查询分享人头像昵称
失败"
,
infoRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turnState
,
"用户H翻牌参与详情查询
失败"
,
infoRes
.
body
().
asString
()));
visitorAuth22
();
Response
turnRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_turn
);
boolean
data2
=
turnRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data2
);
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turn
,
"翻牌开启失败"
,
turnRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
turnStateParam
=
new
HashMap
<>();
turnStateParam
.
put
(
"turnType"
,
1
);
turnStateParam
.
put
(
"pos"
,
i
);
turnStateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
turnStateParamRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Object
data3
=
turnStateParamRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data3
);
Assert
.
assertNotNull
(
data3
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turnState
,
"用户H翻牌参与详情查询失败"
,
turnStateParamRes
.
body
().
asString
()));
}
}
}
@Test
(
description
=
"访客H获得助力"
,
priority
=
12
)
public
void
访客
H
获得助力
()
{
@Test
(
description
=
"访客H完成首邀助力"
,
priority
=
14
)
public
void
访客
H
完成首邀助力
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
visitorAuth22
();
visitorAuth22
();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareType"
,
12
);
params
.
put
(
"shareType"
,
12
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_popupDetail
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_popupDetail
);
// System.out.println(response.body().asString());
String
helpImg
=
response
.
jsonPath
().
getString
(
"data.currentPopup.helpImg"
);
String
helpImg
=
response
.
jsonPath
().
getString
(
"data.currentPopup.helpImg"
);
Assert
.
assertNotNull
(
helpImg
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_popupDetail
,
"助力弹窗为null"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
helpImg
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_popupDetail
,
"助力弹窗为null"
,
response
.
body
().
asString
()));
...
@@ -320,34 +300,25 @@ public class FlipCard implements Authorization {
...
@@ -320,34 +300,25 @@ public class FlipCard implements Authorization {
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户V给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户V给用户H助力失败"
,
response
.
body
().
asString
()));
visitorAuth25
();
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
boolean
data1
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户S给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客V分享直播间"
,
priority
=
15
)
public
void
访客
V
分享直播间
()
{
@Test
(
description
=
"访客S分享直播间"
,
priority
=
13
)
public
void
访客
S
分享直播间
()
{
visitorAuth22
();
visitorAuth22
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareType"
,
2
);
params
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_sign
);
Response
signRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
shareSign
=
data
;
shareSign
V
=
data
;
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
V
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
V
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客V完成首邀助力"
,
priority
=
16
)
@Test
(
description
=
"访客S获得助力"
,
priority
=
14
)
public
void
访客
V
完成首邀助力
()
{
public
void
访客
S
获得助力
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareSign"
,
shareSign
);
params
.
put
(
"shareSign"
,
shareSign
V
);
params
.
put
(
"shareType"
,
12
);
params
.
put
(
"shareType"
,
12
);
//params.put("confId",this.redConfId);
//params.put("confId",this.redConfId);
...
@@ -355,67 +326,48 @@ public class FlipCard implements Authorization {
...
@@ -355,67 +326,48 @@ public class FlipCard implements Authorization {
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户H给用户S助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户H给用户V助力失败"
,
response
.
body
().
asString
()));
visitorAuth
();
Response
assistRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
boolean
data1
=
assistRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户A给用户S助力失败"
,
response
.
body
().
asString
()));
}
}
//签到
@Test
(
description
=
"查询用户邀请详情"
,
priority
=
17
)
@Test
(
description
=
"用户签到"
,
priority
=
15
)
public
void
查询用户邀请详情
(){
public
void
用户签到
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"markIds"
,
Collections
.
singleton
(
149
));
visitorAuth9
();
visitorAuth9
();
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_checkIn
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_helpDetail
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
int
helpNum
=
response
.
jsonPath
().
getInt
(
"data.helpNum"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
helpNum
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"助力用户数为null"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_checkIn
,
"用户签到失败"
,
response
.
body
().
asString
()));
visitorAuth22
();
visitorAuth22
();
Response
checkinRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_checkIn
);
Response
response22
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_helpDetail
);
boolean
data1
=
checkinRes
.
jsonPath
().
getBoolean
(
"data"
);
int
helpNum22
=
response
.
jsonPath
().
getInt
(
"data.helpNum"
);
System
.
out
.
println
(
checkinRes
.
body
().
asString
());
Assert
.
assertTrue
(
helpNum22
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"助力用户数为null"
,
response22
.
body
().
asString
()));
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_checkIn
,
"用户签到失败"
,
checkinRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询用户翻牌剩余次数"
,
priority
=
18
)
public
void
查询用户翻牌剩余次数
()
{
//预约
ThreadSleepUtils
.
sleep
(
1000
);
@Test
(
description
=
"翻牌集字_预约"
,
priority
=
16
)
public
void
翻牌集字
_
预约
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"bizType"
,
1
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"markIds"
,
Collections
.
singleton
(
144
));
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_record
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_appointment
);
System
.
out
.
println
(
response
.
body
().
asString
()
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data
"
);
int
leftNum
=
response
.
jsonPath
().
getJsonObject
(
"data.leftNum
"
);
System
.
out
.
println
(
data
);
//完成首邀后获得两次翻牌机会
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_appointment
,
"预约失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
leftNum
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足
"
,
response
.
body
().
asString
()));
visitorAuth22
();
visitorAuth22
();
ThreadSleepUtils
.
sleep
(
2000
);
Response
recordRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_record
);
Response
appointmentRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_appointment
);
System
.
out
.
println
(
recordRes
.
body
().
asString
()
);
boolean
data1
=
appointmentRes
.
jsonPath
().
getBoolean
(
"data
"
);
int
leftNum1
=
response
.
jsonPath
().
getJsonObject
(
"data.leftNum
"
);
System
.
out
.
println
(
data1
);
//完成首邀后获得两次翻牌机会
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_appointment
,
"预约失败"
,
appointment
Res
.
body
().
asString
()));
Assert
.
assertTrue
(
leftNum1
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足"
,
record
Res
.
body
().
asString
()));
}
}
@Test
(
description
=
"用户完成任务情况"
,
priority
=
19
)
@Test
(
description
=
"用户完成任务情况"
,
priority
=
17
)
public
void
用户完成任务情况
()
{
public
void
用户完成任务情况
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -423,55 +375,116 @@ public class FlipCard implements Authorization {
...
@@ -423,55 +375,116 @@ public class FlipCard implements Authorization {
visitorAuth9
();
visitorAuth9
();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_tasks
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_tasks
);
System
.
out
.
println
(
response
.
body
().
asString
());
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
checkInStatus
=
response
.
jsonPath
().
getBoolean
(
"data.checkInStatus"
);
Assert
.
assertTrue
(
checkInStatus
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"签到未完成"
,
response
.
body
().
asString
()));
boolean
appointmentStatus
=
response
.
jsonPath
().
getBoolean
(
"data.appointmentStatus"
);
boolean
appointmentStatus
=
response
.
jsonPath
().
getBoolean
(
"data.appointmentStatus"
);
Assert
.
assertTrue
(
appointmentStatus
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"预约失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
appointmentStatus
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"预约失败"
,
response
.
body
().
asString
()));
int
helpNum
=
response
.
jsonPath
().
getInt
(
"data.helpNum"
);
int
helpNum
=
response
.
jsonPath
().
getInt
(
"data.helpNum"
);
Assert
.
assertTrue
(
helpNum
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"助力用户数为null"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
helpNum
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"助力用户数为null"
,
response
.
body
().
asString
()));
boolean
subscribeStatus
=
response
.
jsonPath
().
getBoolean
(
"data.subscribeStatus"
);
Assert
.
assertTrue
(
subscribeStatus
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"关注失败"
,
response
.
body
().
asString
()));
visitorAuth22
();
visitorAuth22
();
Response
tasksRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_tasks
);
Response
tasksRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_tasks
);
System
.
out
.
println
(
tasksRes
.
body
().
asString
());
System
.
out
.
println
(
tasksRes
.
body
().
asString
());
boolean
checkInStatus1
=
tasksRes
.
jsonPath
().
getBoolean
(
"data.checkInStatus"
);
Assert
.
assertTrue
(
checkInStatus1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"签到未完成"
,
tasksRes
.
body
().
asString
()));
boolean
appointmentStatus1
=
tasksRes
.
jsonPath
().
getBoolean
(
"data.appointmentStatus"
);
boolean
appointmentStatus1
=
tasksRes
.
jsonPath
().
getBoolean
(
"data.appointmentStatus"
);
Assert
.
assertTrue
(
appointmentStatus1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"预约失败"
,
tasksRes
.
body
().
asString
()));
Assert
.
assertTrue
(
appointmentStatus1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"预约失败"
,
tasksRes
.
body
().
asString
()));
int
helpNum1
=
tasksRes
.
jsonPath
().
getInt
(
"data.helpNum"
);
int
helpNum1
=
tasksRes
.
jsonPath
().
getInt
(
"data.helpNum"
);
Assert
.
assertTrue
(
helpNum1
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"助力用户数为null"
,
tasksRes
.
body
().
asString
()));
Assert
.
assertTrue
(
helpNum1
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"助力用户数为null"
,
tasksRes
.
body
().
asString
()));
boolean
subscribeStatus22
=
tasksRes
.
jsonPath
().
getBoolean
(
"data.subscribeStatus"
);
Assert
.
assertTrue
(
subscribeStatus22
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_tasks
,
"关注失败"
,
tasksRes
.
body
().
asString
()));
}
}
//用户H、V首邀后翻牌
@Test
(
description
=
"查询用户翻牌剩余次数"
,
priority
=
18
)
@Test
(
description
=
"首邀翻牌"
,
priority
=
20
)
public
void
查询用户翻牌剩余次数
()
{
public
void
首邀翻牌
()
{
for
(
int
i
=
4
;
i
<
6
;
i
++)
{
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"turnType"
,
1
);
//1-活动页翻牌,2-助力翻牌
params
.
put
(
"pos"
,
i
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth9
();
visitorAuth9
();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_record
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_turn
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
int
leftNum
=
response
.
jsonPath
().
getJsonObject
(
"data.leftNum"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
leftNum
==
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turn
,
"翻牌开启失败"
,
response
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"turnType"
,
1
);
infoParam
.
put
(
"pos"
,
i
);
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
infoRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Object
data1
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turnState
,
"用户H翻牌参与详情查询失败"
,
infoRes
.
body
().
asString
()));
visitorAuth22
();
visitorAuth22
();
Response
recordRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_record
);
Response
turnRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_turn
);
System
.
out
.
println
(
recordRes
.
body
().
asString
());
boolean
data2
=
turnRes
.
jsonPath
().
getBoolean
(
"data"
);
int
leftNum1
=
response
.
jsonPath
().
getJsonObject
(
"data.leftNum"
);
System
.
out
.
println
(
data2
);
Assert
.
assertTrue
(
leftNum1
==
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足"
,
recordRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turn
,
"翻牌开启失败"
,
turnRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
turnStateParam
=
new
HashMap
<>();
turnStateParam
.
put
(
"turnType"
,
1
);
turnStateParam
.
put
(
"pos"
,
i
);
turnStateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
turnStateParamRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Object
data3
=
turnStateParamRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data3
);
Assert
.
assertNotNull
(
data3
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turnState
,
"用户V翻牌参与详情查询失败"
,
turnStateParamRes
.
body
().
asString
()));
}
}
}
//管理后台红包等级I、II的"进行中"红包个数为1,用户弹出天降幸运任务即占一个红包库存
@Test
(
description
=
"获取进行中的红包个数"
,
priority
=
21
)
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_detailV2
);
Object
stockNum1
=
response
.
jsonPath
().
getJsonObject
(
"data.stepReds.get(0).stockNum"
);
Object
stockNum2
=
response
.
jsonPath
().
getJsonObject
(
"data.stepReds.get(1).stockNum"
);
Assert
.
assertEquals
(
stockNum1
,
1
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_detailV2
,
"访客H占用红包库存失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
stockNum2
,
1
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_detailV2
,
"访客V占用红包库存失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"翻牌"
,
priority
=
19
)
@Test
(
description
=
"访客H获得第二次助力"
,
priority
=
22
)
public
void
翻牌
()
{
public
void
访客
H
获得第二次助力
()
{
for
(
int
i
=
0
;
i
<
6
;
i
++){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
visitorAuth25
();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareSign"
,
shareSign
);
params
.
put
(
"shareType"
,
12
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
boolean
data1
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户S给用户H助力失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客V获得第二次助力"
,
priority
=
23
)
public
void
访客
V
获得第二次助力
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareSign"
,
shareSignV
);
params
.
put
(
"shareType"
,
12
);
//params.put("confId",this.redConfId);
visitorAuth1
();
Response
assistRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_assist
);
boolean
data1
=
assistRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户A给用户V助力失败"
,
assistRes
.
body
().
asString
()));
}
//用户H、V天降幸运翻牌
@Test
(
description
=
"天降幸运翻牌"
,
priority
=
24
)
public
void
天降幸运翻牌
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"turnType"
,
1
);
//1-活动页翻牌,2-助力翻牌
params
.
put
(
"turnType"
,
1
);
//1-活动页翻牌,2-助力翻牌
params
.
put
(
"pos"
,
i
);
params
.
put
(
"pos"
,
6
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth9
();
visitorAuth9
();
...
@@ -483,7 +496,7 @@ public class FlipCard implements Authorization {
...
@@ -483,7 +496,7 @@ public class FlipCard implements Authorization {
ThreadSleepUtils
.
sleep
(
5000
);
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"turnType"
,
1
);
infoParam
.
put
(
"turnType"
,
1
);
infoParam
.
put
(
"pos"
,
i
);
infoParam
.
put
(
"pos"
,
6
);
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
infoRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Response
infoRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Object
data1
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data1
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
...
@@ -499,19 +512,16 @@ public class FlipCard implements Authorization {
...
@@ -499,19 +512,16 @@ public class FlipCard implements Authorization {
ThreadSleepUtils
.
sleep
(
5000
);
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
turnStateParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
turnStateParam
=
new
HashMap
<>();
turnStateParam
.
put
(
"turnType"
,
1
);
turnStateParam
.
put
(
"turnType"
,
1
);
turnStateParam
.
put
(
"pos"
,
i
);
turnStateParam
.
put
(
"pos"
,
6
);
turnStateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
turnStateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
turnStateParamRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Response
turnStateParamRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_turnState
);
Object
data3
=
turnStateParamRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data3
=
turnStateParamRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data3
);
System
.
out
.
println
(
data3
);
Assert
.
assertNotNull
(
data3
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turnState
,
"用户H
翻牌参与详情查询失败"
,
turnStateParamRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data3
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turnState
,
"用户V
翻牌参与详情查询失败"
,
turnStateParamRes
.
body
().
asString
()));
}
}
}
@Test
(
description
=
"用户参与翻牌详情"
,
priority
=
25
)
@Test
(
description
=
"用户参与翻牌详情"
,
priority
=
20
)
public
void
用户参与翻牌详情
()
{
public
void
用户参与翻牌详情
()
{
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -523,7 +533,10 @@ public class FlipCard implements Authorization {
...
@@ -523,7 +533,10 @@ public class FlipCard implements Authorization {
int
finishStatus
=
response
.
jsonPath
().
getInt
(
"data.finishStatus"
);
int
finishStatus
=
response
.
jsonPath
().
getInt
(
"data.finishStatus"
);
Assert
.
assertTrue
(
finishStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"未完成集字"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
finishStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"未完成集字"
,
response
.
body
().
asString
()));
int
flipNum
=
response
.
jsonPath
().
getInt
(
"data.flipNum"
);
int
flipNum
=
response
.
jsonPath
().
getInt
(
"data.flipNum"
);
Assert
.
assertTrue
(
flipNum
==
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足5次"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
flipNum
==
7
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足7次"
,
response
.
body
().
asString
()));
//获取天降幸运信息
Object
luckyDetail
=
response
.
jsonPath
().
getJsonObject
(
"data.luckyDetail"
);
Assert
.
assertNotNull
(
luckyDetail
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"天降幸运信息记录错误"
,
response
.
body
().
asString
()));
visitorAuth22
();
visitorAuth22
();
...
@@ -532,11 +545,25 @@ public class FlipCard implements Authorization {
...
@@ -532,11 +545,25 @@ public class FlipCard implements Authorization {
int
finishStatus1
=
recordRes
.
jsonPath
().
getInt
(
"data.finishStatus"
);
int
finishStatus1
=
recordRes
.
jsonPath
().
getInt
(
"data.finishStatus"
);
Assert
.
assertTrue
(
finishStatus1
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"未完成集字"
,
recordRes
.
body
().
asString
()));
Assert
.
assertTrue
(
finishStatus1
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"未完成集字"
,
recordRes
.
body
().
asString
()));
int
flipNum1
=
recordRes
.
jsonPath
().
getInt
(
"data.flipNum"
);
int
flipNum1
=
recordRes
.
jsonPath
().
getInt
(
"data.flipNum"
);
Assert
.
assertTrue
(
flipNum1
==
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足5次"
,
recordRes
.
body
().
asString
()));
Assert
.
assertTrue
(
flipNum1
==
7
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足7次"
,
recordRes
.
body
().
asString
()));
//获取天降幸运信息
Object
luckyDetail22
=
recordRes
.
jsonPath
().
getJsonObject
(
"data.luckyDetail"
);
Assert
.
assertNotNull
(
luckyDetail22
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"天降幸运信息记录错误"
,
recordRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取天降幸运信息"
,
priority
=
26
)
public
void
获取天降幸运信息
(){
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_userLucky
);
int
luckyStatus
=
response
.
jsonPath
().
getInt
(
"data.luckyStatus"
);
Assert
.
assertTrue
(
luckyStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_userLucky
,
"天降幸运状态错误"
,
response
.
body
().
asString
()));
int
luckyCardCount
=
response
.
jsonPath
().
getInt
(
"data.luckyCardCount"
);
Assert
.
assertTrue
(
luckyCardCount
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_userLucky
,
"天降幸运状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"翻牌集字领取历史记录"
,
priority
=
2
1
)
@Test
(
description
=
"翻牌集字领取历史记录"
,
priority
=
2
7
)
public
void
翻牌集字领取历史记录
()
{
public
void
翻牌集字领取历史记录
()
{
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -560,7 +587,7 @@ public class FlipCard implements Authorization {
...
@@ -560,7 +587,7 @@ public class FlipCard implements Authorization {
//开红包
//开红包
@Test
(
description
=
"用户开红包资格查询"
,
priority
=
2
2
)
@Test
(
description
=
"用户开红包资格查询"
,
priority
=
2
8
)
public
void
用户开红包资格查询
()
{
public
void
用户开红包资格查询
()
{
ThreadSleepUtils
.
sleep
(
5000
);
ThreadSleepUtils
.
sleep
(
5000
);
...
@@ -577,24 +604,9 @@ public class FlipCard implements Authorization {
...
@@ -577,24 +604,9 @@ public class FlipCard implements Authorization {
System
.
out
.
println
(
finishRes
.
body
().
asString
());
System
.
out
.
println
(
finishRes
.
body
().
asString
());
int
status1
=
finishRes
.
jsonPath
().
getInt
(
"data.status"
);
int
status1
=
finishRes
.
jsonPath
().
getInt
(
"data.status"
);
Assert
.
assertTrue
(
status1
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finishStatus
,
"未完成集字"
,
finishRes
.
body
().
asString
()));
Assert
.
assertTrue
(
status1
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finishStatus
,
"未完成集字"
,
finishRes
.
body
().
asString
()));
}
}
// @Test(description = "放弃开红包", priority = 23)
// public void 放弃开红包() {
// visitorAuth22();
// ThreadSleepUtils.sleep(1000);
// Map<String, Object> params = new HashMap<>();
// params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// Response response = network.postResponse(params, BasicConfig.MOBILE_abort);
// System.out.println(response.body().asString());
// boolean data =response.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString()));
//
// }
@Test
(
description
=
"开红包"
,
priority
=
29
)
@Test
(
description
=
"开红包"
,
priority
=
24
)
public
void
开红包
()
{
public
void
开红包
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -613,7 +625,7 @@ public class FlipCard implements Authorization {
...
@@ -613,7 +625,7 @@ public class FlipCard implements Authorization {
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpen
,
"开红包失败"
,
response2
.
body
().
asString
()));
Assert
.
assertTrue
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_redOpen
,
"开红包失败"
,
response2
.
body
().
asString
()));
}
}
@Test
(
description
=
"用户开红包状态查询"
,
priority
=
25
)
@Test
(
description
=
"用户开红包状态查询"
,
priority
=
30
)
public
void
用户开红包状态查询
()
{
public
void
用户开红包状态查询
()
{
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -639,7 +651,7 @@ public class FlipCard implements Authorization {
...
@@ -639,7 +651,7 @@ public class FlipCard implements Authorization {
}
}
//开启不同等级的红包
//开启不同等级的红包
@Test
(
description
=
"开红包结果"
,
priority
=
26
)
@Test
(
description
=
"开红包结果"
,
priority
=
31
)
public
void
开红包结果
()
{
public
void
开红包结果
()
{
//红包等级I
//红包等级I
visitorAuth9
();
visitorAuth9
();
...
@@ -666,15 +678,15 @@ public class FlipCard implements Authorization {
...
@@ -666,15 +678,15 @@ public class FlipCard implements Authorization {
}
}
@Test
(
description
=
"翻牌集字配置详情"
,
priority
=
27
)
//验证管理后台发放的红包个数
public
void
翻牌集字配置详情
(){
@Test
(
description
=
"获取已发放的红包个数"
,
priority
=
32
)
visitorAuth9
();
public
void
获取已发放的红包个数
(){
Map
<
String
,
Object
>
p
arams
=
new
HashMap
<>();
Map
<
String
,
Object
>
P
arams
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_
LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_conf
V2
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_detail
V2
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data
"
);
Object
receiveNum1
=
response
.
jsonPath
().
getJsonObject
(
"data.stepReds.get(0).receiveNum
"
);
String
titleImage
=
response
.
jsonPath
().
getString
(
"data.titleImage
"
);
Object
receiveNum2
=
response
.
jsonPath
().
getJsonObject
(
"data.stepReds.get(1).receiveNum
"
);
Assert
.
assert
NotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"翻牌配置详情查询失败
"
,
response
.
body
().
asString
()));
Assert
.
assert
Equals
(
receiveNum1
,
1
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_detailV2
,
"访客H发放红包记录错误
"
,
response
.
body
().
asString
()));
Assert
.
assert
Null
(
titleImage
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_confV2
,
"获取默认标题配图失败
"
,
response
.
body
().
asString
()));
Assert
.
assert
Equals
(
receiveNum2
,
1
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_detailV2
,
"访客V发放红包记录错误
"
,
response
.
body
().
asString
()));
}
}
}
}
\ No newline at end of file
src/test/java/com/kjj/cases/live/guess/LiveGuess.java
View file @
c8539426
...
@@ -145,7 +145,6 @@ public class LiveGuess implements Authorization {
...
@@ -145,7 +145,6 @@ public class LiveGuess implements Authorization {
userDetailParam
.
put
(
"confId"
,
ConfId
);
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第1次参与猜数字红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第1次参与猜数字红包失败"
,
response
.
body
().
asString
()));
this
.
guessMaxNum
=(
Integer
)
data
.
get
(
"guessMaxNum"
);
this
.
guessMaxNum
=(
Integer
)
data
.
get
(
"guessMaxNum"
);
this
.
guessMinNum
=
(
Integer
)
data
.
get
(
"guessMinNum"
);
this
.
guessMinNum
=
(
Integer
)
data
.
get
(
"guessMinNum"
);
...
...
src/test/java/com/kjj/cases/live/liveConfig/Comment.java
View file @
c8539426
package
com
.
kjj
.
cases
.
live
.
liveConfig
;
package
com
.
kjj
.
cases
.
live
.
liveConfig
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.issue.SpokeList
;
import
com.kjj.bean.issue.SpokeList
;
import
com.kjj.bean.issue.Spolist
;
import
com.kjj.bean.issue.Spolist
;
import
com.kjj.bean.issue.VoList
;
import
com.kjj.bean.issue.VoList
;
...
@@ -49,7 +48,7 @@ public class Comment implements Authorization {
...
@@ -49,7 +48,7 @@ public class Comment implements Authorization {
//访客端
//访客端
@Test
(
description
=
"访客A发表评论"
,
priority
=
2
)
@Test
(
description
=
"访客A发表评论"
,
priority
=
2
)
public
void
访客
A
发表评论
()
{
public
void
访客
A
发表评论
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"希望能好运"
);
Params
.
put
(
"msg"
,
"希望能好运"
);
...
@@ -126,7 +125,7 @@ public class Comment implements Authorization {
...
@@ -126,7 +125,7 @@ public class Comment implements Authorization {
@Test
(
description
=
"访客A获取历史所有评论"
,
priority
=
8
)
@Test
(
description
=
"访客A获取历史所有评论"
,
priority
=
8
)
public
void
访客
A
获取历史所有评论
()
{
public
void
访客
A
获取历史所有评论
()
{
visitorAuth
();
visitorAuth
1
();
sleep
(
20000
);
sleep
(
20000
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -146,7 +145,7 @@ public class Comment implements Authorization {
...
@@ -146,7 +145,7 @@ public class Comment implements Authorization {
@Test
(
description
=
"访客A获取实时评论"
,
priority
=
9
)
@Test
(
description
=
"访客A获取实时评论"
,
priority
=
9
)
public
void
访客
A
获取实时评论
()
{
public
void
访客
A
获取实时评论
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"time"
,
time
);
Params
.
put
(
"time"
,
time
);
...
...
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
0 → 100644
View file @
c8539426
package
com
.
kjj
.
cases
.
live
.
liveConfig
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
MOBILE_binding
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
MOBILE_sign
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
public
class
LiveBinding
implements
Authorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
public
String
shareSign
=
null
;
public
void
binding
(
String
shareParam
)
{
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareParam
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
public
void
token
()
{
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
public
String
share
()
{
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
return
data
;
}
/**
* 添加代理人绑定关系
*/
@Test
(
description
=
"代理人绑定"
,
priority
=
1
)
public
void
代理人绑定
()
{
agentAuth
();
binding
(
this
.
shareSign
);;
agentAuth1
();
binding
(
this
.
shareSign
);;
}
@Test
(
description
=
"代理人A分享直播间"
,
priority
=
2
)
public
void
代理人
A
分享直播间
()
{
agentAuth
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
3
)
public
void
代理人
A
与访客
A
邀请关系绑定
()
{
visitorAuth1
();
binding
(
this
.
shareSign
);
token
();
visitorAuth9
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth10
();
binding
(
this
.
shareSign
);;
token
();
}
//不同团队代理人绑定邀请关系
@Test
(
description
=
"代理人B分享直播间"
,
priority
=
4
)
public
void
代理人
B
分享直播间
()
{
agentAuth1
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"访客I关系绑定"
,
priority
=
5
)
public
void
访客
I
关系绑定
()
{
visitorAuth8
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客H分享直播间"
,
priority
=
6
)
public
void
访客
H
分享直播间
()
{
visitorAuth9
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"访客邀请关系绑定"
,
priority
=
7
)
public
void
访客邀请关系绑定
()
{
visitorAuth22
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth25
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth2
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth11
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth12
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth13
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth16
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth17
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客J_分享直播间"
,
priority
=
8
)
public
void
访客
J_
分享直播间
()
{
visitorAuth10
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"邀请Xmz关系绑定"
,
priority
=
9
)
public
void
邀请
Xmz
关系绑定
()
{
visitorAuth26
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客A_分享直播间"
,
priority
=
10
)
public
void
访客
A_
分享直播间
()
{
visitorAuth1
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"邀请C关系绑定"
,
priority
=
11
)
public
void
邀请
C
关系绑定
()
{
visitorAuth3
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客B直播中分享直播间"
,
priority
=
12
)
public
void
访客
B
直播中分享直播间
()
{
visitorAuth2
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"幸运任务邀请D关系绑定"
,
priority
=
13
)
public
void
幸运任务邀请
D
关系绑定
()
{
visitorAuth4
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth5
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth6
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth7
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客M获取分享加密串"
,
priority
=
14
)
public
void
访客
M
获取分享加密串
()
{
visitorAuth13
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"访客M与访客N邀请关系绑定"
,
priority
=
15
)
public
void
访客
M
与访客
N
邀请关系绑定
()
{
visitorAuth14
();
binding
(
this
.
shareSign
);;
token
();
visitorAuth18
();
binding
(
this
.
shareSign
);;
token
();
}
@Test
(
description
=
"访客N获取分享加密串"
,
priority
=
16
)
public
void
访客
N
获取分享加密串
()
{
visitorAuth14
();
this
.
shareSign
=
share
();
}
@Test
(
description
=
"访客N与访客O邀请关系绑定"
,
priority
=
17
)
public
void
访客
N
与访客
O
邀请关系绑定
()
{
visitorAuth15
();
binding
(
this
.
shareSign
);;
token
();
}
}
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
c8539426
...
@@ -1348,8 +1348,8 @@ public class SaveLive implements Authorization {
...
@@ -1348,8 +1348,8 @@ public class SaveLive implements Authorization {
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
ArrayList
<
Dialogue
>
dialogues
=
new
ArrayList
<>();
ArrayList
<
Dialogue
>
dialogues
=
new
ArrayList
<>();
dialogues
.
add
(
new
Dialogue
(
new
ArrayList
<>(
Arrays
.
asList
(
"一度问题1"
,
"一度问题2"
,
"一度问题3"
)),
"一度代理人结束语"
,
"一度代理人欢迎语"
,
"一度承诺标题"
,
"一度承诺
描述"
,
"一度承诺按钮文案"
,
"一度行动承诺
"
,
1
));
dialogues
.
add
(
new
Dialogue
(
new
ArrayList
<>(
Arrays
.
asList
(
"一度问题1"
,
"一度问题2"
,
"一度问题3"
)),
"一度代理人结束语"
,
"一度代理人欢迎语"
,
"一度承诺标题"
,
"一度承诺
按钮文案
"
,
1
));
dialogues
.
add
(
new
Dialogue
(
new
ArrayList
<>(
Arrays
.
asList
(
"二度问题1"
,
"二度问题2"
,
"二度问题3"
)),
"二度代理人结束语"
,
"二度代理人欢迎语"
,
"二度承诺标题"
,
"二度承诺
描述"
,
"二度承诺按钮文案"
,
"二度行动承诺
"
,
0
));
dialogues
.
add
(
new
Dialogue
(
new
ArrayList
<>(
Arrays
.
asList
(
"二度问题1"
,
"二度问题2"
,
"二度问题3"
)),
"二度代理人结束语"
,
"二度代理人欢迎语"
,
"二度承诺标题"
,
"二度承诺
按钮文案
"
,
0
));
Params
.
put
(
"dialogues"
,
dialogues
);
Params
.
put
(
"dialogues"
,
dialogues
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveDialogue
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveDialogue
);
System
.
out
.
println
(
Params
);
System
.
out
.
println
(
Params
);
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
c8539426
...
@@ -9,6 +9,7 @@ import com.kjj.utils.ThreadSleepUtils;
...
@@ -9,6 +9,7 @@ import com.kjj.utils.ThreadSleepUtils;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -16,6 +17,8 @@ import java.util.List;
...
@@ -16,6 +17,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
public
class
Lottery
implements
Authorization
{
public
class
Lottery
implements
Authorization
{
public
List
<
ConfIdList
>
List_ConfId
;
public
List
<
ConfIdList
>
List_ConfId
;
...
@@ -23,6 +26,19 @@ public class Lottery implements Authorization {
...
@@ -23,6 +26,19 @@ public class Lottery implements Authorization {
public
static
String
welfareName
;
public
static
String
welfareName
;
public
static
String
lotteryConfId
;
public
static
String
lotteryConfId
;
@BeforeClass
public
void
setUp
()
{
//代理人A/访客A/访客B到场
agentAuth
();
connectSuccess
();
visitorAuth1
();
connectSuccess
();
visitorAuth2
();
connectSuccess
();
}
@Test
(
description
=
"代理人抽奖活动弹层福利列表"
,
priority
=
1
)
@Test
(
description
=
"代理人抽奖活动弹层福利列表"
,
priority
=
1
)
public
void
抽奖活动弹层福利列表
()
{
public
void
抽奖活动弹层福利列表
()
{
agentAuth
();
agentAuth
();
...
@@ -46,31 +62,9 @@ public class Lottery implements Authorization {
...
@@ -46,31 +62,9 @@ public class Lottery implements Authorization {
Assert
.
assertNotNull
(
list
,
network
.
message
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
,
"抽奖标记为false"
,
getLiveAwardListRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
list
,
network
.
message
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
,
"抽奖标记为false"
,
getLiveAwardListRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A到场"
,
priority
=
3
)
public
void
访客
A
到场
()
{
visitorAuth
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客B到场"
,
priority
=
4
)
public
void
访客
B
到场
()
{
visitorAuth2
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客A抽奖查询抽奖活动弹层"
,
priority
=
5
)
@Test
(
description
=
"访客A抽奖查询抽奖活动弹层"
,
priority
=
5
)
public
void
访客
A
抽奖查询抽奖活动弹层
()
{
public
void
访客
A
抽奖查询抽奖活动弹层
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
listLiveLotterParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
listLiveLotterParam
=
new
HashMap
<>();
listLiveLotterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
listLiveLotterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
listLiveLotterRes
=
network
.
getResponse
(
listLiveLotterParam
,
BasicConfig
.
USER_listLiveLottery
);
Response
listLiveLotterRes
=
network
.
getResponse
(
listLiveLotterParam
,
BasicConfig
.
USER_listLiveLottery
);
...
@@ -94,7 +88,7 @@ public class Lottery implements Authorization {
...
@@ -94,7 +88,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"查询第一轮正在抽奖的福利"
,
priority
=
7
)
@Test
(
description
=
"查询第一轮正在抽奖的福利"
,
priority
=
7
)
public
void
查询第一轮正在抽奖的福利
()
{
public
void
查询第一轮正在抽奖的福利
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -150,7 +144,7 @@ public class Lottery implements Authorization {
...
@@ -150,7 +144,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客A查询抽奖是否结束"
,
priority
=
11
)
@Test
(
description
=
"访客A查询抽奖是否结束"
,
priority
=
11
)
public
void
访客
A
查询抽奖是否结束
()
{
public
void
访客
A
查询抽奖是否结束
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
hasEndParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
hasEndParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -178,7 +172,7 @@ public class Lottery implements Authorization {
...
@@ -178,7 +172,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客A查询是否中奖"
,
priority
=
13
)
@Test
(
description
=
"访客A查询是否中奖"
,
priority
=
13
)
public
void
访客
A
查询是否中奖
()
{
public
void
访客
A
查询是否中奖
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
hasEndParam
.
put
(
"confId"
,
this
.
List_ConfId
.
get
(
0
).
getWelfareConfId
());
hasEndParam
.
put
(
"confId"
,
this
.
List_ConfId
.
get
(
0
).
getWelfareConfId
());
...
@@ -186,7 +180,7 @@ public class Lottery implements Authorization {
...
@@ -186,7 +180,7 @@ public class Lottery implements Authorization {
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客
查询
中奖失败"
,
hasEndRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客中奖失败"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
throw
e
;
...
@@ -203,7 +197,7 @@ public class Lottery implements Authorization {
...
@@ -203,7 +197,7 @@ public class Lottery implements Authorization {
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客
查询
中奖失败"
,
hasEndRes
.
body
().
asString
()));
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客中奖失败"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
throw
e
;
...
@@ -213,7 +207,7 @@ public class Lottery implements Authorization {
...
@@ -213,7 +207,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"查看第一轮抽奖榜单"
,
priority
=
15
)
@Test
(
description
=
"查看第一轮抽奖榜单"
,
priority
=
15
)
public
void
查看第一轮抽奖榜单
()
{
public
void
查看第一轮抽奖榜单
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
pageListParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
pageListParam
=
new
HashMap
<>();
pageListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
pageListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -230,7 +224,7 @@ public class Lottery implements Authorization {
...
@@ -230,7 +224,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"获取第一轮喜报"
,
priority
=
16
)
@Test
(
description
=
"获取第一轮喜报"
,
priority
=
16
)
public
void
获取第一轮喜报
()
{
public
void
获取第一轮喜报
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
allLotteryNameParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
allLotteryNameParam
=
new
HashMap
<>();
allLotteryNameParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
allLotteryNameParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -244,7 +238,7 @@ public class Lottery implements Authorization {
...
@@ -244,7 +238,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"查询用户是否提交姓名"
,
priority
=
17
)
@Test
(
description
=
"查询用户是否提交姓名"
,
priority
=
17
)
public
void
查询用户是否提交姓名
()
{
public
void
查询用户是否提交姓名
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
locationResultParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
locationResultParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -257,7 +251,7 @@ public class Lottery implements Authorization {
...
@@ -257,7 +251,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"提交姓名"
,
priority
=
18
)
@Test
(
description
=
"提交姓名"
,
priority
=
18
)
public
void
提交姓名
()
{
public
void
提交姓名
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
submitInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
submitInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
submitInfoParam
.
put
(
"confId"
,
this
.
List_ConfId
.
get
(
0
).
getWelfareConfId
());
submitInfoParam
.
put
(
"confId"
,
this
.
List_ConfId
.
get
(
0
).
getWelfareConfId
());
...
@@ -272,7 +266,7 @@ public class Lottery implements Authorization {
...
@@ -272,7 +266,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客A_分享直播间"
,
priority
=
19
)
@Test
(
description
=
"访客A_分享直播间"
,
priority
=
19
)
public
void
访客
A_
分享直播间
()
{
public
void
访客
A_
分享直播间
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -282,76 +276,38 @@ public class Lottery implements Authorization {
...
@@ -282,76 +276,38 @@ public class Lottery implements Authorization {
this
.
shareSign
=
data
;
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"邀请C关系绑定"
,
priority
=
20
)
public
void
邀请
C
关系绑定
()
{
visitorAuth3
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"邀请C绑定结果和绑定凭证"
,
priority
=
22
)
public
void
邀请
C
绑定结果和绑定凭证
()
{
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客C关注直播间"
,
priority
=
24
)
public
void
访客
C
关注直播间
()
{
// 访客C/D/E/F/G到场
visitorAuth4
();
connectSuccess
();
@Test
(
description
=
"访客C到场"
,
priority
=
23
)
visitorAuth5
();
public
void
访客
C
到场
()
{
connectSuccess
();
visitorAuth3
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
visitorAuth6
();
connectSuccess
();
visitorAuth7
();
connectSuccess
();
@Test
(
description
=
"访客C关注直播间"
,
priority
=
24
)
public
void
访客
C
关注直播间
()
{
visitorAuth3
();
visitorAuth3
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
connectSuccess
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
subscribelive
();
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客C抽奖码数量"
,
priority
=
25
)
@Test
(
description
=
"访客C抽奖码数量"
,
priority
=
25
)
public
void
访客
C
抽奖码数量
()
{
public
void
访客
C
抽奖码数量
()
{
visitorAuth3
();
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
1000
);
codeCount
(
1
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
//好运红包
//好运红包
@Test
(
description
=
"分享者访客A获取好运红包"
,
priority
=
26
)
@Test
(
description
=
"分享者访客A获取好运红包"
,
priority
=
26
)
public
void
分享者访客
A
获取好运红包
()
{
public
void
分享者访客
A
获取好运红包
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"scene"
,
4
);
Params
.
put
(
"scene"
,
4
);
...
@@ -367,7 +323,7 @@ public class Lottery implements Authorization {
...
@@ -367,7 +323,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客A分享好运红包给访客B"
,
priority
=
27
)
@Test
(
description
=
"访客A分享好运红包给访客B"
,
priority
=
27
)
public
void
访客
A
分享好运红包给访客
B
()
{
public
void
访客
A
分享好运红包给访客
B
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"shareType"
,
11
);
Params
.
put
(
"shareType"
,
11
);
...
@@ -379,8 +335,8 @@ public class Lottery implements Authorization {
...
@@ -379,8 +335,8 @@ public class Lottery implements Authorization {
}
}
@Test
(
description
=
"访客
B获取好运红包领取记录
"
,
priority
=
28
)
@Test
(
description
=
"访客
M获取好运红包领取
"
,
priority
=
28
)
public
void
访客
B
获取好运红包领取记录
()
{
public
void
访客
M
获取好运红包领取
()
{
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
@@ -396,12 +352,12 @@ public class Lottery implements Authorization {
...
@@ -396,12 +352,12 @@ public class Lottery implements Authorization {
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MOBILE_receiveRecord
);
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MOBILE_receiveRecord
);
System
.
out
.
println
(
response
.
body
().
asString
());
System
.
out
.
println
(
response
.
body
().
asString
());
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_receiveRecord
,
"访客
B获取好运红包领取记录不
为空"
,
response
.
body
().
asString
()));
Assert
.
assertNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_receiveRecord
,
"访客
M获取好运红包领取记录
为空"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客
B
领取好运红包"
,
priority
=
29
)
@Test
(
description
=
"访客
M
领取好运红包"
,
priority
=
29
)
public
void
访客
B
领取好运红包
()
{
public
void
访客
M
领取好运红包
()
{
visitorAuth13
();
visitorAuth13
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -409,12 +365,12 @@ public class Lottery implements Authorization {
...
@@ -409,12 +365,12 @@ public class Lottery implements Authorization {
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_receiverOpen
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_receiverOpen
);
System
.
out
.
println
(
response
.
body
().
asString
());
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_receiverOpen
,
"访客
B
领取好运红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_receiverOpen
,
"访客
M
领取好运红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客
B
参与记录"
,
priority
=
30
)
@Test
(
description
=
"访客
M
参与记录"
,
priority
=
30
)
public
void
访客
B
参与记录
()
{
public
void
访客
M
参与记录
()
{
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
@@ -431,8 +387,8 @@ public class Lottery implements Authorization {
...
@@ -431,8 +387,8 @@ public class Lottery implements Authorization {
}
}
@Test
(
description
=
"访客
A
获取好运红包领取记录"
,
priority
=
31
)
@Test
(
description
=
"访客
M
获取好运红包领取记录"
,
priority
=
31
)
public
void
访客
A
获取好运红包领取记录
()
{
public
void
访客
M
获取好运红包领取记录
()
{
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
500
);
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
@@ -452,7 +408,7 @@ public class Lottery implements Authorization {
...
@@ -452,7 +408,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客A抽奖券列表"
,
priority
=
32
)
@Test
(
description
=
"访客A抽奖券列表"
,
priority
=
32
)
public
void
访客
A
抽奖券列表
()
{
public
void
访客
A
抽奖券列表
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -466,14 +422,8 @@ public class Lottery implements Authorization {
...
@@ -466,14 +422,8 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
33
)
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
33
)
public
void
访客
A
抽奖码数量
()
{
public
void
访客
A
抽奖码数量
()
{
visitorAuth
();
visitorAuth1
();
ThreadSleepUtils
.
sleep
(
500
);
codeCount
(
3
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
...
@@ -510,32 +460,6 @@ public class Lottery implements Authorization {
...
@@ -510,32 +460,6 @@ public class Lottery implements Authorization {
}
}
@Test
(
description
=
"幸运任务邀请D关系绑定"
,
priority
=
36
)
public
void
幸运任务邀请
D
关系绑定
()
{
visitorAuth4
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请D绑定结果和绑定凭证"
,
priority
=
37
)
public
void
幸运任务邀请
D
绑定结果和绑定凭证
()
{
visitorAuth4
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客D给访客B助力"
,
priority
=
38
)
@Test
(
description
=
"访客D给访客B助力"
,
priority
=
38
)
public
void
访客
D
给访客
B
助力
()
{
public
void
访客
D
给访客
B
助力
()
{
visitorAuth4
();
visitorAuth4
();
...
@@ -560,66 +484,18 @@ public class Lottery implements Authorization {
...
@@ -560,66 +484,18 @@ public class Lottery implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"访客D给访客B助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"访客D给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客D到场"
,
priority
=
39
)
public
void
访客
D
到场
()
{
visitorAuth4
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客D关注直播间"
,
priority
=
40
)
@Test
(
description
=
"访客D关注直播间"
,
priority
=
40
)
public
void
访客
D
关注直播间
()
{
public
void
访客
D
关注直播间
()
{
visitorAuth4
();
visitorAuth4
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribelive
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客D抽奖码数量"
,
priority
=
41
)
@Test
(
description
=
"访客D抽奖码数量"
,
priority
=
41
)
public
void
访客
D
抽奖码数量
()
{
public
void
访客
D
抽奖码数量
()
{
visitorAuth4
();
visitorAuth4
();
ThreadSleepUtils
.
sleep
(
500
);
codeCount
(
1
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"幸运任务邀请E关系绑定"
,
priority
=
42
)
public
void
幸运任务邀请
E
关系绑定
()
{
visitorAuth5
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请E绑定结果和绑定凭证"
,
priority
=
43
)
public
void
幸运任务邀请
E
绑定结果和绑定凭证
()
{
visitorAuth5
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客E给访客B助力"
,
priority
=
44
)
@Test
(
description
=
"访客E给访客B助力"
,
priority
=
44
)
public
void
访客
E
给访客
B
助力
()
{
public
void
访客
E
给访客
B
助力
()
{
visitorAuth5
();
visitorAuth5
();
...
@@ -635,64 +511,17 @@ public class Lottery implements Authorization {
...
@@ -635,64 +511,17 @@ public class Lottery implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客E给访客B助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客E给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客E到场"
,
priority
=
45
)
public
void
访客
E
到场
()
{
visitorAuth5
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客E关注直播间"
,
priority
=
46
)
@Test
(
description
=
"访客E关注直播间"
,
priority
=
46
)
public
void
访客
E
关注直播间
()
{
public
void
访客
E
关注直播间
()
{
visitorAuth5
();
visitorAuth5
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribelive
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客E抽奖码数量"
,
priority
=
47
)
@Test
(
description
=
"访客E抽奖码数量"
,
priority
=
47
)
public
void
访客
E
抽奖码数量
()
{
public
void
访客
E
抽奖码数量
()
{
visitorAuth5
();
visitorAuth5
();
ThreadSleepUtils
.
sleep
(
500
);
codeCount
(
1
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请F关系绑定"
,
priority
=
48
)
public
void
幸运任务邀请
F
关系绑定
()
{
visitorAuth6
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请F绑定结果和绑定凭证"
,
priority
=
49
)
public
void
幸运任务邀请
F
绑定结果和绑定凭证
()
{
visitorAuth6
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F给访客B助力"
,
priority
=
50
)
@Test
(
description
=
"访客F给访客B助力"
,
priority
=
50
)
...
@@ -710,75 +539,19 @@ public class Lottery implements Authorization {
...
@@ -710,75 +539,19 @@ public class Lottery implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客F给访客B助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客F给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F到场"
,
priority
=
51
)
public
void
访客
F
到场
()
{
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth6
();
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
agentAuth
();
Response
connectRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success1
=
connectRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success1
);
Assert
.
assertTrue
(
success1
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客F关注直播间"
,
priority
=
52
)
@Test
(
description
=
"访客F关注直播间"
,
priority
=
52
)
public
void
访客
F
关注直播间
()
{
public
void
访客
F
关注直播间
()
{
visitorAuth6
();
visitorAuth6
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribelive
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F抽奖码数量"
,
priority
=
53
)
@Test
(
description
=
"访客F抽奖码数量"
,
priority
=
53
)
public
void
访客
F
抽奖码数量
()
{
public
void
访客
F
抽奖码数量
()
{
visitorAuth6
();
visitorAuth6
();
ThreadSleepUtils
.
sleep
(
500
);
codeCount
(
1
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"幸运任务邀请G关系绑定"
,
priority
=
54
)
public
void
幸运任务邀请
G
关系绑定
()
{
visitorAuth7
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请G绑定结果和绑定凭证"
,
priority
=
55
)
public
void
幸运任务邀请
G
绑定结果和绑定凭证
()
{
visitorAuth7
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客G给访客B助力"
,
priority
=
56
)
@Test
(
description
=
"访客G给访客B助力"
,
priority
=
56
)
public
void
访客
G
给访客
B
助力
()
{
public
void
访客
G
给访客
B
助力
()
{
visitorAuth7
();
visitorAuth7
();
...
@@ -794,48 +567,18 @@ public class Lottery implements Authorization {
...
@@ -794,48 +567,18 @@ public class Lottery implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客G给访客B助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客G给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客G到场"
,
priority
=
57
)
public
void
访客
G
到场
()
{
visitorAuth7
();
//黑名单用户
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客G关注直播间"
,
priority
=
58
)
@Test
(
description
=
"访客G关注直播间"
,
priority
=
58
)
public
void
访客
G
关注直播间
()
{
public
void
访客
G
关注直播间
()
{
subscribelive
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth7
();
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
agentAuth
();
agentAuth
();
Response
response
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
subscribelive
();
boolean
data1
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客G抽奖码数量"
,
priority
=
59
)
@Test
(
description
=
"访客G抽奖码数量"
,
priority
=
59
)
public
void
访客
G
抽奖码数量
()
{
public
void
访客
G
抽奖码数量
()
{
visitorAuth7
();
visitorAuth7
();
ThreadSleepUtils
.
sleep
(
500
);
codeCount
(
1
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
...
@@ -876,14 +619,7 @@ public class Lottery implements Authorization {
...
@@ -876,14 +619,7 @@ public class Lottery implements Authorization {
@Test
(
description
=
"访客B的抽奖码数量"
,
priority
=
62
)
@Test
(
description
=
"访客B的抽奖码数量"
,
priority
=
62
)
public
void
访客
B
抽奖码数量
()
{
public
void
访客
B
抽奖码数量
()
{
visitorAuth2
();
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
3000
);
codeCount
(
17
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取访客B抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"开始第二轮抽奖"
,
priority
=
63
)
@Test
(
description
=
"开始第二轮抽奖"
,
priority
=
63
)
...
@@ -1133,110 +869,51 @@ public class Lottery implements Authorization {
...
@@ -1133,110 +869,51 @@ public class Lottery implements Authorization {
//第4轮团队指定份数
//第4轮团队指定份数
@Test
(
description
=
"不在指定团队访客H到场"
,
priority
=
77
)
public
void
访客
H
到场
()
{
visitorAuth9
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H关注直播间"
,
priority
=
78
)
@Test
(
description
=
"访客H关注直播间"
,
priority
=
78
)
public
void
访客
H
关注直播间
()
{
public
void
访客
H
关注直播间
()
{
//// 访客H/I/J到场
visitorAuth8
();
connectSuccess
();
visitorAuth10
();
connectSuccess
();
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
connectSuccess
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
subscribelive
();
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H抽奖码数量"
,
priority
=
79
)
@Test
(
description
=
"访客H抽奖码数量"
,
priority
=
79
)
public
void
访客
H
抽奖码数量
()
{
public
void
访客
H
抽奖码数量
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
codeCount
(
5
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"不在指定团队访客I到场"
,
priority
=
80
)
public
void
访客
I
到场
()
{
visitorAuth8
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客I关注直播间"
,
priority
=
81
)
@Test
(
description
=
"访客I关注直播间"
,
priority
=
81
)
public
void
访客
I
关注直播间
()
{
public
void
访客
I
关注直播间
()
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribelive
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客I抽奖码数量"
,
priority
=
82
)
@Test
(
description
=
"访客I抽奖码数量"
,
priority
=
82
)
public
void
访客
I
抽奖码数量
()
{
public
void
访客
I
抽奖码数量
()
{
visitorAuth8
();
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
1000
);
codeCount
(
1
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
@Test
(
description
=
"指定团队访客J到场"
,
priority
=
83
)
public
void
访客
J
到场
()
{
visitorAuth10
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客J关注直播间"
,
priority
=
84
)
@Test
(
description
=
"访客J关注直播间"
,
priority
=
84
)
public
void
访客
J
关注直播间
()
{
public
void
访客
J
关注直播间
()
{
visitorAuth10
();
visitorAuth10
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribelive
();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客J抽奖码数量"
,
priority
=
85
)
@Test
(
description
=
"访客J抽奖码数量"
,
priority
=
85
)
public
void
访客
J
抽奖码数量
()
{
public
void
访客
J
抽奖码数量
()
{
visitorAuth10
();
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
codeCount
(
3
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
...
@@ -1324,7 +1001,7 @@ public class Lottery implements Authorization {
...
@@ -1324,7 +1001,7 @@ public class Lottery implements Authorization {
Response
hasEndResA
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndResA
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
boolean
dataA
=
getData
(
hasEndResA
);
boolean
dataA
=
getData
(
hasEndResA
);
visitorAuth
();
visitorAuth
1
();
Response
hasEndResC
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndResC
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
boolean
dataC
=
getData
(
hasEndResC
);
boolean
dataC
=
getData
(
hasEndResC
);
...
@@ -1347,8 +1024,8 @@ public class Lottery implements Authorization {
...
@@ -1347,8 +1024,8 @@ public class Lottery implements Authorization {
//不在公司指定区域内的用户
//不在公司指定区域内的用户
@Test
(
description
=
"团队指定访客F是否中奖"
,
priority
=
92
)
@Test
(
description
=
"团队指定访客
非区域
F是否中奖"
,
priority
=
92
)
public
void
团队指定访客
F
是否中奖
()
{
public
void
非
团队指定访客
F
是否中奖
()
{
visitorAuth6
();
visitorAuth6
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
...
@@ -1450,7 +1127,7 @@ public class Lottery implements Authorization {
...
@@ -1450,7 +1127,7 @@ public class Lottery implements Authorization {
Response
hasEndResA
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndResA
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
boolean
dataA
=
getDataLottery
(
hasEndResA
);
boolean
dataA
=
getDataLottery
(
hasEndResA
);
visitorAuth
();
visitorAuth
1
();
Response
hasEndResC
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndResC
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
boolean
dataC
=
getData
(
hasEndResC
);
boolean
dataC
=
getData
(
hasEndResC
);
...
@@ -1458,7 +1135,7 @@ public class Lottery implements Authorization {
...
@@ -1458,7 +1135,7 @@ public class Lottery implements Authorization {
Response
hasEndResB
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndResB
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
boolean
dataB
=
getDataLottery
(
hasEndResB
);
boolean
dataB
=
getDataLottery
(
hasEndResB
);
String
responseBody
=
"A="
+
hasEndResA
.
body
().
asString
()
+
", B="
+
hasEndResB
.
body
().
asString
();
String
responseBody
=
"A="
+
hasEndResA
.
body
().
asString
()
+
", B="
+
hasEndResB
.
body
().
asString
();
Assert
.
assertTrue
(
dataA
||
dataB
||
dataC
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客未中奖"
,
responseBody
));
Assert
.
assertTrue
(
dataA
||
dataB
||
dataC
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客未中奖"
,
responseBody
));
}
}
...
...
src/test/java/com/kjj/cases/live/lottery/RelativeLottery.java
View file @
c8539426
...
@@ -25,7 +25,7 @@ public class RelativeLottery implements Authorization {
...
@@ -25,7 +25,7 @@ public class RelativeLottery implements Authorization {
@BeforeClass
@BeforeClass
public
void
setUp
(){
public
void
setUp
(){
visitorAuth
9
();
visitorAuth
10
();
}
}
@Test
(
description
=
"查询亲友配置开启状态"
,
priority
=
1
)
@Test
(
description
=
"查询亲友配置开启状态"
,
priority
=
1
)
...
@@ -42,7 +42,7 @@ public class RelativeLottery implements Authorization {
...
@@ -42,7 +42,7 @@ public class RelativeLottery implements Authorization {
@Test
(
description
=
"仅一度用户可以领取抽奖券"
,
priority
=
2
)
@Test
(
description
=
"仅一度用户可以领取抽奖券"
,
priority
=
2
)
public
void
仅一度用户可以领取抽奖券
()
{
public
void
仅一度用户可以领取抽奖券
()
{
visitorAuth
9
();
visitorAuth
10
();
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
MOBILE_confLottery
);
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
MOBILE_confLottery
);
...
@@ -52,7 +52,7 @@ public class RelativeLottery implements Authorization {
...
@@ -52,7 +52,7 @@ public class RelativeLottery implements Authorization {
int
receiverInfoList
=
response
.
jsonPath
().
getInt
(
"data.userDetail.receiverInfoList.size()"
);
int
receiverInfoList
=
response
.
jsonPath
().
getInt
(
"data.userDetail.receiverInfoList.size()"
);
int
lotteryNum
=
response
.
jsonPath
().
getInt
(
"data.confDetail.lotteryNum"
);
int
lotteryNum
=
response
.
jsonPath
().
getInt
(
"data.confDetail.lotteryNum"
);
Assert
.
assertEquals
(
isAcceptable
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"一度用户没有亲友券领取资格"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
isAcceptable
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"一度用户没有亲友券领取资格"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userAcceptStatus
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"一度用户
已领取亲友券"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userAcceptStatus
,
0
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"一度用户未预约
已领取亲友券"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverInfoList
,
0
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券已接受人数错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverInfoList
,
0
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券已接受人数错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
lotteryNum
,
3
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
lotteryNum
,
3
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券数量错误"
,
response
.
body
().
asString
()));
confId
=
response
.
jsonPath
().
getString
(
"data.confDetail.id"
);
confId
=
response
.
jsonPath
().
getString
(
"data.confDetail.id"
);
...
@@ -66,19 +66,35 @@ public class RelativeLottery implements Authorization {
...
@@ -66,19 +66,35 @@ public class RelativeLottery implements Authorization {
Assert
.
assertEquals
(
isAcceptable
,
0
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"非一度用户有亲友券领取资格"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
isAcceptable
,
0
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"非一度用户有亲友券领取资格"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客J预约直播间"
,
priority
=
3
)
public
void
访客
J
预约直播间
()
{
visitorAuth10
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
sycParam
.
put
(
"bizType"
,
1
);
List
<
Long
>
markIds1
=
new
ArrayList
<>();
markIds1
.
add
(
142L
);
markIds1
.
add
(
143L
);
markIds1
.
add
(
140L
);
sycParam
.
put
(
"markIds"
,
markIds1
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
);
Object
data
=
sycRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H收下抽奖券"
,
priority
=
3
)
@Test
(
description
=
"访客H收下抽奖券"
,
priority
=
4
)
public
void
访客
H
收下抽奖券
()
{
public
void
访客
J
收下抽奖券
()
{
visitorAuth
9
();
visitorAuth
10
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
MOBILE_acceptLottery
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
MOBILE_acceptLottery
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
MOBILE_acceptLottery
,
"
绑定
失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
MOBILE_acceptLottery
,
"
收下亲友券
失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客
H
_分享直播间"
,
priority
=
5
)
@Test
(
description
=
"访客
J
_分享直播间"
,
priority
=
5
)
public
void
访客
H
_
分享直播间
()
{
public
void
访客
J
_
分享直播间
()
{
sleep
(
1000
);
sleep
(
1000
);
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -103,8 +119,8 @@ public class RelativeLottery implements Authorization {
...
@@ -103,8 +119,8 @@ public class RelativeLottery implements Authorization {
Assert
.
assertEquals
(
mpShareTitle
,
"亲友抽奖券分享文案"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_helpInfo
,
"根据分享类型获取分享内容"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
mpShareTitle
,
"亲友抽奖券分享文案"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_helpInfo
,
"根据分享类型获取分享内容"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客
H
_获取小程序分享码"
,
priority
=
7
)
@Test
(
description
=
"访客
J
_获取小程序分享码"
,
priority
=
7
)
public
void
访客
H
_
获取小程序分享码
()
{
public
void
访客
J
_
获取小程序分享码
()
{
sleep
(
1000
);
sleep
(
1000
);
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -120,8 +136,8 @@ public class RelativeLottery implements Authorization {
...
@@ -120,8 +136,8 @@ public class RelativeLottery implements Authorization {
Assert
.
assertNotNull
(
qrCodeUrl
,
network
.
message
(
signParam
,
MOBILE_codeDetailLottery
,
"分享失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
qrCodeUrl
,
network
.
message
(
signParam
,
MOBILE_codeDetailLottery
,
"分享失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客
H
获取直播所有的订阅消息模板"
,
priority
=
8
)
@Test
(
description
=
"访客
J
获取直播所有的订阅消息模板"
,
priority
=
8
)
public
void
访客
H
获取直播所有的订阅消息模板
()
{
public
void
访客
J
获取直播所有的订阅消息模板
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"appid"
,
"wx4d7276f866bd24c8"
);
sycParam
.
put
(
"appid"
,
"wx4d7276f866bd24c8"
);
...
@@ -131,30 +147,6 @@ public class RelativeLottery implements Authorization {
...
@@ -131,30 +147,6 @@ public class RelativeLottery implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
,
"获取订阅消息失败"
,
sycRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
,
"获取订阅消息失败"
,
sycRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"邀请Xmz关系绑定"
,
priority
=
9
)
public
void
邀请
Xmz
关系绑定
()
{
visitorAuth26
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询访客Xmz绑定结果和绑定凭证"
,
priority
=
10
)
public
void
查询访客
Xmz
绑定结果和绑定凭证
()
{
visitorAuth26
();
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
boolean
success
=
tokenRes
.
jsonPath
().
getJsonObject
(
"success"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A预约直播间"
,
priority
=
11
)
@Test
(
description
=
"访客A预约直播间"
,
priority
=
11
)
public
void
访客
A
预约直播间
()
{
public
void
访客
A
预约直播间
()
{
visitorAuth26
();
visitorAuth26
();
...
@@ -172,8 +164,8 @@ public class RelativeLottery implements Authorization {
...
@@ -172,8 +164,8 @@ public class RelativeLottery implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客Xmz给访客
H
助力"
,
priority
=
12
)
@Test
(
description
=
"访客Xmz给访客
J
助力"
,
priority
=
12
)
public
void
访客
Xmz
给访客
H
助力
()
{
public
void
访客
Xmz
给访客
J
助力
()
{
visitorAuth26
();
visitorAuth26
();
sleep
(
2000
);
sleep
(
2000
);
//获取授权配置助力弹窗
//获取授权配置助力弹窗
...
@@ -198,13 +190,15 @@ public class RelativeLottery implements Authorization {
...
@@ -198,13 +190,15 @@ public class RelativeLottery implements Authorization {
@Test
(
description
=
"查询亲友券被领取1张"
,
priority
=
13
)
@Test
(
description
=
"查询亲友券被领取1张"
,
priority
=
13
)
public
void
查询亲友券被领取
1
张
()
{
public
void
查询亲友券被领取
1
张
()
{
visitorAuth
9
();
visitorAuth
10
();
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
MOBILE_confLottery
);
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
MOBILE_confLottery
);
System
.
out
.
println
(
response
.
body
().
asString
());
System
.
out
.
println
(
response
.
body
().
asString
());
int
userAcceptStatus
=
response
.
jsonPath
().
getInt
(
"data.userDetail.userAcceptStatus"
);
int
receiverInfoList
=
response
.
jsonPath
().
getInt
(
"data.userDetail.receiverInfoList.size()"
);
int
receiverInfoList
=
response
.
jsonPath
().
getInt
(
"data.userDetail.receiverInfoList.size()"
);
String
nickname
=
response
.
jsonPath
().
getString
(
"data.userDetail.receiverInfoList.get(0).nickname"
);
String
nickname
=
response
.
jsonPath
().
getString
(
"data.userDetail.receiverInfoList.get(0).nickname"
);
Assert
.
assertEquals
(
userAcceptStatus
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"一度用户未领取亲友券"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverInfoList
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券已接受人数错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverInfoList
,
1
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券已接受人数错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
nickname
,
"小米粥"
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券领取人错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
nickname
,
"小米粥"
,
network
.
message
(
getLiveAwardListParam
,
MOBILE_confLottery
,
"亲友配置券领取人错误"
,
response
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/cases/live/lotteryCode/LotteryCode.java
View file @
c8539426
...
@@ -13,50 +13,14 @@ import java.util.HashMap;
...
@@ -13,50 +13,14 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
codeCount
;
public
class
LotteryCode
implements
Authorization
{
public
class
LotteryCode
implements
Authorization
{
public
String
shareSign
;
public
String
shareSign
;
@Test
(
description
=
"代理人A分享直播间"
,
priority
=
1
)
@Test
(
description
=
"访客A获取直播所有的订阅消息模板"
,
priority
=
1
)
public
void
代理人
A
分享直播间
()
{
agentAuth
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
2
)
public
void
代理人
A
与访客
A
邀请关系绑定
()
{
visitorAuth
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取绑定结果和绑定凭证"
,
priority
=
3
)
public
void
访客
A
获取绑定结果和绑定凭证
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取直播所有的订阅消息模板"
,
priority
=
4
)
public
void
访客
A
获取直播所有的订阅消息模板
()
{
public
void
访客
A
获取直播所有的订阅消息模板
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"appid"
,
"wx4d7276f866bd24c8"
);
sycParam
.
put
(
"appid"
,
"wx4d7276f866bd24c8"
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
);
...
@@ -65,9 +29,9 @@ public class LotteryCode implements Authorization {
...
@@ -65,9 +29,9 @@ public class LotteryCode implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
,
"获取订阅消息失败"
,
sycRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
,
"获取订阅消息失败"
,
sycRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A预约直播间"
,
priority
=
5
)
@Test
(
description
=
"访客A预约直播间"
,
priority
=
2
)
public
void
访客
A
预约直播间
()
{
public
void
访客
A
预约直播间
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
sycParam
.
put
(
"bizType"
,
1
);
sycParam
.
put
(
"bizType"
,
1
);
...
@@ -82,9 +46,9 @@ public class LotteryCode implements Authorization {
...
@@ -82,9 +46,9 @@ public class LotteryCode implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A关注直播间"
,
priority
=
6
)
@Test
(
description
=
"访客A关注直播间"
,
priority
=
3
)
public
void
访客
A
关注直播间
()
{
public
void
访客
A
关注直播间
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List
<
Long
>
markIds2
=
new
ArrayList
<>();
List
<
Long
>
markIds2
=
new
ArrayList
<>();
...
@@ -97,9 +61,9 @@ public class LotteryCode implements Authorization {
...
@@ -97,9 +61,9 @@ public class LotteryCode implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A查询关注状态"
,
priority
=
7
)
@Test
(
description
=
"访客A查询关注状态"
,
priority
=
4
)
public
void
访客
A
查询关注状态
()
{
public
void
访客
A
查询关注状态
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
findParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
findParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
findRes
=
network
.
getResponse
(
findParam
,
BasicConfig
.
USER_FIND
);
Response
findRes
=
network
.
getResponse
(
findParam
,
BasicConfig
.
USER_FIND
);
...
@@ -109,9 +73,9 @@ public class LotteryCode implements Authorization {
...
@@ -109,9 +73,9 @@ public class LotteryCode implements Authorization {
}
}
@Test
(
description
=
"访客A保存海报获得抽奖码"
,
priority
=
8
)
@Test
(
description
=
"访客A保存海报获得抽奖码"
,
priority
=
5
)
public
void
访客
A
保存海报获得抽奖码
()
{
public
void
访客
A
保存海报获得抽奖码
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
savePosterRes
=
network
.
postResponse
(
savePosterParam
,
BasicConfig
.
USER_savePoster
);
Response
savePosterRes
=
network
.
postResponse
(
savePosterParam
,
BasicConfig
.
USER_savePoster
);
...
@@ -121,21 +85,15 @@ public class LotteryCode implements Authorization {
...
@@ -121,21 +85,15 @@ public class LotteryCode implements Authorization {
}
}
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
9
)
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
6
)
public
void
访客
A
抽奖码数量
()
{
public
void
访客
A
抽奖码数量
()
{
visitorAuth
();
visitorAuth1
();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
codeCount
(
3
);
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A查询抽奖券列表"
,
priority
=
10
)
@Test
(
description
=
"访客A查询抽奖券列表"
,
priority
=
7
)
public
void
访客
A
查询抽奖券列表
()
{
public
void
访客
A
查询抽奖券列表
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -145,104 +103,5 @@ public class LotteryCode implements Authorization {
...
@@ -145,104 +103,5 @@ public class LotteryCode implements Authorization {
Object
data
=
myLotteryCodeRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
myLotteryCodeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"查询用户自己的抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"查询用户自己的抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H关系绑定"
,
priority
=
11
)
public
void
访客
H
关系绑定
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H绑定结果和绑定凭证"
,
priority
=
12
)
public
void
访客
H
绑定结果和绑定凭证
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客J关系绑定"
,
priority
=
13
)
public
void
访客
J
关系绑定
()
{
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"中奖任务邀请J绑定结果和绑定凭证"
,
priority
=
14
)
public
void
获取访客
J
绑定结果和绑定凭证
()
{
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
//不同团队代理人绑定邀请关系
@Test
(
description
=
"代理人B分享直播间"
,
priority
=
15
)
public
void
代理人
B
分享直播间
()
{
agentAuth1
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客I关系绑定"
,
priority
=
16
)
public
void
访客
I
关系绑定
()
{
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"邀请I绑定结果和绑定凭证"
,
priority
=
17
)
public
void
访客
I
绑定结果和绑定凭证
()
{
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/cases/live/lotteryCode/SignIn.java
View file @
c8539426
...
@@ -21,7 +21,7 @@ import static com.kjj.config.BasicConfig.visitorAuth;
...
@@ -21,7 +21,7 @@ import static com.kjj.config.BasicConfig.visitorAuth;
public
class
SignIn
implements
Authorization
{
public
class
SignIn
implements
Authorization
{
@BeforeClass
@BeforeClass
public
void
setUp
()
{
visitorAuth
();
}
public
void
setUp
()
{
visitorAuth
1
();
}
@Test
(
description
=
"访客签到"
,
priority
=
1
)
@Test
(
description
=
"访客签到"
,
priority
=
1
)
public
void
访客签到
()
{
public
void
访客签到
()
{
...
@@ -73,7 +73,7 @@ public class SignIn implements Authorization {
...
@@ -73,7 +73,7 @@ public class SignIn implements Authorization {
}
}
...
...
src/test/java/com/kjj/cases/live/question/Question.java
View file @
c8539426
...
@@ -2,14 +2,11 @@ package com.kjj.cases.live.question;
...
@@ -2,14 +2,11 @@ package com.kjj.cases.live.question;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.issue.QuestionList
;
import
com.kjj.bean.issue.QuestionList
;
import
com.kjj.bean.issue.SpokeList
;
import
com.kjj.bean.issue.Spolist
;
import
com.kjj.bean.issue.issuelist
;
import
com.kjj.bean.issue.issuelist
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
...
@@ -74,7 +71,7 @@ public class Question implements Authorization {
...
@@ -74,7 +71,7 @@ public class Question implements Authorization {
@Test
(
description
=
"访客端查询问题列表"
,
priority
=
4
)
@Test
(
description
=
"访客端查询问题列表"
,
priority
=
4
)
public
void
访客端查询问题列表
()
public
void
访客端查询问题列表
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesClueList
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesClueList
);
...
@@ -88,7 +85,7 @@ public class Question implements Authorization {
...
@@ -88,7 +85,7 @@ public class Question implements Authorization {
@Test
(
description
=
"访客端发起问题"
,
priority
=
5
)
@Test
(
description
=
"访客端发起问题"
,
priority
=
5
)
public
void
访客端发起问题
()
public
void
访客端发起问题
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionId"
,
questionId
);
params
.
put
(
"questionId"
,
questionId
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -158,7 +155,7 @@ public class Question implements Authorization {
...
@@ -158,7 +155,7 @@ public class Question implements Authorization {
@Test
(
description
=
"访客端公告查询"
,
priority
=
10
)
@Test
(
description
=
"访客端公告查询"
,
priority
=
10
)
public
void
访客端公告查询
()
public
void
访客端公告查询
()
{
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNotice
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNotice
);
...
...
src/test/java/com/kjj/cases/live/secondKill/ConfSecondKill.java
View file @
c8539426
...
@@ -47,6 +47,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -47,6 +47,7 @@ public class ConfSecondKill implements Authorization {
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
// 代理人不可参与
secKillAddPar
.
put
(
"ableAgent"
,
0
);
// 代理人不可参与
secKillAddPar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
MANAGER_secondKillSave
);
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
MANAGER_secondKillSave
);
try
{
try
{
...
@@ -65,6 +66,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -65,6 +66,7 @@ public class ConfSecondKill implements Authorization {
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
secKillAddPar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
secKillAddRes
;
Response
secKillAddRes
;
boolean
data
;
boolean
data
;
...
@@ -124,6 +126,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -124,6 +126,7 @@ public class ConfSecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
1
);
secKillUpdatePar
.
put
(
"interactNum"
,
1
);
secKillUpdatePar
.
put
(
"id"
,
newSecKillId
);
secKillUpdatePar
.
put
(
"id"
,
newSecKillId
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
MANAGER_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
MANAGER_secondKillUpdate
);
try
{
try
{
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -188,6 +191,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -188,6 +191,7 @@ public class ConfSecondKill implements Authorization {
secKillAddPar
.
put
(
"goodsAmount"
,
5
);
// 1 == 0.01
secKillAddPar
.
put
(
"goodsAmount"
,
5
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
// 代理人不可参与
secKillAddPar
.
put
(
"ableAgent"
,
0
);
// 代理人不可参与
secKillAddPar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
try
{
try
{
...
@@ -206,6 +210,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -206,6 +210,7 @@ public class ConfSecondKill implements Authorization {
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
1
);
secKillAddPar
.
put
(
"interactNum"
,
1
);
secKillAddPar
.
put
(
"ableAgent"
,
1
);
// 代理人可参与
secKillAddPar
.
put
(
"ableAgent"
,
1
);
// 代理人可参与
secKillAddPar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
try
{
try
{
...
@@ -224,6 +229,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -224,6 +229,7 @@ public class ConfSecondKill implements Authorization {
secKillAddPar
.
put
(
"goodsAmount"
,
0
);
// 1 == 0.01
secKillAddPar
.
put
(
"goodsAmount"
,
0
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
1
);
secKillAddPar
.
put
(
"interactNum"
,
1
);
secKillAddPar
.
put
(
"ableAgent"
,
1
);
// 代理人可参与
secKillAddPar
.
put
(
"ableAgent"
,
1
);
// 代理人可参与
secKillAddPar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
Response
secKillAddRes
=
network
.
postResponse
(
secKillAddPar
,
BasicConfig
.
ANCHOR_secondKillSave
);
try
{
try
{
...
@@ -265,6 +271,7 @@ public class ConfSecondKill implements Authorization {
...
@@ -265,6 +271,7 @@ public class ConfSecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"id"
,
skIdFirst
);
secKillUpdatePar
.
put
(
"id"
,
skIdFirst
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
try
{
try
{
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
c8539426
...
@@ -14,12 +14,12 @@ import org.testng.Assert;
...
@@ -14,12 +14,12 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
import
java.util.Map
;
public
class
SecondKill
implements
Authorization
{
public
class
SecondKill
implements
Authorization
{
private
List
<
Long
>
confIds
;
@BeforeClass
@BeforeClass
public
void
setUp
(){
public
void
setUp
(){
...
@@ -38,6 +38,7 @@ public class SecondKill implements Authorization {
...
@@ -38,6 +38,7 @@ public class SecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
System
.
out
.
println
(
secKillUpdateRes
.
body
().
asString
());
System
.
out
.
println
(
secKillUpdateRes
.
body
().
asString
());
}
}
...
@@ -50,6 +51,7 @@ public class SecondKill implements Authorization {
...
@@ -50,6 +51,7 @@ public class SecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"interactNum"
,
3
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
System
.
out
.
println
(
secKillUpdateRes
.
body
().
asString
());
System
.
out
.
println
(
secKillUpdateRes
.
body
().
asString
());
}
}
...
@@ -62,6 +64,7 @@ public class SecondKill implements Authorization {
...
@@ -62,6 +64,7 @@ public class SecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
1
);
secKillUpdatePar
.
put
(
"interactNum"
,
1
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
System
.
out
.
println
(
secKillUpdateRes
.
body
().
asString
());
System
.
out
.
println
(
secKillUpdateRes
.
body
().
asString
());
}
}
...
@@ -74,6 +77,7 @@ public class SecondKill implements Authorization {
...
@@ -74,6 +77,7 @@ public class SecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
4
);
secKillUpdatePar
.
put
(
"interactNum"
,
4
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"ableAgent"
,
1
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
try
{
try
{
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -92,6 +96,7 @@ public class SecondKill implements Authorization {
...
@@ -92,6 +96,7 @@ public class SecondKill implements Authorization {
secKillUpdatePar
.
put
(
"interactNum"
,
4
);
secKillUpdatePar
.
put
(
"interactNum"
,
4
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"ableAgent"
,
0
);
secKillUpdatePar
.
put
(
"isNeedQualified"
,
0
);
// 不需要秒杀资格
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
Response
secKillUpdateRes
=
network
.
postResponse
(
secKillUpdatePar
,
BasicConfig
.
ANCHOR_secondKillUpdate
);
try
{
try
{
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
secKillUpdateRes
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -107,7 +112,7 @@ public class SecondKill implements Authorization {
...
@@ -107,7 +112,7 @@ public class SecondKill implements Authorization {
*/
*/
@Test
(
description
=
"获取秒杀商品列表"
,
priority
=
7
)
@Test
(
description
=
"获取秒杀商品列表"
,
priority
=
7
)
public
void
获取秒杀商品列表
()
{
public
void
获取秒杀商品列表
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
goodsListPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
goodsListPar
=
new
HashMap
<>();
goodsListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
goodsListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
goodsListRes
=
network
.
getResponse
(
goodsListPar
,
BasicConfig
.
MOBILE_secondKill_getGoodsList
);
Response
goodsListRes
=
network
.
getResponse
(
goodsListPar
,
BasicConfig
.
MOBILE_secondKill_getGoodsList
);
...
@@ -145,6 +150,7 @@ public class SecondKill implements Authorization {
...
@@ -145,6 +150,7 @@ public class SecondKill implements Authorization {
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
goodsOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
goodsOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdFirst
);
Response
goodsOnRes
=
network
.
postResponse
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
);
Response
goodsOnRes
=
network
.
postResponse
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
);
System
.
out
.
println
(
goodsOnRes
.
body
().
asString
());
try
{
try
{
boolean
data
=
goodsOnRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
goodsOnRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"上架秒杀失败"
,
goodsOnRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"上架秒杀失败"
,
goodsOnRes
.
body
().
asString
()));
...
@@ -167,25 +173,13 @@ public class SecondKill implements Authorization {
...
@@ -167,25 +173,13 @@ public class SecondKill implements Authorization {
}
}
}
}
// @Test(description = "无法同时上架多轮秒杀", priority = 10)
// public void 无法同时上架多轮秒杀() {
// Map<String, Object> goodsOnPar = new HashMap<>();
// goodsOnPar.put("id", ConfSecondKill.skIdSecond);
// Response goodsOnRes = network.postResponse(goodsOnPar, BasicConfig.ANCHOR_secondKillOn);
// try {
// boolean data = goodsOnRes.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(goodsOnPar, BasicConfig.ANCHOR_secondKillOn, "上架第二轮秒杀失败", goodsOnRes.body().asString()));
// }catch (NullPointerException e){
// e.printStackTrace();
// Assert.fail(network.message(goodsOnPar, BasicConfig.ANCHOR_secondKillOn, "未获取到数据", goodsOnRes.body().asString()));
// }
// }
@Test
(
description
=
"同时上架0秒杀商品"
,
priority
=
10
)
@Test
(
description
=
"同时上架0秒杀商品"
,
priority
=
10
)
public
void
同时上架
0
秒杀商品
()
{
public
void
同时上架
0
秒杀商品
()
{
adminAuth
();
adminAuth
();
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
goodsOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdThird
);
goodsOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdThird
);
Response
goodsOnRes
=
network
.
postResponse
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
);
Response
goodsOnRes
=
network
.
postResponse
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
);
System
.
out
.
println
(
goodsOnRes
.
body
().
asString
());
try
{
try
{
boolean
data
=
goodsOnRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
goodsOnRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"上架0元商品秒杀失败"
,
goodsOnRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"上架0元商品秒杀失败"
,
goodsOnRes
.
body
().
asString
()));
...
@@ -198,7 +192,8 @@ public class SecondKill implements Authorization {
...
@@ -198,7 +192,8 @@ public class SecondKill implements Authorization {
// 切换访客
// 切换访客
@Test
(
description
=
"查看当前秒杀商品"
,
priority
=
11
)
@Test
(
description
=
"查看当前秒杀商品"
,
priority
=
11
)
public
void
查看当前秒杀商品
()
{
public
void
查看当前秒杀商品
()
{
visitorAuth
();
visitorAuth1
();
sleep
(
10000
);
Map
<
String
,
Object
>
goodsFirstPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
goodsFirstPar
=
new
HashMap
<>();
goodsFirstPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
goodsFirstPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
goodsFirstRes
=
network
.
getResponse
(
goodsFirstPar
,
BasicConfig
.
MOBILE_secondKill_goodsFirst
);
Response
goodsFirstRes
=
network
.
getResponse
(
goodsFirstPar
,
BasicConfig
.
MOBILE_secondKill_goodsFirst
);
...
@@ -217,6 +212,7 @@ public class SecondKill implements Authorization {
...
@@ -217,6 +212,7 @@ public class SecondKill implements Authorization {
Map
<
String
,
Object
>
downgradeGoodsPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
downgradeGoodsPar
=
new
HashMap
<>();
downgradeGoodsPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
downgradeGoodsPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
downgradeGoodsRes
=
network
.
getResponse
(
downgradeGoodsPar
,
BasicConfig
.
MOBILE_secondKill_downgradeGoodsFirst
);
Response
downgradeGoodsRes
=
network
.
getResponse
(
downgradeGoodsPar
,
BasicConfig
.
MOBILE_secondKill_downgradeGoodsFirst
);
System
.
out
.
println
(
downgradeGoodsRes
.
body
().
asString
());
try
{
try
{
String
confId
=
downgradeGoodsRes
.
jsonPath
().
getString
(
"data.confId"
);
String
confId
=
downgradeGoodsRes
.
jsonPath
().
getString
(
"data.confId"
);
//校验最新上架的商品
//校验最新上架的商品
...
@@ -234,6 +230,8 @@ public class SecondKill implements Authorization {
...
@@ -234,6 +230,8 @@ public class SecondKill implements Authorization {
@Test
(
description
=
"代理人下单"
,
priority
=
13
)
@Test
(
description
=
"代理人下单"
,
priority
=
13
)
public
void
代理人下单
()
{
public
void
代理人下单
()
{
agentAuth
();
agentAuth
();
sleep
(
5000
);
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
...
@@ -258,7 +256,7 @@ public class SecondKill implements Authorization {
...
@@ -258,7 +256,7 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
...
@@ -311,7 +309,7 @@ public class SecondKill implements Authorization {
...
@@ -311,7 +309,7 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
...
@@ -341,7 +339,7 @@ public class SecondKill implements Authorization {
...
@@ -341,7 +339,7 @@ public class SecondKill implements Authorization {
*/
*/
@Test
(
description
=
"正常用户下单"
,
priority
=
19
)
@Test
(
description
=
"正常用户下单"
,
priority
=
19
)
public
void
正常用户下单
()
{
public
void
正常用户下单
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
...
@@ -366,7 +364,7 @@ public class SecondKill implements Authorization {
...
@@ -366,7 +364,7 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
...
@@ -385,7 +383,7 @@ public class SecondKill implements Authorization {
...
@@ -385,7 +383,7 @@ public class SecondKill implements Authorization {
@Test
(
description
=
"正常用户下单0元秒杀商品"
,
priority
=
21
)
@Test
(
description
=
"正常用户下单0元秒杀商品"
,
priority
=
21
)
public
void
正常用户下单
0
元秒杀商品
()
{
public
void
正常用户下单
0
元秒杀商品
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdThird
);
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdThird
);
...
@@ -410,8 +408,9 @@ public class SecondKill implements Authorization {
...
@@ -410,8 +408,9 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
System
.
out
.
println
(
orderResultRes
.
body
().
asString
());
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
if
(
i
==
10
){
if
(
i
==
10
){
...
@@ -577,7 +576,7 @@ public class SecondKill implements Authorization {
...
@@ -577,7 +576,7 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
...
@@ -596,7 +595,7 @@ public class SecondKill implements Authorization {
...
@@ -596,7 +595,7 @@ public class SecondKill implements Authorization {
@Test
(
description
=
"用户下单无库存秒杀失败"
,
priority
=
29
)
@Test
(
description
=
"用户下单无库存秒杀失败"
,
priority
=
29
)
public
void
用户下单无库存秒杀
()
{
public
void
用户下单无库存秒杀
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdSecond
);
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdSecond
);
...
@@ -619,7 +618,7 @@ public class SecondKill implements Authorization {
...
@@ -619,7 +618,7 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
...
@@ -644,7 +643,101 @@ public class SecondKill implements Authorization {
...
@@ -644,7 +643,101 @@ public class SecondKill implements Authorization {
}
}
}
}
@Test
(
description
=
"删除已上架过的轮次"
,
priority
=
30
)
// 秒杀限制
@Test
(
description
=
"添加秒杀限制"
,
priority
=
30
)
public
void
添加秒杀限制
()
{
confIds
=
new
ArrayList
<>();
// 用户已成功下单0元秒杀商品
// 将0元秒杀商品和第二轮秒杀添加进限制组
confIds
.
add
(
IdMakeUtil
.
managerDecodeingId
(
ConfSecondKill
.
skIdThird
));
confIds
.
add
(
IdMakeUtil
.
managerDecodeingId
(
ConfSecondKill
.
skIdSecond
));
Map
<
String
,
Object
>
addLimitPar
=
new
HashMap
<>();
addLimitPar
.
put
(
"confIds"
,
confIds
);
addLimitPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
addLimitRes
=
network
.
postResponse
(
addLimitPar
,
BasicConfig
.
MANAGER_secondKillSaveLimitGroup
);
try
{
boolean
data
=
addLimitRes
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addLimitPar
,
BasicConfig
.
MANAGER_secondKillSaveLimitGroup
,
"添加秒杀限制失败"
,
addLimitRes
.
body
().
asString
()));
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
addLimitPar
,
BasicConfig
.
MANAGER_secondKillSaveLimitGroup
,
"获取数据失败"
,
addLimitRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询秒杀限制组"
,
priority
=
31
)
public
void
查询秒杀限制组
()
{
Map
<
String
,
Object
>
limitGroupListPar
=
new
HashMap
<>();
limitGroupListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
limitGroupListRes
=
network
.
getResponse
(
limitGroupListPar
,
BasicConfig
.
MANAGER_secondKillLimitGroupList
);
try
{
List
<
Object
>
data
=
limitGroupListRes
.
jsonPath
().
getList
(
"data"
);
if
(
data
.
size
()
!=
confIds
.
size
()){
Assert
.
fail
(
network
.
message
(
limitGroupListPar
,
BasicConfig
.
MANAGER_secondKillLimitGroupList
,
"秒杀限制组与预定配置不一致"
,
limitGroupListRes
.
body
().
asString
()));
}
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++){
Assert
.
assertEquals
(
data
.
get
(
i
).
toString
(),
confIds
.
get
(
i
).
toString
(),
network
.
message
(
limitGroupListPar
,
BasicConfig
.
MANAGER_secondKillLimitGroupList
,
"秒杀限制组与预定配置不一致"
,
limitGroupListRes
.
body
().
asString
()));
}
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
limitGroupListPar
,
BasicConfig
.
MANAGER_secondKillLimitGroupList
,
"获取数据失败"
,
limitGroupListRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"限制组限制用户下单"
,
priority
=
32
)
public
void
限制组限制用户下单
()
{
// 等待两分钟代理人释放第二轮次库存
ThreadSleepUtils
.
sleep
(
180000
);
// 用户下单
visitorAuth1
();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"confId"
,
ConfSecondKill
.
skIdSecond
);
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
.
skIdSecond
);
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"
);
System
.
out
.
println
(
"data: "
+
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"
);
if
(
state
==
2
){
int
code
=
orderResultRes
.
jsonPath
().
getInt
(
"data.code"
);
if
(
code
==
4
){
System
.
out
.
println
(
"失败原因code="
+
code
);
}
else
{
Assert
.
assertEquals
(
code
,
3
,
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"失败原因不是被限制"
,
orderResultRes
.
body
().
asString
()));
}
}
else
{
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"用户下单未收到限制组限制"
,
orderResultRes
.
body
().
asString
()));
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
orderResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"删除已上架过的轮次"
,
priority
=
33
)
public
void
已上架过的轮次无法删除
()
{
public
void
已上架过的轮次无法删除
()
{
long
id
=
IdMakeUtil
.
managerDecodeingId
(
ConfSecondKill
.
skIdFirst
);
long
id
=
IdMakeUtil
.
managerDecodeingId
(
ConfSecondKill
.
skIdFirst
);
Map
<
String
,
Object
>
delSkPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
delSkPar
=
new
HashMap
<>();
...
@@ -663,9 +756,9 @@ public class SecondKill implements Authorization {
...
@@ -663,9 +756,9 @@ public class SecondKill implements Authorization {
}
}
}
}
@Test
(
description
=
"用户成功支付"
,
priority
=
3
1
)
@Test
(
description
=
"用户成功支付"
,
priority
=
3
4
)
public
void
用户成功支付
()
{
public
void
用户成功支付
()
{
visitorAuth
();
visitorAuth
1
();
// 新建订单
// 新建订单
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
orderPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -688,7 +781,7 @@ public class SecondKill implements Authorization {
...
@@ -688,7 +781,7 @@ public class SecondKill implements Authorization {
try
{
try
{
// 轮训下单接口
// 轮训下单接口
while
(
data
==
null
){
while
(
data
==
null
){
ThreadSleepUtils
.
sleep
(
2000
);
sleep
(
2000
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
orderResultRes
=
network
.
getResponse
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
data
=
orderResultRes
.
jsonPath
().
getJsonObject
(
"data"
);
i
++;
i
++;
...
...
src/test/java/com/kjj/cases/live/treasure/GoldenEgg.java
View file @
c8539426
...
@@ -7,6 +7,7 @@ import com.kjj.bean.manager.TreasureCode;
...
@@ -7,6 +7,7 @@ import com.kjj.bean.manager.TreasureCode;
import
com.kjj.bean.manager.TreasureRed
;
import
com.kjj.bean.manager.TreasureRed
;
import
com.kjj.bean.manager.WelfareList
;
import
com.kjj.bean.manager.WelfareList
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.live.liveConfig.LiveBinding
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.JsonUtil
;
...
@@ -27,11 +28,16 @@ import static com.kjj.utils.ThreadSleepUtils.sleep;
...
@@ -27,11 +28,16 @@ import static com.kjj.utils.ThreadSleepUtils.sleep;
public
class
GoldenEgg
implements
Authorization
{
public
class
GoldenEgg
implements
Authorization
{
@BeforeClass
@BeforeClass
public
void
setUp
()
{
ssoLogin
();
}
public
void
setUp
()
{
ssoLogin
();
}
public
String
ConfId
;
public
String
ConfId
;
public
String
shareSign
;
public
String
shareSign
;
public
JSONObject
treasureConf
;
public
JSONObject
treasureConf
;
public
String
interactConfId
;
public
String
interactConfId
;
public
LiveBinding
liveBinding
=
new
LiveBinding
();
public
List
<
WelfareList
>
id
;
/**
/**
* 添加代理人绑定关系
* 添加代理人绑定关系
...
@@ -39,58 +45,17 @@ public class GoldenEgg implements Authorization {
...
@@ -39,58 +45,17 @@ public class GoldenEgg implements Authorization {
@Test
(
description
=
"代理人绑定"
,
priority
=
1
)
@Test
(
description
=
"代理人绑定"
,
priority
=
1
)
public
void
代理人绑定
()
{
public
void
代理人绑定
()
{
agentAuth
();
agentAuth
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
this
.
shareSign
=
liveBinding
.
share
();
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
/**
* 裂变宝箱配置
*/
public
List
<
WelfareList
>
id
;
@Test
(
description
=
"代理人A分享直播间"
,
priority
=
2
)
public
void
代理人
A
分享直播间
()
{
agentAuth
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
3
)
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
2
)
public
void
代理人
A
与访客
A
邀请关系绑定
()
{
public
void
代理人
A
与访客
A
邀请关系绑定
()
{
visitorAuth
();
visitorAuth1
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询配置奖品列表"
,
priority
=
3
)
@Test
(
description
=
"访客A获取绑定结果和绑定凭证"
,
priority
=
4
)
public
void
访客
A
获取绑定结果和绑定凭证
()
{
visitorAuth
();
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询配置奖品列表"
,
priority
=
5
)
public
void
查询配置奖品列表
()
{
public
void
查询配置奖品列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -106,7 +71,7 @@ public class GoldenEgg implements Authorization {
...
@@ -106,7 +71,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"创建砸金蛋配置"
,
priority
=
6
)
@Test
(
description
=
"创建砸金蛋配置"
,
priority
=
4
)
public
void
创建砸金蛋配置
()
{
public
void
创建砸金蛋配置
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -147,7 +112,7 @@ public class GoldenEgg implements Authorization {
...
@@ -147,7 +112,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"查询砸金蛋配置详情"
,
priority
=
7
)
@Test
(
description
=
"查询砸金蛋配置详情"
,
priority
=
5
)
public
void
查询砸金蛋配置详情
()
{
public
void
查询砸金蛋配置详情
()
{
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -159,7 +124,7 @@ public class GoldenEgg implements Authorization {
...
@@ -159,7 +124,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"开启砸金蛋配置"
,
priority
=
8
)
@Test
(
description
=
"开启砸金蛋配置"
,
priority
=
6
)
public
void
开启砸金蛋配置
()
{
public
void
开启砸金蛋配置
()
{
Map
<
String
,
Object
>
switchStatusParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
switchStatusParam
=
new
HashMap
<>();
switchStatusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
switchStatusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -171,7 +136,7 @@ public class GoldenEgg implements Authorization {
...
@@ -171,7 +136,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"查询砸金蛋配置状态"
,
priority
=
9
)
@Test
(
description
=
"查询砸金蛋配置状态"
,
priority
=
7
)
public
void
查询宝箱配置状态
()
{
public
void
查询宝箱配置状态
()
{
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
statusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
statusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -184,9 +149,9 @@ public class GoldenEgg implements Authorization {
...
@@ -184,9 +149,9 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"查询砸金蛋配置数据"
,
priority
=
10
)
@Test
(
description
=
"查询砸金蛋配置数据"
,
priority
=
8
)
public
void
查询砸金蛋配置数据
()
{
public
void
查询砸金蛋配置数据
()
{
visitorAuth
();
visitorAuth
1
();
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
BasicConfig
.
MOBILE_allLottery
);
Response
response
=
network
.
getResponse
(
getLiveAwardListParam
,
BasicConfig
.
MOBILE_allLottery
);
...
@@ -203,7 +168,7 @@ public class GoldenEgg implements Authorization {
...
@@ -203,7 +168,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"查询直播前砸金蛋配置详情"
,
priority
=
11
)
@Test
(
description
=
"查询直播前砸金蛋配置详情"
,
priority
=
9
)
public
void
查询直播前砸金蛋配置详情
()
{
public
void
查询直播前砸金蛋配置详情
()
{
sleep
(
2000
);
sleep
(
2000
);
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
...
@@ -216,7 +181,7 @@ public class GoldenEgg implements Authorization {
...
@@ -216,7 +181,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"获取跑马灯数据"
,
priority
=
1
2
)
@Test
(
description
=
"获取跑马灯数据"
,
priority
=
1
0
)
public
void
获取跑马灯数据
()
{
public
void
获取跑马灯数据
()
{
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
chooseAwardParam
.
put
(
"pageSize"
,
10
);
chooseAwardParam
.
put
(
"pageSize"
,
10
);
...
@@ -227,31 +192,14 @@ public class GoldenEgg implements Authorization {
...
@@ -227,31 +192,14 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
1
3
)
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
1
1
)
public
void
代理人
A
与访客
G
邀请关系绑定
()
{
public
void
代理人
A
与访客
G
邀请关系绑定
()
{
visitorAuth7
();
visitorAuth7
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取绑定结果和绑定凭证"
,
priority
=
14
)
public
void
访客
G
获取绑定结果和绑定凭证
()
{
visitorAuth7
();
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
System
.
out
.
println
(
tokenRes
.
body
().
asString
());
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"黑名单用户仅不可砸中实物"
,
priority
=
1
5
)
@Test
(
description
=
"黑名单用户仅不可砸中实物"
,
priority
=
1
2
)
public
void
黑名单用户仅不可砸中实物
()
{
public
void
黑名单用户仅不可砸中实物
()
{
visitorAuth7
();
visitorAuth7
();
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
...
@@ -272,14 +220,14 @@ public class GoldenEgg implements Authorization {
...
@@ -272,14 +220,14 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
黑名单砸出非抽奖码
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"第1个访客A砸金蛋砸出实物"
,
priority
=
1
6
)
@Test
(
description
=
"第1个访客A砸金蛋砸出实物"
,
priority
=
1
3
)
public
void
第
1
个访客
A
砸金蛋砸出实物
()
{
public
void
第
1
个访客
A
砸金蛋砸出实物
()
{
visitorAuth
();
visitorAuth
1
();
sleep
(
2000
);
sleep
(
2000
);
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
chooseAwardParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
chooseAwardParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -299,35 +247,19 @@ public class GoldenEgg implements Authorization {
...
@@ -299,35 +247,19 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
interactConfId
=
response
.
jsonPath
().
getString
(
"data.award.interactConfId"
);
interactConfId
=
response
.
jsonPath
().
getString
(
"data.award.interactConfId"
);
}
}
@Test
(
description
=
"代理人A与访客B邀请关系绑定"
,
priority
=
1
7
)
@Test
(
description
=
"代理人A与访客B邀请关系绑定"
,
priority
=
1
4
)
public
void
代理人
A
与访客
B
邀请关系绑定
()
{
public
void
代理人
A
与访客
B
邀请关系绑定
()
{
visitorAuth7
();
visitorAuth7
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客B获取绑定结果和绑定凭证"
,
priority
=
18
)
@Test
(
description
=
"第2个访客B砸金蛋砸出抽奖码"
,
priority
=
15
)
public
void
访客
B
获取绑定结果和绑定凭证
()
{
visitorAuth7
();
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
System
.
out
.
println
(
tokenRes
.
body
().
asString
());
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"第2个访客B砸金蛋砸出抽奖码"
,
priority
=
19
)
public
void
第
2
个访客
B
砸金蛋砸出抽奖码
()
{
public
void
第
2
个访客
B
砸金蛋砸出抽奖码
()
{
visitorAuth2
();
visitorAuth2
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -349,11 +281,11 @@ public class GoldenEgg implements Authorization {
...
@@ -349,11 +281,11 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非抽奖码
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"增加实物奖品数量"
,
priority
=
20
)
@Test
(
description
=
"增加实物奖品数量"
,
priority
=
16
)
public
void
增加实物奖品数量
()
{
public
void
增加实物奖品数量
()
{
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
treasureAward
.
put
(
"totalNum"
,
2
);
//-1无限制,1限制1次
treasureAward
.
put
(
"totalNum"
,
2
);
//-1无限制,1限制1次
...
@@ -364,7 +296,7 @@ public class GoldenEgg implements Authorization {
...
@@ -364,7 +296,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
treasureConf
,
BasicConfig
.
MANAGER_goldenEgg_saveOrUpdate
,
"增加实物奖品数量失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
treasureConf
,
BasicConfig
.
MANAGER_goldenEgg_saveOrUpdate
,
"增加实物奖品数量失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"实物奖品增加后数量变化"
,
priority
=
21
)
@Test
(
description
=
"实物奖品增加后数量变化"
,
priority
=
17
)
public
void
实物奖品增加后数量变化
()
{
public
void
实物奖品增加后数量变化
()
{
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -378,32 +310,14 @@ public class GoldenEgg implements Authorization {
...
@@ -378,32 +310,14 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
receiveNum
,
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveNum
,
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人A与访客C邀请关系绑定"
,
priority
=
22
)
@Test
(
description
=
"代理人A与访客C邀请关系绑定"
,
priority
=
18
)
public
void
代理人
A
与访客
C
邀请关系绑定
()
{
public
void
代理人
A
与访客
C
邀请关系绑定
()
{
visitorAuth3
();
visitorAuth3
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客C获取绑定结果和绑定凭证"
,
priority
=
23
)
public
void
访客
C
获取绑定结果和绑定凭证
()
{
visitorAuth3
();
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
System
.
out
.
println
(
tokenRes
.
body
().
asString
());
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"第3个访客C砸金蛋砸出实物"
,
priority
=
24
)
@Test
(
description
=
"第3个访客C砸金蛋砸出实物"
,
priority
=
19
)
public
void
第
3
个访客
C
砸金蛋砸出实物
()
{
public
void
第
3
个访客
C
砸金蛋砸出实物
()
{
visitorAuth3
();
visitorAuth3
();
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
chooseAwardParam
=
new
HashMap
<>();
...
@@ -423,12 +337,12 @@ public class GoldenEgg implements Authorization {
...
@@ -423,12 +337,12 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"减少实物奖品数量"
,
priority
=
2
5
)
@Test
(
description
=
"减少实物奖品数量"
,
priority
=
2
0
)
public
void
减少实物奖品数量
()
{
public
void
减少实物奖品数量
()
{
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
treasureAward
.
put
(
"totalNum"
,
1
);
//-1无限制,1限制1次
treasureAward
.
put
(
"totalNum"
,
1
);
//-1无限制,1限制1次
...
@@ -439,7 +353,7 @@ public class GoldenEgg implements Authorization {
...
@@ -439,7 +353,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"第3个访客C砸金蛋超时"
,
priority
=
2
6
)
@Test
(
description
=
"第3个访客C砸金蛋超时"
,
priority
=
2
1
)
public
void
第
3
个访客
C
砸金蛋超时
()
{
public
void
第
3
个访客
C
砸金蛋超时
()
{
visitorAuth3
();
visitorAuth3
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -460,7 +374,7 @@ public class GoldenEgg implements Authorization {
...
@@ -460,7 +374,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"第3个访客C超时后重新砸蛋砸出实物奖品"
,
priority
=
2
7
)
@Test
(
description
=
"第3个访客C超时后重新砸蛋砸出实物奖品"
,
priority
=
2
2
)
public
void
第
3
个访客
C
超时后重新砸蛋砸出实物奖品
()
{
public
void
第
3
个访客
C
超时后重新砸蛋砸出实物奖品
()
{
visitorAuth3
();
visitorAuth3
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -482,12 +396,12 @@ public class GoldenEgg implements Authorization {
...
@@ -482,12 +396,12 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"第3个访客C再次砸金蛋超时"
,
priority
=
2
8
)
@Test
(
description
=
"第3个访客C再次砸金蛋超时"
,
priority
=
2
3
)
public
void
第
3
个访客
C
再次砸金蛋超时
()
{
public
void
第
3
个访客
C
再次砸金蛋超时
()
{
visitorAuth3
();
visitorAuth3
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -508,31 +422,14 @@ public class GoldenEgg implements Authorization {
...
@@ -508,31 +422,14 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"代理人A与访客D邀请关系绑定"
,
priority
=
2
9
)
@Test
(
description
=
"代理人A与访客D邀请关系绑定"
,
priority
=
2
4
)
public
void
代理人
A
与访客
D
邀请关系绑定
()
{
public
void
代理人
A
与访客
D
邀请关系绑定
()
{
visitorAuth4
();
visitorAuth4
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客D获取绑定结果和绑定凭证"
,
priority
=
30
)
@Test
(
description
=
"第3个用户再次超时后访客D砸蛋砸出实物奖品"
,
priority
=
25
)
public
void
访客
D
获取绑定结果和绑定凭证
()
{
visitorAuth4
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
System
.
out
.
println
(
tokenRes
.
body
().
asString
());
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"第3个用户再次超时后访客D砸蛋砸出实物奖品"
,
priority
=
31
)
public
void
第
3
个用户再次超时后访客
D
砸蛋砸出实物奖品
()
{
public
void
第
3
个用户再次超时后访客
D
砸蛋砸出实物奖品
()
{
visitorAuth4
();
visitorAuth4
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -555,35 +452,18 @@ public class GoldenEgg implements Authorization {
...
@@ -555,35 +452,18 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人A与访客E邀请关系绑定"
,
priority
=
32
)
@Test
(
description
=
"代理人A与访客E邀请关系绑定"
,
priority
=
26
)
public
void
代理人
A
与访客
E
邀请关系绑定
()
{
public
void
代理人
A
与访客
E
邀请关系绑定
()
{
visitorAuth5
();
visitorAuth5
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
System
.
out
.
println
(
bindingRes
.
body
().
asString
());
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客E获取绑定结果和绑定凭证"
,
priority
=
33
)
public
void
访客
E
获取绑定结果和绑定凭证
()
{
visitorAuth5
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
System
.
out
.
println
(
tokenRes
.
body
().
asString
());
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"第5个用户E砸蛋砸出抽奖码"
,
priority
=
34
)
@Test
(
description
=
"第5个用户E砸蛋砸出抽奖码"
,
priority
=
27
)
public
void
第
5
个用户
E
砸蛋砸出抽奖码
()
{
public
void
第
5
个用户
E
砸蛋砸出抽奖码
()
{
visitorAuth5
();
visitorAuth5
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -605,51 +485,27 @@ public class GoldenEgg implements Authorization {
...
@@ -605,51 +485,27 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非抽奖码
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A获取分享加密串"
,
priority
=
35
)
@Test
(
description
=
"访客A获取分享加密串"
,
priority
=
28
)
public
void
访客
A
获取分享加密串
()
{
public
void
访客
A
获取分享加密串
()
{
visitorAuth
();
visitorAuth1
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
this
.
shareSign
=
liveBinding
.
share
();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
15
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
System
.
out
.
println
(
signRes
.
body
().
asString
());
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客E与访客A邀请关系绑定"
,
priority
=
36
)
@Test
(
description
=
"访客E与访客A邀请关系绑定"
,
priority
=
29
)
public
void
访客
F
与访客
A
邀请关系绑定
()
{
public
void
访客
F
与访客
A
邀请关系绑定
()
{
visitorAuth6
();
visitorAuth6
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客E获取绑定结果和绑定凭证"
,
priority
=
37
)
@Test
(
description
=
"修改实物奖品数量为无限制"
,
priority
=
30
)
public
void
访客
F
获取绑定结果和绑定凭证
()
{
visitorAuth6
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"修改实物奖品数量为无限制"
,
priority
=
38
)
public
void
修改实物奖品数量为无限制
()
{
public
void
修改实物奖品数量为无限制
()
{
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
treasureAward
.
put
(
"totalNum"
,-
1
);
treasureAward
.
put
(
"totalNum"
,-
1
);
...
@@ -660,7 +516,7 @@ public class GoldenEgg implements Authorization {
...
@@ -660,7 +516,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
treasureConf
,
BasicConfig
.
MANAGER_goldenEgg_saveOrUpdate
,
"修改实物奖品为无限制失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
treasureConf
,
BasicConfig
.
MANAGER_goldenEgg_saveOrUpdate
,
"修改实物奖品为无限制失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"第5个访客F砸蛋砸出实物奖品"
,
priority
=
3
9
)
@Test
(
description
=
"第5个访客F砸蛋砸出实物奖品"
,
priority
=
3
1
)
public
void
第
5
个访客
F
砸蛋砸出实物奖品
()
{
public
void
第
5
个访客
F
砸蛋砸出实物奖品
()
{
visitorAuth6
();
visitorAuth6
();
sleep
(
5000
);
sleep
(
5000
);
...
@@ -682,12 +538,12 @@ public class GoldenEgg implements Authorization {
...
@@ -682,12 +538,12 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
3
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非实物
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"修改红包概率为100%"
,
priority
=
40
)
@Test
(
description
=
"修改红包概率为100%"
,
priority
=
32
)
public
void
修改红包概率为
100
()
{
public
void
修改红包概率为
100
()
{
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
JSONObject
treasureRed
=
treasureConf
.
getJSONObject
(
"treasureRed"
);
JSONObject
treasureRed
=
treasureConf
.
getJSONObject
(
"treasureRed"
);
...
@@ -699,7 +555,7 @@ public class GoldenEgg implements Authorization {
...
@@ -699,7 +555,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
treasureConf
,
BasicConfig
.
MANAGER_goldenEgg_saveOrUpdate
,
"修改红包概率失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
treasureConf
,
BasicConfig
.
MANAGER_goldenEgg_saveOrUpdate
,
"修改红包概率失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"黑名单用户G砸金蛋超时"
,
priority
=
41
)
@Test
(
description
=
"黑名单用户G砸金蛋超时"
,
priority
=
33
)
public
void
黑名单用户
G
砸金蛋超时
()
{
public
void
黑名单用户
G
砸金蛋超时
()
{
visitorAuth7
();
visitorAuth7
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
...
@@ -719,7 +575,7 @@ public class GoldenEgg implements Authorization {
...
@@ -719,7 +575,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"黑名单用户G超时后仅能砸出抽奖码"
,
priority
=
42
)
@Test
(
description
=
"黑名单用户G超时后仅能砸出抽奖码"
,
priority
=
34
)
public
void
黑名单用户
G
超时后仅能砸出抽奖码
()
{
public
void
黑名单用户
G
超时后仅能砸出抽奖码
()
{
visitorAuth7
();
visitorAuth7
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -741,36 +597,19 @@ public class GoldenEgg implements Authorization {
...
@@ -741,36 +597,19 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
黑名单砸出奖品非抽奖码
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客I与访客A邀请关系绑定"
,
priority
=
43
)
@Test
(
description
=
"访客I与访客A邀请关系绑定"
,
priority
=
35
)
public
void
访客
I
与访客
A
邀请关系绑定
()
{
public
void
访客
I
与访客
A
邀请关系绑定
()
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客F获取绑定结果和绑定凭证"
,
priority
=
44
)
public
void
访客
I
获取绑定结果和绑定凭证
()
{
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"第6个访客F砸出红包"
,
priority
=
45
)
@Test
(
description
=
"第6个访客F砸出红包"
,
priority
=
36
)
public
void
第
6
个访客
F
砸出红包
()
{
public
void
第
6
个访客
F
砸出红包
()
{
visitorAuth8
();
visitorAuth8
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -792,36 +631,19 @@ public class GoldenEgg implements Authorization {
...
@@ -792,36 +631,19 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
2
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
2
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸
出奖品非红包
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H与访客A邀请关系绑定"
,
priority
=
46
)
@Test
(
description
=
"访客H与访客A邀请关系绑定"
,
priority
=
37
)
public
void
访客
H
与访客
A
邀请关系绑定
()
{
public
void
访客
H
与访客
A
邀请关系绑定
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
liveBinding
.
binding
(
this
.
shareSign
);;
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
liveBinding
.
token
();
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H获取绑定结果和绑定凭证"
,
priority
=
47
)
public
void
访客
H
获取绑定结果和绑定凭证
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"第7个访客H砸出抽奖码"
,
priority
=
4
8
)
@Test
(
description
=
"第7个访客H砸出抽奖码"
,
priority
=
3
8
)
public
void
第
7
个访客
H
砸出抽奖码
()
{
public
void
第
7
个访客
H
砸出抽奖码
()
{
visitorAuth9
();
visitorAuth9
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -843,11 +665,11 @@ public class GoldenEgg implements Authorization {
...
@@ -843,11 +665,11 @@ public class GoldenEgg implements Authorization {
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
int
helperList
=
response
.
jsonPath
().
getInt
(
"data.helperList.size()"
);
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveStatus
,
5
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金蛋失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金
蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
treasureType
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"砸金
出奖品非抽奖码
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
砸金蛋失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
0
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"
助力人数错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"砸金蛋进行中数量变化"
,
priority
=
4
9
)
@Test
(
description
=
"砸金蛋进行中数量变化"
,
priority
=
3
9
)
public
void
砸金蛋进行中数量变化
()
{
public
void
砸金蛋进行中数量变化
()
{
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -868,7 +690,7 @@ public class GoldenEgg implements Authorization {
...
@@ -868,7 +690,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
receiveNum
,
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveNum
,
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"用户B给用户A助力"
,
priority
=
5
0
)
@Test
(
description
=
"用户B给用户A助力"
,
priority
=
4
0
)
public
void
用户
B
给用户
A
助力
()
{
public
void
用户
B
给用户
A
助力
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
@@ -890,9 +712,9 @@ public class GoldenEgg implements Authorization {
...
@@ -890,9 +712,9 @@ public class GoldenEgg implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A实物兑奖成功"
,
priority
=
5
1
)
@Test
(
description
=
"访客A实物兑奖成功"
,
priority
=
4
1
)
public
void
访客
A
实物兑奖成功
()
{
public
void
访客
A
实物兑奖成功
()
{
visitorAuth
();
visitorAuth
1
();
sleep
(
2000
);
sleep
(
2000
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -905,20 +727,13 @@ public class GoldenEgg implements Authorization {
...
@@ -905,20 +727,13 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
helperList
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"邀请头像数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"邀请头像数量错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客B获取分享加密串"
,
priority
=
5
2
)
@Test
(
description
=
"访客B获取分享加密串"
,
priority
=
4
2
)
public
void
访客
B
获取分享加密串
()
{
public
void
访客
B
获取分享加密串
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
this
.
shareSign
=
liveBinding
.
share
();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
15
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"用户C给用户B助力"
,
priority
=
5
3
)
@Test
(
description
=
"用户C给用户B助力"
,
priority
=
4
3
)
public
void
用户
C
给用户
B
助力
()
{
public
void
用户
C
给用户
B
助力
()
{
visitorAuth3
();
visitorAuth3
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
@@ -940,7 +755,7 @@ public class GoldenEgg implements Authorization {
...
@@ -940,7 +755,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客B抽奖码兑奖成功"
,
priority
=
5
4
)
@Test
(
description
=
"访客B抽奖码兑奖成功"
,
priority
=
4
4
)
public
void
访客
B
抽奖码兑奖成功
()
{
public
void
访客
B
抽奖码兑奖成功
()
{
visitorAuth2
();
visitorAuth2
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -955,20 +770,13 @@ public class GoldenEgg implements Authorization {
...
@@ -955,20 +770,13 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
helperList
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"邀请头像数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"邀请头像数量错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F获取分享加密串"
,
priority
=
5
5
)
@Test
(
description
=
"访客F获取分享加密串"
,
priority
=
4
5
)
public
void
访客
F
获取分享加密串
()
{
public
void
访客
F
获取分享加密串
()
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
this
.
shareSign
=
liveBinding
.
share
();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
15
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"用户D给用户F助力"
,
priority
=
5
6
)
@Test
(
description
=
"用户D给用户F助力"
,
priority
=
4
6
)
public
void
用户
D
给用户
F
助力
()
{
public
void
用户
D
给用户
F
助力
()
{
visitorAuth5
();
visitorAuth5
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
@@ -990,7 +798,7 @@ public class GoldenEgg implements Authorization {
...
@@ -990,7 +798,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F红包兑奖成功"
,
priority
=
5
7
)
@Test
(
description
=
"访客F红包兑奖成功"
,
priority
=
4
7
)
public
void
访客
F
红包兑奖成功
()
{
public
void
访客
F
红包兑奖成功
()
{
visitorAuth8
();
visitorAuth8
();
sleep
(
2000
);
sleep
(
2000
);
...
@@ -1005,7 +813,7 @@ public class GoldenEgg implements Authorization {
...
@@ -1005,7 +813,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
helperList
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"邀请头像数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
helperList
,
1
,
network
.
message
(
param
,
BasicConfig
.
MOBILE_goldenEgg_joinInfo
,
"邀请头像数量错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"砸金蛋已领取数量变化"
,
priority
=
5
8
)
@Test
(
description
=
"砸金蛋已领取数量变化"
,
priority
=
4
8
)
public
void
砸金蛋已领取数量变化
()
{
public
void
砸金蛋已领取数量变化
()
{
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -1027,12 +835,12 @@ public class GoldenEgg implements Authorization {
...
@@ -1027,12 +835,12 @@ public class GoldenEgg implements Authorization {
Assert
.
assertEquals
(
receiveNum
,
1
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiveNum
,
1
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_goldenEgg_detail
,
"实物奖品已领取错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询用户是否未提交收货地址"
,
priority
=
5
9
)
@Test
(
description
=
"查询用户是否未提交收货地址"
,
priority
=
4
9
)
public
void
查询用户是否未提交收货地址
()
{
public
void
查询用户是否未提交收货地址
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
locationResultParam
.
put
(
"liveId"
,
"Kj21NTE3Mjc"
);
locationResultParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
())
);
locationResultParam
.
put
(
"scene"
,
1
);
locationResultParam
.
put
(
"scene"
,
1
);
Response
locationResultRes
=
network
.
getResponse
(
locationResultParam
,
BasicConfig
.
USER_locationResult
);
Response
locationResultRes
=
network
.
getResponse
(
locationResultParam
,
BasicConfig
.
USER_locationResult
);
System
.
out
.
println
(
locationResultRes
.
body
().
asString
());
System
.
out
.
println
(
locationResultRes
.
body
().
asString
());
...
@@ -1040,16 +848,16 @@ public class GoldenEgg implements Authorization {
...
@@ -1040,16 +848,16 @@ public class GoldenEgg implements Authorization {
Assert
.
assertNotNull
(
winnerRegion
,
network
.
message
(
locationResultParam
,
BasicConfig
.
USER_locationResult
,
"查询用户是否提交收货地址失败"
,
locationResultRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
winnerRegion
,
network
.
message
(
locationResultParam
,
BasicConfig
.
USER_locationResult
,
"查询用户是否提交收货地址失败"
,
locationResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"提交收货地址"
,
priority
=
6
0
)
@Test
(
description
=
"提交收货地址"
,
priority
=
5
0
)
public
void
提交收货地址
()
{
public
void
提交收货地址
()
{
visitorAuth
();
visitorAuth
1
();
ArrayList
<
String
>
region
=
new
ArrayList
<>();
ArrayList
<
String
>
region
=
new
ArrayList
<>();
region
.
add
(
"浙江省"
);
region
.
add
(
"浙江省"
);
region
.
add
(
"杭州市"
);
region
.
add
(
"杭州市"
);
region
.
add
(
"西湖区"
);
region
.
add
(
"西湖区"
);
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
submitInfoParam
.
put
(
"liveId"
,
"Kj21NTE3Mjc"
);
submitInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
())
);
submitInfoParam
.
put
(
"confId"
,
"Kj20NjIwNTY3"
);
submitInfoParam
.
put
(
"confId"
,
interactConfId
);
submitInfoParam
.
put
(
"winnerName"
,
"中奖人"
);
submitInfoParam
.
put
(
"winnerName"
,
"中奖人"
);
submitInfoParam
.
put
(
"region"
,
region
);
submitInfoParam
.
put
(
"region"
,
region
);
submitInfoParam
.
put
(
"location"
,
"西湖区数娱大厦"
);
submitInfoParam
.
put
(
"location"
,
"西湖区数娱大厦"
);
...
@@ -1061,19 +869,19 @@ public class GoldenEgg implements Authorization {
...
@@ -1061,19 +869,19 @@ public class GoldenEgg implements Authorization {
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
}
}
@Test
(
description
=
"查询用户是否提交收货地址"
,
priority
=
6
1
)
@Test
(
description
=
"查询用户是否提交收货地址"
,
priority
=
5
1
)
public
void
查询用户是否提交收货地址
()
{
public
void
查询用户是否提交收货地址
()
{
visitorAuth
();
visitorAuth
1
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
locationResultParam
=
new
HashMap
<>();
locationResultParam
.
put
(
"liveId"
,
"Kj21NTE3Mjc"
);
locationResultParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
())
);
locationResultParam
.
put
(
"scene"
,
1
);
locationResultParam
.
put
(
"scene"
,
1
);
Response
locationResultRes
=
network
.
getResponse
(
locationResultParam
,
BasicConfig
.
USER_locationResult
);
Response
locationResultRes
=
network
.
getResponse
(
locationResultParam
,
BasicConfig
.
USER_locationResult
);
System
.
out
.
println
(
locationResultRes
.
body
().
asString
());
System
.
out
.
println
(
locationResultRes
.
body
().
asString
());
Object
winnerRegion
=
locationResultRes
.
jsonPath
().
getJsonObject
(
"data.winnerRegion"
);
Object
winnerRegion
=
locationResultRes
.
jsonPath
().
getJsonObject
(
"data.winnerRegion"
);
Assert
.
assertNotNull
(
winnerRegion
,
network
.
message
(
locationResultParam
,
BasicConfig
.
USER_locationResult
,
"查询用户是否提交收货地址失败"
,
locationResultRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
winnerRegion
,
network
.
message
(
locationResultParam
,
BasicConfig
.
USER_locationResult
,
"查询用户是否提交收货地址失败"
,
locationResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取直播配置详情"
,
priority
=
6
2
)
@Test
(
description
=
"获取直播配置详情"
,
priority
=
5
2
)
public
void
获取直播配置详情
()
{
public
void
获取直播配置详情
()
{
adminAuth
();
adminAuth
();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
...
@@ -1085,7 +893,7 @@ public class GoldenEgg implements Authorization {
...
@@ -1085,7 +893,7 @@ public class GoldenEgg implements Authorization {
}
}
@Test
(
description
=
"开始直播"
,
priority
=
6
3
)
@Test
(
description
=
"开始直播"
,
priority
=
5
3
)
public
void
开启直播
()
{
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -1096,7 +904,7 @@ public class GoldenEgg implements Authorization {
...
@@ -1096,7 +904,7 @@ public class GoldenEgg implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
10000
);
ThreadSleepUtils
.
sleep
(
10000
);
}
}
@Test
(
description
=
"结束直播"
,
priority
=
6
4
)
@Test
(
description
=
"结束直播"
,
priority
=
5
4
)
public
void
结束直播
()
{
public
void
结束直播
()
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/cases/live/treasure/TimeRed.java
View file @
c8539426
...
@@ -416,7 +416,6 @@ public class TimeRed implements Authorization {
...
@@ -416,7 +416,6 @@ public class TimeRed implements Authorization {
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Response
redRes
=
network
.
postResponse
(
Params
,
BasicConfig
.
ANCHOR_redOpen
);
Response
redRes
=
network
.
postResponse
(
Params
,
BasicConfig
.
ANCHOR_redOpen
);
boolean
data1
=
redRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data1
=
redRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_redOpen
,
"访客I开启第4轮红包失败"
,
redRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data1
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_redOpen
,
"访客I开启第4轮红包失败"
,
redRes
.
body
().
asString
()));
}
}
...
@@ -430,9 +429,7 @@ public class TimeRed implements Authorization {
...
@@ -430,9 +429,7 @@ public class TimeRed implements Authorization {
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
ANCHOR_openState
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
ANCHOR_openState
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Integer
state
=
response
.
jsonPath
().
getInt
(
"data.state"
);
Integer
state
=
response
.
jsonPath
().
getInt
(
"data.state"
);
System
.
out
.
println
(
state
);
Assert
.
assertTrue
(
state
==
2
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_openState
,
"访客H未领取第4轮红包"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
state
==
2
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_openState
,
"访客H未领取第4轮红包"
,
response
.
body
().
asString
()));
visitorAuth8
();
visitorAuth8
();
...
@@ -499,7 +496,6 @@ public class TimeRed implements Authorization {
...
@@ -499,7 +496,6 @@ public class TimeRed implements Authorization {
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
ANCHOR_redOpen
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
ANCHOR_redOpen
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_redOpen
,
"访客H开启第4轮红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
ANCHOR_redOpen
,
"访客H开启第4轮红包失败"
,
response
.
body
().
asString
()));
visitorAuth8
();
visitorAuth8
();
...
...
src/test/java/com/kjj/cases/live/treasure/Treasure.java
View file @
c8539426
...
@@ -189,31 +189,6 @@ public class Treasure implements Authorization {
...
@@ -189,31 +189,6 @@ public class Treasure implements Authorization {
}
}
@Test
(
description
=
"访客H与访客B邀请关系绑定"
,
priority
=
10
)
public
void
访客
H
与访客
B
邀请关系绑定
()
{
visitorAuth2
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客B获取绑定结果和绑定凭证"
,
priority
=
11
)
public
void
访客
B
获取绑定结果和绑定凭证
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
//助力流程
//助力流程
@Test
(
description
=
"未登录查询分享人头像昵称"
,
priority
=
12
)
@Test
(
description
=
"未登录查询分享人头像昵称"
,
priority
=
12
)
public
void
未登录查询分享人头像昵称
()
{
public
void
未登录查询分享人头像昵称
()
{
...
@@ -346,30 +321,6 @@ public class Treasure implements Authorization {
...
@@ -346,30 +321,6 @@ public class Treasure implements Authorization {
}
}
@Test
(
description
=
"访客K邀请关系绑定"
,
priority
=
21
)
public
void
访客
K
邀请关系绑定
()
{
visitorAuth11
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
response
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
response
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客K获取绑定结果和绑定凭证"
,
priority
=
22
)
public
void
访客
K
获取绑定结果和绑定凭证
()
{
visitorAuth11
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"用户K给用户H助力"
,
priority
=
23
)
@Test
(
description
=
"用户K给用户H助力"
,
priority
=
23
)
public
void
用户
K
给用户
H
助力
()
{
public
void
用户
K
给用户
H
助力
()
{
visitorAuth11
();
visitorAuth11
();
...
@@ -384,32 +335,6 @@ public class Treasure implements Authorization {
...
@@ -384,32 +335,6 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户K给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户K给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客L邀请关系绑定"
,
priority
=
24
)
public
void
访客
L
邀请关系绑定
()
{
visitorAuth12
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客L获取绑定结果和绑定凭证"
,
priority
=
25
)
public
void
访客
L
获取绑定结果和绑定凭证
()
{
visitorAuth12
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"用户L给用户H助力"
,
priority
=
26
)
@Test
(
description
=
"用户L给用户H助力"
,
priority
=
26
)
public
void
用户
L
给用户
H
助力
()
{
public
void
用户
L
给用户
H
助力
()
{
visitorAuth12
();
visitorAuth12
();
...
@@ -424,32 +349,6 @@ public class Treasure implements Authorization {
...
@@ -424,32 +349,6 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户L给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户L给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客M邀请关系绑定"
,
priority
=
27
)
public
void
访客
M
邀请关系绑定
()
{
visitorAuth13
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客M获取绑定结果和绑定凭证"
,
priority
=
28
)
public
void
访客
M
获取绑定结果和绑定凭证
()
{
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"用户M给用户H助力"
,
priority
=
29
)
@Test
(
description
=
"用户M给用户H助力"
,
priority
=
29
)
public
void
用户
M
给用户
H
助力
()
{
public
void
用户
M
给用户
H
助力
()
{
visitorAuth13
();
visitorAuth13
();
...
@@ -464,31 +363,6 @@ public class Treasure implements Authorization {
...
@@ -464,31 +363,6 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户M给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户M给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客P邀请关系绑定"
,
priority
=
30
)
public
void
访客
P
邀请关系绑定
()
{
visitorAuth16
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客P获取绑定结果和绑定凭证"
,
priority
=
31
)
public
void
访客
P
获取绑定结果和绑定凭证
()
{
visitorAuth16
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"用户P给用户H助力"
,
priority
=
32
)
@Test
(
description
=
"用户P给用户H助力"
,
priority
=
32
)
public
void
用户
P
给用户
H
助力
()
{
public
void
用户
P
给用户
H
助力
()
{
visitorAuth16
();
visitorAuth16
();
...
@@ -503,31 +377,6 @@ public class Treasure implements Authorization {
...
@@ -503,31 +377,6 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户P给用户H助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户P给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客Q邀请关系绑定"
,
priority
=
33
)
public
void
访客
Q
邀请关系绑定
()
{
visitorAuth17
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客Q获取绑定结果和绑定凭证"
,
priority
=
34
)
public
void
访客
Q
获取绑定结果和绑定凭证
()
{
visitorAuth17
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"用户Q给用户H助力"
,
priority
=
35
)
@Test
(
description
=
"用户Q给用户H助力"
,
priority
=
35
)
public
void
用户
Q
给用户
H
助力
()
{
public
void
用户
Q
给用户
H
助力
()
{
visitorAuth17
();
visitorAuth17
();
...
@@ -713,30 +562,6 @@ public class Treasure implements Authorization {
...
@@ -713,30 +562,6 @@ public class Treasure implements Authorization {
this
.
shareSign
=
data
;
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客M与访客N邀请关系绑定"
,
priority
=
47
)
public
void
访客
M
与访客
N
邀请关系绑定
()
{
visitorAuth14
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客N获取绑定结果和绑定凭证"
,
priority
=
48
)
public
void
访客
N
获取绑定结果和绑定凭证
()
{
visitorAuth14
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
...
@@ -754,30 +579,6 @@ public class Treasure implements Authorization {
...
@@ -754,30 +579,6 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"访客N给访客M助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"访客N给访客M助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客M与访客R邀请关系绑定"
,
priority
=
50
)
public
void
访客
M
与访客
R
邀请关系绑定
()
{
visitorAuth18
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客R获取绑定结果和绑定凭证"
,
priority
=
51
)
public
void
访客
R
获取绑定结果和绑定凭证
()
{
visitorAuth18
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客R给访客M助力"
,
priority
=
52
)
@Test
(
description
=
"访客R给访客M助力"
,
priority
=
52
)
public
void
访客
R
给访客
M
助力
()
{
public
void
访客
R
给访客
M
助力
()
{
visitorAuth18
();
visitorAuth18
();
...
@@ -1051,31 +852,6 @@ public class Treasure implements Authorization {
...
@@ -1051,31 +852,6 @@ public class Treasure implements Authorization {
this
.
shareSign
=
data
;
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客N与访客O邀请关系绑定"
,
priority
=
69
)
public
void
访客
N
与访客
O
邀请关系绑定
()
{
visitorAuth15
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客O获取绑定结果和绑定凭证"
,
priority
=
70
)
public
void
访客
O
获取绑定结果和绑定凭证
()
{
visitorAuth15
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
type
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客O给访客N助力"
,
priority
=
71
)
@Test
(
description
=
"访客O给访客N助力"
,
priority
=
71
)
...
@@ -1190,18 +966,4 @@ public class Treasure implements Authorization {
...
@@ -1190,18 +966,4 @@ public class Treasure implements Authorization {
Assert
.
assertTrue
(
dataList
.
size
()==
6
,
network
.
message
(
openParam
,
BasicConfig
.
MANAGER_participateList
,
"查询领取列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
dataList
.
size
()==
6
,
network
.
message
(
openParam
,
BasicConfig
.
MANAGER_participateList
,
"查询领取列表失败"
,
response
.
body
().
asString
()));
}
}
/**
* 添加代理人绑定关系
*/
@Test
(
description
=
"代理人绑定"
,
priority
=
77
)
public
void
代理人绑定
()
{
agentAuth
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
c8539426
...
@@ -138,6 +138,8 @@ public class BasicConfig {
...
@@ -138,6 +138,8 @@ public class BasicConfig {
public
static
final
String
MANAGER_secondKillLists
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/list"
;
public
static
final
String
MANAGER_secondKillLists
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/list"
;
public
static
final
String
MANAGER_secondKillDel
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/delete"
;
public
static
final
String
MANAGER_secondKillDel
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/delete"
;
public
static
final
String
MANAGER_secondKillUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/update"
;
public
static
final
String
MANAGER_secondKillUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/update"
;
public
static
final
String
MANAGER_secondKillSaveLimitGroup
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/saveLimitGroup"
;
public
static
final
String
MANAGER_secondKillLimitGroupList
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/limitGroupList"
;
public
static
final
String
ANCHOR_secondKillSave
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/save"
;
public
static
final
String
ANCHOR_secondKillSave
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/save"
;
public
static
final
String
ANCHOR_secondKillLists
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/list"
;
public
static
final
String
ANCHOR_secondKillLists
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/list"
;
public
static
final
String
ANCHOR_secondKillUpdate
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/update"
;
public
static
final
String
ANCHOR_secondKillUpdate
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/update"
;
...
@@ -264,13 +266,14 @@ public class BasicConfig {
...
@@ -264,13 +266,14 @@ public class BasicConfig {
public
static
final
String
MOBILE_finishStatus
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/finishStatus"
;
public
static
final
String
MOBILE_finishStatus
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/finishStatus"
;
public
static
final
String
MOBILE_redOpen
=
MOBILE_HOST
+
"/kjy/live/flip/word/red/open"
;
public
static
final
String
MOBILE_redOpen
=
MOBILE_HOST
+
"/kjy/live/flip/word/red/open"
;
public
static
final
String
MOBILE_redOpenState
=
MOBILE_HOST
+
"/kjy/live/flip/word/red/open/state"
;
public
static
final
String
MOBILE_redOpenState
=
MOBILE_HOST
+
"/kjy/live/flip/word/red/open/state"
;
public
static
final
String
MOBILE_abort
=
MOBILE_HOST
+
"/kjy/live/flip/word/red/abort"
;
public
static
final
String
MOBILE_appointment
=
MOBILE_HOST
+
"/kjy/live/user/appointment"
;
public
static
final
String
MOBILE_appointment
=
MOBILE_HOST
+
"/kjy/live/user/appointment"
;
public
static
final
String
MOBILE_tasks
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/tasks"
;
public
static
final
String
MOBILE_tasks
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/tasks"
;
public
static
final
String
MOBILE_record
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/record"
;
public
static
final
String
MOBILE_record
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/record"
;
public
static
final
String
MOBILE_turn
=
MOBILE_HOST
+
"/kjy/live/flip/word/turn"
;
public
static
final
String
MOBILE_turn
=
MOBILE_HOST
+
"/kjy/live/flip/word/turn"
;
public
static
final
String
MOBILE_turnState
=
MOBILE_HOST
+
"/kjy/live/flip/word/turn/state"
;
public
static
final
String
MOBILE_turnState
=
MOBILE_HOST
+
"/kjy/live/flip/word/turn/state"
;
public
static
final
String
MOBILE_confV2
=
MOBILE_HOST
+
"/kjy/live/flip/word/conf/v2"
;
public
static
final
String
MOBILE_confV2
=
MOBILE_HOST
+
"/kjy/live/flip/word/conf/v2"
;
public
static
final
String
MOBILE_userLucky
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/lucky"
;
public
static
final
String
MOBILE_helpDetail
=
MOBILE_HOST
+
"/kjy/live/flip/word/user/helpDetail"
;
// *************** 直播间过渡视频 ***************
// *************** 直播间过渡视频 ***************
public
static
final
String
MANAGER_confCaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_confCaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_videoSwitch
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/status/switch"
;
public
static
final
String
MANAGER_videoSwitch
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/status/switch"
;
...
@@ -465,6 +468,7 @@ public class BasicConfig {
...
@@ -465,6 +468,7 @@ public class BasicConfig {
//客户管理
//客户管理
public
static
final
String
MOBILE_potentialCount
=
MOBILE_HOST
+
"/kjy/live/agent/customer/potentialCount"
;
public
static
final
String
MOBILE_potentialCount
=
MOBILE_HOST
+
"/kjy/live/agent/customer/potentialCount"
;
public
static
final
String
MOBILE_cusStat
=
MOBILE_HOST
+
"/kjy/live/agent/customer/cusStat"
;
public
static
final
String
MOBILE_customerList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/list"
;
public
static
final
String
MOBILE_customerList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/list"
;
public
static
final
String
MOBILE_lastLiveList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/lastLiveList"
;
public
static
final
String
MOBILE_lastLiveList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/lastLiveList"
;
public
static
final
String
MOBILE_basicInfo
=
MOBILE_HOST
+
"/kjy/live/agent/customer/basicInfo"
;
public
static
final
String
MOBILE_basicInfo
=
MOBILE_HOST
+
"/kjy/live/agent/customer/basicInfo"
;
...
@@ -475,6 +479,10 @@ public class BasicConfig {
...
@@ -475,6 +479,10 @@ public class BasicConfig {
public
static
final
String
MOBILE_followChanceList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/followChanceList"
;
public
static
final
String
MOBILE_followChanceList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/followChanceList"
;
public
static
final
String
MOBILE_customerGetReplyAdvice
=
MOBILE_HOST
+
"/kjy/live/agent/customer/getReplyAdvice"
;
public
static
final
String
MOBILE_customerGetReplyAdvice
=
MOBILE_HOST
+
"/kjy/live/agent/customer/getReplyAdvice"
;
public
static
final
String
MOBILE_followChanceDetail
=
MOBILE_HOST
+
"/kjy/live/agent/customer/followChanceDetail"
;
public
static
final
String
MOBILE_followChanceDetail
=
MOBILE_HOST
+
"/kjy/live/agent/customer/followChanceDetail"
;
public
static
final
String
MOBILE_custList
=
MOBILE_HOST
+
"/kjy/live/agent/customer/custList"
;
//单场直播线索
public
static
final
String
MOBILE_custStat
=
MOBILE_HOST
+
"/kjy/live/customer/stat"
;
public
static
final
String
MOBILE_liveCustList
=
MOBILE_HOST
+
"/kjy/live/customer/list"
;
// *************** 代理人 ***************
// *************** 代理人 ***************
public
static
final
String
MOBILE_recycleSuccessCase
=
MOBILE_HOST
+
"/kjy/live/agent/clue/recycleSuccessCase"
;
public
static
final
String
MOBILE_recycleSuccessCase
=
MOBILE_HOST
+
"/kjy/live/agent/clue/recycleSuccessCase"
;
public
static
final
String
MOBILE_providerInfo
=
MOBILE_HOST
+
"/kjy/live/agent/clue/providerInfo"
;
public
static
final
String
MOBILE_providerInfo
=
MOBILE_HOST
+
"/kjy/live/agent/clue/providerInfo"
;
...
...
src/test/java/com/kjj/utils/BaseUtils.java
View file @
c8539426
package
com
.
kjj
.
utils
;
package
com
.
kjj
.
utils
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.sql.KjyUserDB
;
import
com.kjj.sql.KjyUserDB
;
import
com.kjj.sql.UserSqlFactory
;
import
com.kjj.sql.UserSqlFactory
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -144,4 +147,39 @@ public class BaseUtils {
...
@@ -144,4 +147,39 @@ public class BaseUtils {
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_updateTypeOrDate
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
}
/*
* 访客到场
* */
public
static
void
connectSuccess
()
{
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
/*
* 关注直播间
* */
public
static
void
subscribelive
()
{
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
/*
* 抽奖码数量校验
* */
public
static
void
codeCount
(
int
num
)
{
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
int
data
=
myCountRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
data
,
num
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/utils/NetworkUtils.java
View file @
c8539426
...
@@ -60,6 +60,7 @@ public class NetworkUtils {
...
@@ -60,6 +60,7 @@ public class NetworkUtils {
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
}
}
System
.
out
.
println
(
response
.
body
().
asString
());
return
response
;
return
response
;
}
}
...
@@ -73,6 +74,7 @@ public class NetworkUtils {
...
@@ -73,6 +74,7 @@ public class NetworkUtils {
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
}
}
System
.
out
.
println
(
response
.
body
().
asString
());
return
response
;
return
response
;
}
}
...
@@ -85,6 +87,7 @@ public class NetworkUtils {
...
@@ -85,6 +87,7 @@ public class NetworkUtils {
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
}
}
System
.
out
.
println
(
response
.
body
().
asString
());
return
response
;
return
response
;
}
}
...
@@ -99,6 +102,7 @@ public class NetworkUtils {
...
@@ -99,6 +102,7 @@ public class NetworkUtils {
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
}
}
System
.
out
.
println
(
response
.
body
().
asString
());
return
response
;
return
response
;
}
}
...
@@ -111,6 +115,7 @@ public class NetworkUtils {
...
@@ -111,6 +115,7 @@ public class NetworkUtils {
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
}
}
System
.
out
.
println
(
response
.
body
().
asString
());
return
response
;
return
response
;
}
}
...
...
src/test/liveTestNG.xml
View file @
c8539426
...
@@ -35,6 +35,12 @@
...
@@ -35,6 +35,12 @@
<class
name=
"com.kjj.cases.live.secondKill.ConfSecondKill"
/>
<class
name=
"com.kjj.cases.live.secondKill.ConfSecondKill"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"绑定关系绑定"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.LiveBinding"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"配置代理人邀约奖励"
>
<test
preserve-order=
"true"
name=
"配置代理人邀约奖励"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.inviteReward.ManagerRewardConf"
/>
<class
name=
"com.kjj.cases.live.inviteReward.ManagerRewardConf"
/>
...
@@ -121,6 +127,12 @@
...
@@ -121,6 +127,12 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"访客签到"
>
<classes>
<class
name=
"com.kjj.cases.live.lotteryCode.SignIn"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"评论及回复"
>
<test
preserve-order=
"true"
name=
"评论及回复"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.Comment"
/>
<class
name=
"com.kjj.cases.live.liveConfig.Comment"
/>
...
@@ -132,12 +144,6 @@
...
@@ -132,12 +144,6 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"访客签到"
>
<classes>
<class
name=
"com.kjj.cases.live.lotteryCode.SignIn"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
...
...
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