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
6dfd7302
Commit
6dfd7302
authored
Oct 19, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feat/20211015-xmc
parents
233cec84
4c9e2eaa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
317 additions
and
172 deletions
+317
-172
Agent.java
src/test/java/com/kjj/cases/live/agent/Agent.java
+10
-7
FlipCard.java
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
+292
-151
LiveBinding.java
src/test/java/com/kjj/cases/live/liveConfig/LiveBinding.java
+1
-1
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+12
-12
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-1
No files found.
src/test/java/com/kjj/cases/live/agent/Agent.java
View file @
6dfd7302
...
@@ -115,18 +115,21 @@ public class Agent implements Authorization {
...
@@ -115,18 +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
));
// 判断代理人邀约奖励openFlag是否为开
Assert
.
assertNotNull
(
item
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Procurator
,
"查询直播列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
bean
.
getAgentAwardOpenFlag
(),
1
,
network
.
message
(
params
,
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/flipCard/FlipCard.java
View file @
6dfd7302
...
@@ -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
()
{
...
@@ -29,9 +30,9 @@ public class FlipCard implements Authorization {
...
@@ -29,9 +30,9 @@ public class FlipCard implements Authorization {
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("liveId",6441
);
Params
.
put
(
"firstInviteStatus"
,
2
);
Params
.
put
(
"freeNum"
,
1
);
Params
.
put
(
"freeNum"
,
3
);
Params
.
put
(
"helpNum"
,
1
);
Params
.
put
(
"helpNum"
,
2
);
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
...
@@ -65,13 +66,14 @@ public class FlipCard implements Authorization {
...
@@ -65,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"
);
...
@@ -118,8 +120,21 @@ public class FlipCard implements Authorization {
...
@@ -118,8 +120,21 @@ 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
<>();
...
@@ -131,8 +146,7 @@ public class FlipCard implements Authorization {
...
@@ -131,8 +146,7 @@ public class FlipCard implements Authorization {
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
=
7
)
public
void
根据分享类型获取分享内容
()
{
public
void
根据分享类型获取分享内容
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -144,8 +158,7 @@ public class FlipCard implements Authorization {
...
@@ -144,8 +158,7 @@ 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
)
@Test
(
description
=
"已登录查询分享人头像昵称"
,
priority
=
8
)
public
void
已登录查询分享人头像昵称
()
{
public
void
已登录查询分享人头像昵称
()
{
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
...
@@ -168,9 +181,105 @@ public class FlipCard implements Authorization {
...
@@ -168,9 +181,105 @@ public class FlipCard implements Authorization {
}
}
//预约,不增加翻牌机会
@Test
(
description
=
"翻牌集字_预约"
,
priority
=
11
)
public
void
翻牌集字
_
预约
()
{
@Test
(
description
=
"访客H获得助力"
,
priority
=
9
)
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
public
void
访客
H
获得助力
()
{
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
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_appointment
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_appointment
,
"预约失败"
,
response
.
body
().
asString
()));
visitorAuth22
();
ThreadSleepUtils
.
sleep
(
2000
);
Response
appointmentRes
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_appointment
);
boolean
data1
=
appointmentRes
.
jsonPath
().
getBoolean
(
"data"
);
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
()));
visitorAuth22
();
ThreadSleepUtils
.
sleep
(
2000
);
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
);
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
();
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
=
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
()));
...
@@ -191,34 +300,25 @@ public class FlipCard implements Authorization {
...
@@ -191,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
=
10
)
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
=
11
)
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);
...
@@ -226,67 +326,48 @@ public class FlipCard implements Authorization {
...
@@ -226,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
()));
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给用户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
<>();
...
@@ -294,55 +375,32 @@ public class FlipCard implements Authorization {
...
@@ -294,55 +375,32 @@ 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
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth9
();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_record
);
System
.
out
.
println
(
response
.
body
().
asString
());
int
leftNum
=
response
.
jsonPath
().
getJsonObject
(
"data.leftNum"
);
Assert
.
assertTrue
(
leftNum
==
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足"
,
response
.
body
().
asString
()));
visitorAuth22
();
Response
recordRes
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_record
);
System
.
out
.
println
(
recordRes
.
body
().
asString
());
int
leftNum1
=
response
.
jsonPath
().
getJsonObject
(
"data.leftNum"
);
Assert
.
assertTrue
(
leftNum1
==
5
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_record
,
"翻牌次数不足"
,
recordRes
.
body
().
asString
()));
}
@Test
(
description
=
"翻牌"
,
priority
=
19
)
public
void
翻牌
()
{
for
(
int
i
=
0
;
i
<
6
;
i
++){
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"
,
i
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
visitorAuth9
();
visitorAuth9
();
...
@@ -353,8 +411,8 @@ public class FlipCard implements Authorization {
...
@@ -353,8 +411,8 @@ 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"
,
i
);
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"
);
...
@@ -369,20 +427,101 @@ public class FlipCard implements Authorization {
...
@@ -369,20 +427,101 @@ 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"
,
i
);
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
()));
}
}
}
//管理后台红包等级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
=
"访客H获得第二次助力"
,
priority
=
22
)
public
void
访客
H
获得第二次助力
()
{
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
<>();
params
.
put
(
"turnType"
,
1
);
//1-活动页翻牌,2-助力翻牌
params
.
put
(
"pos"
,
6
);
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
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_turn
,
"翻牌开启失败"
,
response
.
body
().
asString
()));
@Test
(
description
=
"用户参与翻牌详情"
,
priority
=
20
)
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"turnType"
,
1
);
infoParam
.
put
(
"pos"
,
6
);
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
();
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"
,
6
);
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
()));
}
@Test
(
description
=
"用户参与翻牌详情"
,
priority
=
25
)
public
void
用户参与翻牌详情
()
{
public
void
用户参与翻牌详情
()
{
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -394,7 +533,10 @@ public class FlipCard implements Authorization {
...
@@ -394,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
();
...
@@ -403,11 +545,25 @@ public class FlipCard implements Authorization {
...
@@ -403,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
<>();
...
@@ -431,7 +587,7 @@ public class FlipCard implements Authorization {
...
@@ -431,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
);
...
@@ -448,24 +604,9 @@ public class FlipCard implements Authorization {
...
@@ -448,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
=
2
4
)
@Test
(
description
=
"开红包"
,
priority
=
2
9
)
public
void
开红包
()
{
public
void
开红包
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -484,7 +625,7 @@ public class FlipCard implements Authorization {
...
@@ -484,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
<>();
...
@@ -510,7 +651,7 @@ public class FlipCard implements Authorization {
...
@@ -510,7 +651,7 @@ public class FlipCard implements Authorization {
}
}
//开启不同等级的红包
//开启不同等级的红包
@Test
(
description
=
"开红包结果"
,
priority
=
26
)
@Test
(
description
=
"开红包结果"
,
priority
=
31
)
public
void
开红包结果
()
{
public
void
开红包结果
()
{
//红包等级I
//红包等级I
visitorAuth9
();
visitorAuth9
();
...
@@ -537,15 +678,15 @@ public class FlipCard implements Authorization {
...
@@ -537,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/liveConfig/LiveBinding.java
View file @
6dfd7302
...
@@ -104,7 +104,7 @@ public class LiveBinding implements Authorization {
...
@@ -104,7 +104,7 @@ public class LiveBinding implements Authorization {
token
();
token
();
}
}
//用户任务完成
@Test
(
description
=
"访客H分享直播间"
,
priority
=
6
)
@Test
(
description
=
"访客H分享直播间"
,
priority
=
6
)
public
void
访客
H
分享直播间
()
{
public
void
访客
H
分享直播间
()
{
visitorAuth9
();
visitorAuth9
();
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
6dfd7302
...
@@ -316,8 +316,8 @@ public class Lottery implements Authorization {
...
@@ -316,8 +316,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
<>();
...
@@ -333,12 +333,12 @@ public class Lottery implements Authorization {
...
@@ -333,12 +333,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
()));
...
@@ -346,12 +346,12 @@ public class Lottery implements Authorization {
...
@@ -346,12 +346,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
<>();
...
@@ -368,8 +368,8 @@ public class Lottery implements Authorization {
...
@@ -368,8 +368,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
<>();
...
@@ -1095,8 +1095,8 @@ public class Lottery implements Authorization {
...
@@ -1095,8 +1095,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
<>();
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
6dfd7302
...
@@ -266,13 +266,14 @@ public class BasicConfig {
...
@@ -266,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"
;
...
...
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