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
973f688d
Commit
973f688d
authored
May 28, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增猜数字红包
parent
7fda6d13
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
3005 additions
and
21583 deletions
+3005
-21583
CondDetail.java
src/test/java/com/kjj/bean/lottery/CondDetail.java
+9
-0
TreasureAward.java
src/test/java/com/kjj/bean/manager/TreasureAward.java
+1
-0
LotteryCode.java
...test/java/com/kjj/cases/live/LotteryCode/LotteryCode.java
+37
-114
AdminAuthorization.java
...est/java/com/kjj/cases/live/admin/AdminAuthorization.java
+26
-2
LiveGuess.java
src/test/java/com/kjj/cases/live/guess/LiveGuess.java
+339
-0
ManagerGuess.java
src/test/java/com/kjj/cases/live/guess/ManagerGuess.java
+32
-32
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+105
-105
TreasureTime.java
src/test/java/com/kjj/cases/live/lottery/TreasureTime.java
+422
-0
Share.java
src/test/java/com/kjj/cases/live/manager/Share.java
+84
-0
TreasureTime.java
src/test/java/com/kjj/cases/live/manager/TreasureTime.java
+49
-44
Limited.java
src/test/java/com/kjj/cases/live/red/Limited.java
+0
-2
LiveVistorRed.java
src/test/java/com/kjj/cases/live/red/LiveVistorRed.java
+44
-41
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+268
-214
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+52
-13
JsonUtil.java
src/test/java/com/kjj/utils/JsonUtil.java
+1
-0
liveTestNG.xml
src/test/liveTestNG.xml
+20
-1
report.html
test-output/report.html
+1516
-21015
No files found.
src/test/java/com/kjj/bean/lottery/CondDetail.java
0 → 100644
View file @
973f688d
package
com
.
kjj
.
bean
.
lottery
;
import
lombok.Data
;
@Data
public
class
CondDetail
{
private
String
treasureConfId
;
}
src/test/java/com/kjj/bean/manager/TreasureAward.java
View file @
973f688d
...
@@ -15,6 +15,7 @@ public class TreasureAward {
...
@@ -15,6 +15,7 @@ public class TreasureAward {
private
Integer
maxNum
;
private
Integer
maxNum
;
private
Integer
treasureProbability
;
private
Integer
treasureProbability
;
private
Integer
winLimitCount
;
private
Integer
winLimitCount
;
private
Integer
isLimit
;
...
...
src/test/java/com/kjj/cases/live/LotteryCode/LotteryCode.java
View file @
973f688d
...
@@ -15,20 +15,19 @@ import java.util.Map;
...
@@ -15,20 +15,19 @@ import java.util.Map;
public
class
LotteryCode
implements
AdminAuthorization
{
public
class
LotteryCode
implements
AdminAuthorization
{
public
String
shareSign
;
public
String
shareSign
;
public
String
token
;
@Test
(
description
=
"代理人A分享直播间"
,
priority
=
1
)
@Test
(
description
=
"代理人A分享直播间"
,
priority
=
1
)
public
void
代理人
A
分享直播间
()
{
public
void
代理人
A
分享直播间
()
{
agentAuth
();
agentAuth
();
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
()));
signParam
.
put
(
"shareType"
,
1
);
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_
GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_
sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
)
;
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
(),
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
())
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
2
)
@Test
(
description
=
"代理人A与访客A邀请关系绑定"
,
priority
=
2
)
...
@@ -36,7 +35,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -36,7 +35,7 @@ public class LotteryCode implements AdminAuthorization {
visitorAuth
();
visitorAuth
();
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
()));
bindingParam
.
put
(
"shareSign"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
())
);
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
...
@@ -50,42 +49,13 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -50,42 +49,13 @@ public class LotteryCode implements AdminAuthorization {
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取根据绑定凭证发放的抽奖码"
,
priority
=
4
)
public
void
访客
A
获取根据绑定凭证发放的抽奖码
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人A查询抽奖券列表"
,
priority
=
5
)
public
void
代理人
A
查询抽奖券列表
()
{
agentAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myLotteryCodeParam
.
put
(
"pageIndex"
,
1
);
myLotteryCodeParam
.
put
(
"pageSize"
,
30
);
Response
myLotteryCodeRes
=
network
.
getResponse
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
);
Object
data
=
myLotteryCodeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"代理人查询抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取直播所有的订阅消息模板"
,
priority
=
6
)
@Test
(
description
=
"访客A获取直播所有的订阅消息模板"
,
priority
=
4
)
public
void
访客
A
获取直播所有的订阅消息模板
()
{
public
void
访客
A
获取直播所有的订阅消息模板
()
{
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
...
@@ -96,7 +66,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -96,7 +66,7 @@ public class LotteryCode implements AdminAuthorization {
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
=
7
)
@Test
(
description
=
"访客A预约直播间"
,
priority
=
5
)
public
void
访客
A
预约直播间
()
{
public
void
访客
A
预约直播间
()
{
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
...
@@ -113,7 +83,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -113,7 +83,7 @@ public class LotteryCode implements AdminAuthorization {
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
=
8
)
@Test
(
description
=
"访客A关注直播间"
,
priority
=
6
)
public
void
访客
A
关注直播间
()
{
public
void
访客
A
关注直播间
()
{
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
...
@@ -128,7 +98,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -128,7 +98,7 @@ public class LotteryCode implements AdminAuthorization {
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
=
9
)
@Test
(
description
=
"访客A查询关注状态"
,
priority
=
7
)
public
void
访客
A
查询关注状态
()
{
public
void
访客
A
查询关注状态
()
{
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
...
@@ -140,7 +110,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -140,7 +110,7 @@ public class LotteryCode implements AdminAuthorization {
}
}
@Test
(
description
=
"访客A保存海报获得抽奖码"
,
priority
=
10
)
@Test
(
description
=
"访客A保存海报获得抽奖码"
,
priority
=
8
)
public
void
访客
A
保存海报获得抽奖码
()
{
public
void
访客
A
保存海报获得抽奖码
()
{
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
...
@@ -152,7 +122,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -152,7 +122,7 @@ public class LotteryCode implements AdminAuthorization {
}
}
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
11
)
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
9
)
public
void
访客
A
抽奖码数量
()
{
public
void
访客
A
抽奖码数量
()
{
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
...
@@ -164,7 +134,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -164,7 +134,7 @@ public class LotteryCode implements AdminAuthorization {
}
}
@Test
(
description
=
"访客A查询抽奖券列表"
,
priority
=
1
2
)
@Test
(
description
=
"访客A查询抽奖券列表"
,
priority
=
1
0
)
public
void
访客
A
查询抽奖券列表
()
{
public
void
访客
A
查询抽奖券列表
()
{
visitorAuth
();
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -178,7 +148,7 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -178,7 +148,7 @@ public class LotteryCode implements AdminAuthorization {
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
=
1
3
)
@Test
(
description
=
"访客H关系绑定"
,
priority
=
1
1
)
public
void
访客
H
关系绑定
()
{
public
void
访客
H
关系绑定
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -192,35 +162,19 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -192,35 +162,19 @@ public class LotteryCode implements AdminAuthorization {
}
}
@Test
(
description
=
"中奖任务邀请H绑定结果和绑定凭证"
,
priority
=
1
4
)
@Test
(
description
=
"中奖任务邀请H绑定结果和绑定凭证"
,
priority
=
1
2
)
public
void
获取访客
H
绑定结果和绑定凭证
()
{
public
void
获取访客
H
绑定结果和绑定凭证
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客J关系绑定"
,
priority
=
13
)
@Test
(
description
=
"中奖任务邀请H根据绑定凭证发放抽奖码"
,
priority
=
15
)
public
void
中奖任务邀请
H
根据绑定凭证发放抽奖码
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客J关系绑定"
,
priority
=
16
)
public
void
访客
J
关系绑定
()
{
public
void
访客
J
关系绑定
()
{
visitorAuth10
();
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -234,53 +188,37 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -234,53 +188,37 @@ public class LotteryCode implements AdminAuthorization {
}
}
@Test
(
description
=
"中奖任务邀请J绑定结果和绑定凭证"
,
priority
=
1
7
)
@Test
(
description
=
"中奖任务邀请J绑定结果和绑定凭证"
,
priority
=
1
4
)
public
void
获取访客
J
绑定结果和绑定凭证
()
{
public
void
获取访客
J
绑定结果和绑定凭证
()
{
visitorAuth10
();
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"邀请J根据绑定凭证发放抽奖码"
,
priority
=
18
)
public
void
邀请
J
根据绑定凭证发放抽奖码
()
{
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
}
//不同团队代理人绑定邀请关系
//不同团队代理人绑定邀请关系
@Test
(
description
=
"代理人B分享直播间"
,
priority
=
1
9
)
@Test
(
description
=
"代理人B分享直播间"
,
priority
=
1
5
)
public
void
代理人
B
分享直播间
()
{
public
void
代理人
B
分享直播间
()
{
agentAuth1
();
agentAuth1
();
ThreadSleepUtils
.
sleep
(
500
);
ThreadSleepUtils
.
sleep
(
500
);
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
()));
signParam
.
put
(
"shareType"
,
1
);
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_
GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_
sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
)
;
this
.
shareSign
=
data
;
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客I关系绑定"
,
priority
=
20
)
@Test
(
description
=
"访客I关系绑定"
,
priority
=
16
)
public
void
访客
I
关系绑定
()
{
public
void
访客
I
关系绑定
()
{
visitorAuth8
();
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -294,33 +232,18 @@ public class LotteryCode implements AdminAuthorization {
...
@@ -294,33 +232,18 @@ public class LotteryCode implements AdminAuthorization {
}
}
@Test
(
description
=
"邀请I绑定结果和绑定凭证"
,
priority
=
21
)
@Test
(
description
=
"邀请I绑定结果和绑定凭证"
,
priority
=
17
)
public
void
访客
I
绑定结果和绑定凭证
()
{
public
void
访客
I
绑定结果和绑定凭证
()
{
visitorAuth8
();
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"邀请I根据绑定凭证发放抽奖码"
,
priority
=
22
)
public
void
邀请
I
根据绑定凭证发放抽奖码
()
{
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/cases/live/admin/AdminAuthorization.java
View file @
973f688d
...
@@ -129,7 +129,7 @@ public interface AdminAuthorization {
...
@@ -129,7 +129,7 @@ public interface AdminAuthorization {
}
}
/**
/**
* 访客M(大妹子
保险)非实名用户授权,ID:102
* 访客M(大妹子
)非实名用户授权,ID:299
*/
*/
default
void
visitorAuth13
()
{
default
void
visitorAuth13
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY13
);
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY13
);
...
@@ -137,7 +137,7 @@ public interface AdminAuthorization {
...
@@ -137,7 +137,7 @@ public interface AdminAuthorization {
}
}
/**
/**
* 访客N(光头强)非实名用户授权,ID:
173
* 访客N(光头强)非实名用户授权,ID:
540
*/
*/
default
void
visitorAuth14
()
{
default
void
visitorAuth14
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY14
);
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY14
);
...
@@ -176,6 +176,30 @@ public interface AdminAuthorization {
...
@@ -176,6 +176,30 @@ public interface AdminAuthorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY18
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY18
);
}
}
/**
* 访客T(林国芸)ID:786
*/
default
void
visitorAuth19
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth19
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth19
);
}
/**
* 访客Y(孙心桂)ID:785
*/
default
void
visitorAuth20
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth20
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth20
);
}
/**
* 访客W(谢翊美)ID:791
*/
default
void
visitorAuth21
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth21
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth21
);
}
}
}
src/test/java/com/kjj/cases/live/guess/LiveGuess.java
0 → 100644
View file @
973f688d
package
com
.
kjj
.
cases
.
live
.
guess
;
import
com.kjj.bean.manager.GuessList
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
LiveGuess
implements
AdminAuthorization
{
public
List
<
GuessList
>
confId
;
public
String
ConfId
;
public
String
shareSign
;
Integer
guessMaxNum
;
Integer
guessMinNum
;
Integer
confGuessMaxNum
=
10
;
Integer
confGuessMinNum
=
1
;
private
Integer
getMidNum
(
int
max
,
int
min
){
return
(
max
+
min
)
/
2
;
}
@Test
(
description
=
"直播中新增猜数字红包"
,
priority
=
1
)
public
void
直播中新增猜数字红包
()
{
adminAuth
();
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
saveParam
.
put
(
"redAmount"
,
66
);
saveParam
.
put
(
"redRealNum"
,
1
);
saveParam
.
put
(
"redShowNum"
,
1
);
saveParam
.
put
(
"guessMinNum"
,
confGuessMinNum
);
saveParam
.
put
(
"guessMaxNum"
,
confGuessMaxNum
);
saveParam
.
put
(
"guessLeastTime"
,
4
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MOBILE_saveOrUpdate2
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_saveOrUpdate2
,
"新增猜数字红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询猜数字红包列表"
,
priority
=
2
)
public
void
查询猜数字红包列表
()
{
adminAuth
();
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
listParam
,
BasicConfig
.
MOBILE_guessList
);
List
<
GuessList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
GuessList
.
class
,
"guessList"
);
System
.
out
.
println
(
list
);
this
.
confId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
listParam
,
BasicConfig
.
MOBILE_guessList
,
"查询猜数字红包列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询猜数字红包详情页"
,
priority
=
3
)
public
void
查询猜数字红包详情页
()
{
adminAuth
();
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
detailParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MOBILE_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MOBILE_detail1
,
"查询猜数字红包详情页失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"直播中编辑猜数字红包"
,
priority
=
4
)
public
void
直播中编辑猜数字红包
()
{
adminAuth
();
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
saveParam
.
put
(
"redAmount"
,
66
);
saveParam
.
put
(
"redRealNum"
,
1
);
saveParam
.
put
(
"redShowNum"
,
1
);
saveParam
.
put
(
"guessMinNum"
,
1
);
saveParam
.
put
(
"guessMaxNum"
,
10
);
saveParam
.
put
(
"guessLeastTime"
,
4
);
saveParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MOBILE_saveOrUpdate2
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_saveOrUpdate2
,
"编辑猜数红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"发放猜数红包"
,
priority
=
5
)
public
void
发放猜数红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
startParam
=
new
HashMap
<>();
startParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
startParam
.
put
(
"type"
,
1
);
startParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
startParam
,
BasicConfig
.
MOBILE_startOrEnd
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
startParam
,
BasicConfig
.
MOBILE_startOrEnd
,
"发放猜数红包失败"
,
response
.
body
().
asString
()));
}
//访客端
@Test
(
description
=
"访客H查询猜数字红包配置详情"
,
priority
=
6
)
public
void
访客
H
查询猜数字红包配置详情
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
confDetailParam
,
BasicConfig
.
MOBILE_confDetail
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
ConfId
=(
String
)
data
.
get
(
"confId"
);
System
.
out
.
println
(
ConfId
);
Assert
.
assertNotNull
(
ConfId
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MOBILE_confDetail
,
"访客H查询猜数字红包配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H查询红包信息详情"
,
priority
=
7
)
public
void
访客
H
查询红包信息详情
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
userDetailParam
=
new
HashMap
<>();
userDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
getResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_userDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_userDetail
,
"访客H查询红包信息详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H第1次参与猜数字红包"
,
priority
=
8
)
public
void
访客
H
第
1
次参与猜数字红包
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
userDetailParam
=
new
HashMap
<>();
userDetailParam
.
put
(
"guessNum"
,
getMidNum
(
confGuessMaxNum
,
confGuessMinNum
));
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第1次参与猜数字红包失败"
,
response
.
body
().
asString
()));
this
.
guessMaxNum
=(
Integer
)
data
.
get
(
"guessMaxNum"
);
this
.
guessMinNum
=
(
Integer
)
data
.
get
(
"guessMinNum"
);
}
@Test
(
description
=
"访客H获取分享加密串"
,
priority
=
9
)
public
void
访客
H
获取分享加密串
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
2
);
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
=
"用户J给用户H助力"
,
priority
=
10
)
public
void
用户
J
给用户
H
助力
()
{
visitorAuth10
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
6
);
infoParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户J给用户H助力失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H第2次参与猜数字红包"
,
priority
=
11
)
public
void
访客
H
第
2
次参与猜数字红包
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
userDetailParam
=
new
HashMap
<>();
userDetailParam
.
put
(
"guessNum"
,
getMidNum
(
guessMaxNum
,
guessMinNum
));
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第3次参与猜数字红包失败"
,
response
.
body
().
asString
()));
this
.
guessMaxNum
=(
Integer
)
data
.
get
(
"guessMaxNum"
);
this
.
guessMinNum
=
(
Integer
)
data
.
get
(
"guessMinNum"
);
}
@Test
(
description
=
"用户W给用户H助力"
,
priority
=
12
)
public
void
用户
W
给用户
H
助力
()
{
visitorAuth21
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
6
);
infoParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H第3次参与猜数字红包"
,
priority
=
13
)
public
void
访客
H
第
3
次参与猜数字红包
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
userDetailParam
=
new
HashMap
<>();
userDetailParam
.
put
(
"guessNum"
,
getMidNum
(
guessMaxNum
,
guessMinNum
));
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第3次参与猜数字红包失败"
,
response
.
body
().
asString
()));
this
.
guessMaxNum
=(
Integer
)
data
.
get
(
"guessMaxNum"
);
this
.
guessMinNum
=
(
Integer
)
data
.
get
(
"guessMinNum"
);
}
//助力
@Test
(
description
=
"用户T给用户H助力"
,
priority
=
14
)
public
void
用户
T
给用户
H
助力
()
{
visitorAuth19
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
6
);
infoParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户T给用户H助力失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H第4次参与猜数字红包"
,
priority
=
15
)
public
void
访客
H
第
4
次参与猜数字红包
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
userDetailParam
=
new
HashMap
<>();
userDetailParam
.
put
(
"guessNum"
,
getMidNum
(
guessMaxNum
,
guessMinNum
));
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第4次参与猜数字红包失败"
,
response
.
body
().
asString
()));
this
.
guessMaxNum
=(
Integer
)
data
.
get
(
"guessMaxNum"
);
this
.
guessMinNum
=
(
Integer
)
data
.
get
(
"guessMinNum"
);
}
//助力
@Test
(
description
=
"用户Y给用户H助力"
,
priority
=
16
)
public
void
用户
Y
给用户
H
助力
()
{
visitorAuth20
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
6
);
infoParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户Y给用户H助力失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H第5次参与猜数字红包"
,
priority
=
17
)
public
void
访客
H
第
5
次参与猜数字红包
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
userDetailParam
=
new
HashMap
<>();
userDetailParam
.
put
(
"guessNum"
,
getMidNum
(
guessMaxNum
,
guessMinNum
));
userDetailParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
userDetailParam
,
BasicConfig
.
MOBILE_guess
,
"访客H第2次参与猜数字红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H参与猜数字红包领取红包"
,
priority
=
18
)
public
void
访客
H
第
1
次参与猜数字红包领取红包
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MOBILE_open
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
MOBILE_open
,
"访客H第1次参与猜数字红包领取红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H轮询红包开启结果"
,
priority
=
19
)
public
void
访客
H
轮询红包开启结果
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
resultParam
=
new
HashMap
<>();
resultParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
getResponse
(
resultParam
,
BasicConfig
.
MOBILE_result
);
long
redReceiveStatus
=
response
.
jsonPath
().
getLong
(
"data.redReceiveStatus"
);
System
.
out
.
println
(
redReceiveStatus
);
Assert
.
assertTrue
(
redReceiveStatus
==
4
,
network
.
message
(
resultParam
,
BasicConfig
.
MOBILE_result
,
"访客H轮询红包开启结果失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"结束猜数红包"
,
priority
=
20
)
public
void
结束猜数红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
endParam
=
new
HashMap
<>();
endParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
endParam
.
put
(
"type"
,
2
);
endParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
endParam
,
BasicConfig
.
MOBILE_startOrEnd
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
endParam
,
BasicConfig
.
MOBILE_startOrEnd
,
"结束猜数红包失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/guess/ManagerGuess.java
View file @
973f688d
...
@@ -94,32 +94,32 @@ public class ManagerGuess implements AdminAuthorization {
...
@@ -94,32 +94,32 @@ public class ManagerGuess implements AdminAuthorization {
@Test
(
description
=
"编辑猜数字红包"
,
priority
=
5
)
@Test
(
description
=
"编辑猜数字红包"
,
priority
=
5
)
public
void
编辑猜数字红包
()
{
public
void
编辑猜数字红包
()
{
Map
<
String
,
Object
>
Amount
Param
=
new
HashMap
<>();
Map
<
String
,
Object
>
update
Param
=
new
HashMap
<>();
Amount
Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
update
Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Amount
Param
.
put
(
"redAmount"
,
88
);
update
Param
.
put
(
"redAmount"
,
88
);
Amount
Param
.
put
(
"redRealNum"
,
1
);
update
Param
.
put
(
"redRealNum"
,
1
);
Amount
Param
.
put
(
"redShowNum"
,
1
);
update
Param
.
put
(
"redShowNum"
,
1
);
Amount
Param
.
put
(
"guessMinNum"
,
1
);
update
Param
.
put
(
"guessMinNum"
,
1
);
Amount
Param
.
put
(
"guessMaxNum"
,
10
);
update
Param
.
put
(
"guessMaxNum"
,
10
);
Amount
Param
.
put
(
"guessLeastTime"
,
4
);
update
Param
.
put
(
"guessLeastTime"
,
4
);
Amount
Param
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
update
Param
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
Amount
Param
,
BasicConfig
.
MANAGER_saveOrUpdate1
);
Response
response
=
network
.
postResponse
(
update
Param
,
BasicConfig
.
MANAGER_saveOrUpdate1
);
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
(
Amount
Param
,
BasicConfig
.
MANAGER_saveOrUpdate1
,
"新增猜数字红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
update
Param
,
BasicConfig
.
MANAGER_saveOrUpdate1
,
"新增猜数字红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"删除猜数字红包"
,
priority
=
6
)
@Test
(
description
=
"删除猜数字红包"
,
priority
=
6
)
public
void
删除猜数字红包
()
{
public
void
删除猜数字红包
()
{
Map
<
String
,
Object
>
de
tai
lParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
delParam
=
new
HashMap
<>();
de
tai
lParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
delParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
de
tai
lParam
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
delParam
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
de
tai
lParam
,
BasicConfig
.
MANAGER_del_1
);
Response
response
=
network
.
postResponse
(
delParam
,
BasicConfig
.
MANAGER_del_1
);
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
(
de
tai
lParam
,
BasicConfig
.
MANAGER_del_1
,
"删除猜数字红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
delParam
,
BasicConfig
.
MANAGER_del_1
,
"删除猜数字红包失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -187,19 +187,19 @@ public class ManagerGuess implements AdminAuthorization {
...
@@ -187,19 +187,19 @@ public class ManagerGuess implements AdminAuthorization {
@Test
(
description
=
"直播前编辑猜数字红包"
,
priority
=
11
)
@Test
(
description
=
"直播前编辑猜数字红包"
,
priority
=
11
)
public
void
直播前编辑猜数字红包
()
{
public
void
直播前编辑猜数字红包
()
{
adminAuth
();
adminAuth
();
Map
<
String
,
Object
>
Amount
Param
=
new
HashMap
<>();
Map
<
String
,
Object
>
update
Param
=
new
HashMap
<>();
Amount
Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
update
Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Amount
Param
.
put
(
"redAmount"
,
99
);
update
Param
.
put
(
"redAmount"
,
99
);
Amount
Param
.
put
(
"redRealNum"
,
1
);
update
Param
.
put
(
"redRealNum"
,
1
);
Amount
Param
.
put
(
"redShowNum"
,
10
);
update
Param
.
put
(
"redShowNum"
,
10
);
Amount
Param
.
put
(
"guessMinNum"
,
1
);
update
Param
.
put
(
"guessMinNum"
,
1
);
Amount
Param
.
put
(
"guessMaxNum"
,
10
);
update
Param
.
put
(
"guessMaxNum"
,
10
);
Amount
Param
.
put
(
"guessLeastTime"
,
4
);
update
Param
.
put
(
"guessLeastTime"
,
4
);
Amount
Param
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
update
Param
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
Amount
Param
,
BasicConfig
.
MOBILE_saveOrUpdate
);
Response
response
=
network
.
postResponse
(
update
Param
,
BasicConfig
.
MOBILE_saveOrUpdate
);
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
(
Amount
Param
,
BasicConfig
.
MOBILE_saveOrUpdate
,
"直播前编辑猜数字红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
update
Param
,
BasicConfig
.
MOBILE_saveOrUpdate
,
"直播前编辑猜数字红包失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -207,13 +207,13 @@ public class ManagerGuess implements AdminAuthorization {
...
@@ -207,13 +207,13 @@ public class ManagerGuess implements AdminAuthorization {
@Test
(
description
=
"直播前删除猜数字红包"
,
priority
=
12
)
@Test
(
description
=
"直播前删除猜数字红包"
,
priority
=
12
)
public
void
直播前删除猜数字红包
()
{
public
void
直播前删除猜数字红包
()
{
adminAuth
();
adminAuth
();
Map
<
String
,
Object
>
de
tai
lParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
delParam
=
new
HashMap
<>();
de
tai
lParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
delParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
de
tai
lParam
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
delParam
.
put
(
"confId"
,
this
.
confid
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
de
tai
lParam
,
BasicConfig
.
MOBILE_delete
);
Response
response
=
network
.
postResponse
(
delParam
,
BasicConfig
.
MOBILE_delete
);
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
(
de
tai
lParam
,
BasicConfig
.
MOBILE_delete
,
"直播前删除猜数字红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
delParam
,
BasicConfig
.
MOBILE_delete
,
"直播前删除猜数字红包失败"
,
response
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
973f688d
...
@@ -20,7 +20,6 @@ public class Lottery implements AdminAuthorization {
...
@@ -20,7 +20,6 @@ public class Lottery implements AdminAuthorization {
public
List
<
ConfidList
>
List_Confid
;
public
List
<
ConfidList
>
List_Confid
;
public
String
shareSign
;
public
String
shareSign
;
public
String
token
;
@Test
(
description
=
"代理人抽奖活动弹层福利列表"
,
priority
=
1
)
@Test
(
description
=
"代理人抽奖活动弹层福利列表"
,
priority
=
1
)
public
void
抽奖活动弹层福利列表
()
{
public
void
抽奖活动弹层福利列表
()
{
...
@@ -50,10 +49,10 @@ public class Lottery implements AdminAuthorization {
...
@@ -50,10 +49,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth
();
visitorAuth
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客B到场"
,
priority
=
4
)
@Test
(
description
=
"访客B到场"
,
priority
=
4
)
...
@@ -61,10 +60,10 @@ public class Lottery implements AdminAuthorization {
...
@@ -61,10 +60,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -293,14 +292,13 @@ public class Lottery implements AdminAuthorization {
...
@@ -293,14 +292,13 @@ public class Lottery implements AdminAuthorization {
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
()));
signParam
.
put
(
"shareType"
,
2
);
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
data
;
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"中奖任务邀请C关系绑定"
,
priority
=
21
)
@Test
(
description
=
"中奖任务邀请C关系绑定"
,
priority
=
21
)
public
void
中奖任务邀请
C
关系绑定
()
{
public
void
中奖任务邀请
C
关系绑定
()
{
...
@@ -322,27 +320,29 @@ public class Lottery implements AdminAuthorization {
...
@@ -322,27 +320,29 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"中奖任务邀请C根据绑定凭证发放抽奖码"
,
priority
=
23
)
public
void
中奖任务邀请
C
根据绑定凭证发放抽奖码
()
{
@Test
(
description
=
"访客C给访客A助力"
,
priority
=
23
)
public
void
访客
C
给访客
A
助力
()
{
visitorAuth3
();
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
assistParam
.
put
(
"shareSign"
,
shareSign
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
assistParam
.
put
(
"shareType"
,
3
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
System
.
out
.
println
(
success
);
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客C给访客A助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客C到场"
,
priority
=
24
)
@Test
(
description
=
"访客C到场"
,
priority
=
24
)
public
void
访客
C
到场
()
{
public
void
访客
C
到场
()
{
visitorAuth3
();
visitorAuth3
();
...
@@ -398,16 +398,16 @@ public class Lottery implements AdminAuthorization {
...
@@ -398,16 +398,16 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Object
data
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data
"
);
boolean
hasDrawTask
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data.hasDrawTask
"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
hasDrawTask
);
Assert
.
assert
NotNull
(
data
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
Assert
.
assert
True
(
hasDrawTask
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A抽奖券列表"
,
priority
=
29
)
@Test
(
description
=
"访客A抽奖券列表"
,
priority
=
29
)
public
void
访客
A
抽奖券列表
()
{
public
void
访客
A
抽奖券列表
()
{
visitorAuth
();
visitorAuth
();
ThreadSleepUtils
.
sleep
(
5
000
);
ThreadSleepUtils
.
sleep
(
3
000
);
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
()));
myLotteryCodeParam
.
put
(
"pageIndex"
,
1
);
myLotteryCodeParam
.
put
(
"pageIndex"
,
1
);
...
@@ -463,12 +463,12 @@ public class Lottery implements AdminAuthorization {
...
@@ -463,12 +463,12 @@ public class Lottery implements AdminAuthorization {
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
()));
signParam
.
put
(
"shareType"
,
2
);
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
data
;
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
...
@@ -492,25 +492,25 @@ public class Lottery implements AdminAuthorization {
...
@@ -492,25 +492,25 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
幸运任务邀请D根据绑定凭证发放抽奖码
"
,
priority
=
35
)
@Test
(
description
=
"
访客D给访客B助力
"
,
priority
=
35
)
public
void
幸运任务邀请
D
根据绑定凭证发放抽奖码
()
{
public
void
访客
D
给访客
B
助力
()
{
visitorAuth4
();
visitorAuth4
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
assistParam
.
put
(
"shareSign"
,
shareSign
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
assistParam
.
put
(
"shareType"
,
3
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
System
.
out
.
println
(
success
);
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客D给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客D到场"
,
priority
=
36
)
@Test
(
description
=
"访客D到场"
,
priority
=
36
)
...
@@ -518,10 +518,10 @@ public class Lottery implements AdminAuthorization {
...
@@ -518,10 +518,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth4
();
visitorAuth4
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客D关注直播间"
,
priority
=
37
)
@Test
(
description
=
"访客D关注直播间"
,
priority
=
37
)
...
@@ -568,25 +568,25 @@ public class Lottery implements AdminAuthorization {
...
@@ -568,25 +568,25 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
幸运任务邀请E根据绑定凭证发放抽奖码
"
,
priority
=
41
)
@Test
(
description
=
"
访客E给访客B助力
"
,
priority
=
41
)
public
void
幸运任务邀请
E
根据绑定凭证发放抽奖码
()
{
public
void
访客
E
给访客
B
助力
()
{
visitorAuth5
();
visitorAuth5
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
assistParam
.
put
(
"shareSign"
,
shareSign
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
assistParam
.
put
(
"shareType"
,
3
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
System
.
out
.
println
(
success
);
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客E给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客E到场"
,
priority
=
42
)
@Test
(
description
=
"访客E到场"
,
priority
=
42
)
...
@@ -605,10 +605,10 @@ public class Lottery implements AdminAuthorization {
...
@@ -605,10 +605,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth5
();
visitorAuth5
();
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
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
Response
response
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客E抽奖码数量"
,
priority
=
44
)
@Test
(
description
=
"访客E抽奖码数量"
,
priority
=
44
)
...
@@ -644,24 +644,24 @@ public class Lottery implements AdminAuthorization {
...
@@ -644,24 +644,24 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
幸运任务邀请F根据绑定凭证发放抽奖码
"
,
priority
=
47
)
@Test
(
description
=
"
访客F给访客B助力
"
,
priority
=
47
)
public
void
幸运任务邀请
F
根据绑定凭证发放抽奖码
()
{
public
void
访客
F
给访客
B
助力
()
{
visitorAuth6
();
visitorAuth6
();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
codeParam
.
put
(
"token"
,
token
);
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
assistParam
.
put
(
"shareSign"
,
shareSign
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"shareType"
,
3
);
System
.
out
.
println
(
success
);
assistParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客F给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F到场"
,
priority
=
48
)
@Test
(
description
=
"访客F到场"
,
priority
=
48
)
...
@@ -669,10 +669,10 @@ public class Lottery implements AdminAuthorization {
...
@@ -669,10 +669,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth6
();
visitorAuth6
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
Response
response
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客F关注直播间"
,
priority
=
49
)
@Test
(
description
=
"访客F关注直播间"
,
priority
=
49
)
...
@@ -720,24 +720,24 @@ public class Lottery implements AdminAuthorization {
...
@@ -720,24 +720,24 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
幸运任务邀请G根据绑定凭证发放抽奖码
"
,
priority
=
53
)
@Test
(
description
=
"
访客G给访客B助力
"
,
priority
=
53
)
public
void
幸运任务邀请
G
根据绑定凭证发放抽奖码
()
{
public
void
访客
G
给访客
B
助力
()
{
visitorAuth7
();
visitorAuth7
();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
codeParam
.
put
(
"token"
,
token
);
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
assistParam
.
put
(
"shareSign"
,
shareSign
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"shareType"
,
3
);
System
.
out
.
println
(
success
);
assistParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客G给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客G到场"
,
priority
=
54
)
@Test
(
description
=
"访客G到场"
,
priority
=
54
)
...
@@ -783,9 +783,9 @@ public class Lottery implements AdminAuthorization {
...
@@ -783,9 +783,9 @@ public class Lottery implements AdminAuthorization {
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Object
data
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data
"
);
boolean
hasFinish
=
luckDetailRes
.
jsonPath
().
getBoolean
(
"data.hasFinish
"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
hasFinish
);
Assert
.
assert
NotNull
(
data
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
Assert
.
assert
True
(
hasFinish
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/cases/live/lottery/TreasureTime.java
View file @
973f688d
package
com
.
kjj
.
cases
.
live
.
lottery
;
package
com
.
kjj
.
cases
.
live
.
lottery
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.lottery.CondDetail
;
import
com.kjj.bean.manager.GuessList
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
TreasureTime
implements
AdminAuthorization
{
public
class
TreasureTime
implements
AdminAuthorization
{
public
List
<
CondDetail
>
treasureConfId
;
@Test
(
description
=
"获取宝箱配置详情"
,
priority
=
1
)
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_timeDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_timeDetail
,
"访客H获取宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取宝箱参与情况"
,
priority
=
2
)
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_joinDetail
);
List
<
CondDetail
>
treasureList
=
JsonUtil
.
parseResponseToListBean
(
response
,
CondDetail
.
class
,
"condDetail"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
treasureList
));
this
.
treasureConfId
=
treasureList
;
System
.
out
.
println
(
treasureList
);
String
errorMsg
=
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
());
Assert
.
assertNotNull
(
treasureList
,
errorMsg
);
}
@Test
(
description
=
"完成第1个观看任务"
,
priority
=
3
)
public
void
完成第
1
个观看任务
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取第1个宝箱参与情况"
,
priority
=
4
)
public
void
获取第
1
个宝箱参与情况
()
{
visitorAuth9
();
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_joinDetail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取第1个宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H开启第1个宝箱"
,
priority
=
5
)
public
void
开启第
1
个宝箱
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H开启第1个宝箱失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询第1个宝箱中奖结果"
,
priority
=
6
)
public
void
查询第
1
个宝箱中奖结果
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H查询第1个宝箱中奖结果失败"
,
response
.
body
().
asString
()));
}
//第2个宝箱校验红包
@Test
(
description
=
"完成第2个观看任务"
,
priority
=
7
)
public
void
完成第
2
个观看任务
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
1
).
getTreasureConfId
());
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"获取第2个宝箱参与情况"
,
priority
=
8
)
public
void
获取第
2
个宝箱参与情况
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"开启第2个宝箱"
,
priority
=
9
)
public
void
开启第
2
个宝箱
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
1
).
getTreasureConfId
());
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"查询第2个宝箱中奖结果"
,
priority
=
10
)
public
void
查询第
2
个宝箱中奖结果
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
1
).
getTreasureConfId
());
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
//第3个宝箱校验实物
@Test
(
description
=
"完成第3个观看任务"
,
priority
=
11
)
public
void
完成第
3
个观看任务
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
2
).
getTreasureConfId
());
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"获取第3个宝箱参与情况"
,
priority
=
12
)
public
void
获取第
3
个宝箱参与情况
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"开启第3个宝箱"
,
priority
=
13
)
public
void
开启第
3
个宝箱
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
2
).
getTreasureConfId
());
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
@Test
(
description
=
"查询第3个宝箱中奖结果"
,
priority
=
14
)
public
void
查询第
3
个宝箱中奖结果
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
2
).
getTreasureConfId
());
//黑名单用户
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response1
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data1
=
response1
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response1
.
body
().
asString
()));
//红包发完降级抽奖码
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
1000
);
Response
response2
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data2
=
response2
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response2
.
body
().
asString
()));
}
//第4个宝箱校验随机抽奖码
@Test
(
description
=
"完成第4个观看任务"
,
priority
=
15
)
public
void
完成第
4
个观看任务
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
3
).
getTreasureConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取第4个宝箱参与情况"
,
priority
=
16
)
public
void
获取第
4
个宝箱参与情况
()
{
visitorAuth9
();
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_joinDetail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinDetail1
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启第4个宝箱"
,
priority
=
17
)
public
void
开启第
4
个宝箱
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
3
).
getTreasureConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询第4个宝箱中奖结果"
,
priority
=
18
)
public
void
查询第
4
个宝箱中奖结果
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
3
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinResult
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_joinResult
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/cases/live/manager/Share.java
0 → 100644
View file @
973f688d
package
com
.
kjj
.
cases
.
live
.
manager
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
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
;
public
class
Share
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
@Test
(
description
=
"新增常规小程序分享"
,
priority
=
1
)
public
void
新增常规小程序分享
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"mpShareUrl"
,
"//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg"
);
saveParam
.
put
(
"mpShareTitle"
,
"「{{welfareName}}」常规分享文案{{name}}"
);
saveParam
.
put
(
"shareType"
,
1
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveOrUpdateMpShare
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_info
,
"新增常规小程序分享失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"新增红包小程序分享"
,
priority
=
2
)
public
void
新增红包宝箱小程序分享
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"mpShareUrl"
,
"//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg"
);
saveParam
.
put
(
"mpShareTitle"
,
"「{{welfareName}}」红包分享文案{{name}}"
);
saveParam
.
put
(
"shareType"
,
2
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveOrUpdateMpShare
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_info
,
"新增红包小程序分享失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"新增直播宝箱小程序分享"
,
priority
=
3
)
public
void
新增直播宝箱小程序分享
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"mpShareUrl"
,
"//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg"
);
saveParam
.
put
(
"mpShareTitle"
,
"「{{welfareName}}」宝箱裂变分享文案{{name}}"
);
saveParam
.
put
(
"shareType"
,
4
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveOrUpdateMpShare
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_info
,
"新增直播宝箱小程序分享失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"新增猜数红包小程序分享"
,
priority
=
4
)
public
void
新增猜数红包小程序分享
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"mpShareUrl"
,
"//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg"
);
saveParam
.
put
(
"mpShareTitle"
,
"「{{welfareName}}」猜数字红包分享文案{{name}}"
);
saveParam
.
put
(
"shareType"
,
5
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveOrUpdateMpShare
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_info
,
"新增猜数红包小程序分享失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/manager/TreasureTime.java
View file @
973f688d
...
@@ -47,35 +47,35 @@ public class TreasureTime implements AdminAuthorization {
...
@@ -47,35 +47,35 @@ public class TreasureTime implements AdminAuthorization {
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
null
);
treasureCode
.
setMaxNum
(
0
);
treasureCode
.
setRuleType
(
1
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
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
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"
第一轮宝箱时长配置失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"
停留时长1分钟固定抽奖码
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取第
一
轮宝箱配置详情"
,
priority
=
3
)
@Test
(
description
=
"获取第
1
轮宝箱配置详情"
,
priority
=
3
)
public
void
获取第
一
轮宝箱配置详情
()
{
public
void
获取第
1
轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第
一
轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第
1
轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"停留时长2分钟
随机抽奖码
"
,
priority
=
4
)
@Test
(
description
=
"停留时长2分钟
现金红包
"
,
priority
=
4
)
public
void
停留时长
2
分钟
随机抽奖码
()
{
public
void
停留时长
2
分钟
现金红包
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"boxConfType"
,
2
);
updateParam
.
put
(
"openCondition"
,
2
);
updateParam
.
put
(
"openCondition"
,
2
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
...
@@ -84,30 +84,53 @@ public class TreasureTime implements AdminAuthorization {
...
@@ -84,30 +84,53 @@ public class TreasureTime implements AdminAuthorization {
treasureCode
.
setRuleType
(
2
);
treasureCode
.
setRuleType
(
2
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureRed
treasureRed
=
new
TreasureRed
();
treasureRed
.
setRedTotalAmount
(
100
);
treasureRed
.
setRuleType
(
1
);
treasureRed
.
setTotalNum
(
1
);
treasureRed
.
setFixedNum
(
30
);
updateParam
.
put
(
"treasureRed"
,
treasureRed
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
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
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"
第二轮宝箱时长
配置失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"
停留时长2分钟现金红包
配置失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取第
二
轮宝箱配置详情"
,
priority
=
5
)
@Test
(
description
=
"获取第
2
轮宝箱配置详情"
,
priority
=
5
)
public
void
获取第
二
轮宝箱配置详情
()
{
public
void
获取第
2
轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第二轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第2轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询奖品列表"
,
priority
=
6
)
public
void
查询奖品列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
getListParam
.
put
(
"companyId"
,
101
);
getListParam
.
put
(
"pageIndex"
,
1
);
getListParam
.
put
(
"pageSize"
,
20
);
getListParam
.
put
(
"welfareType"
,
6
);
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
,
"查询奖品列表失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"停留时长3分钟
随机抽奖码"
,
priority
=
6
)
@Test
(
description
=
"停留时长3分钟
实物奖品"
,
priority
=
7
)
public
void
停留时长
3
分钟
随机抽奖码
()
{
public
void
停留时长
3
分钟
实物奖品
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"boxConfType"
,
3
);
updateParam
.
put
(
"openCondition"
,
3
);
updateParam
.
put
(
"openCondition"
,
3
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
...
@@ -116,22 +139,23 @@ public class TreasureTime implements AdminAuthorization {
...
@@ -116,22 +139,23 @@ public class TreasureTime implements AdminAuthorization {
treasureCode
.
setRuleType
(
1
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureRed
treasureRed
=
new
TreasureRed
();
TreasureAward
treasureAward
=
new
TreasureAward
();
treasureRed
.
setRedTotalAmount
(
100
);
treasureAward
.
setAwardName
(
"萌娃锦鲤"
);
treasureRed
.
setRuleType
(
1
);
treasureAward
.
setBizConfId
(
0
);
treasureRed
.
setTotalNum
(
3
);
treasureAward
.
setIsLimit
(
2
);
treasureRed
.
setFixedNum
(
30
);
treasureAward
.
setTotalNum
(
1
);
updateParam
.
put
(
"treasureRed"
,
treasureRed
);
treasureAward
.
setWelfareId
(
this
.
id
.
get
(
5
).
getId
());
updateParam
.
put
(
"treasureAward"
,
treasureAward
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
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
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第
三
轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第
3
轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取第三轮宝箱配置详情"
,
priority
=
7
)
@Test
(
description
=
"获取第三轮宝箱配置详情"
,
priority
=
8
)
public
void
获取第三轮宝箱配置详情
()
{
public
void
获取第三轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
...
@@ -142,39 +166,20 @@ public class TreasureTime implements AdminAuthorization {
...
@@ -142,39 +166,20 @@ public class TreasureTime implements AdminAuthorization {
}
}
@Test
(
description
=
"查询奖品列表"
,
priority
=
8
)
public
void
查询奖品列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
getListParam
.
put
(
"companyId"
,
101
);
getListParam
.
put
(
"pageIndex"
,
1
);
getListParam
.
put
(
"pageSize"
,
20
);
getListParam
.
put
(
"welfareType"
,
6
);
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
,
"查询奖品列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"停留时长4分钟随机抽奖码"
,
priority
=
9
)
@Test
(
description
=
"停留时长4分钟随机抽奖码"
,
priority
=
9
)
public
void
停留时长
4
分钟随机抽奖码
()
{
public
void
停留时长
4
分钟随机抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
3
);
updateParam
.
put
(
"openCondition"
,
4
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
6
);
treasureCode
.
setMaxNum
(
6
);
treasureCode
.
setRuleType
(
1
);
treasureCode
.
setRuleType
(
2
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureAward
treasureAward
=
new
TreasureAward
();
treasureAward
.
setWelfareId
(
this
.
id
.
get
(
5
).
getId
());
treasureAward
.
setTotalNum
(-
1
);
updateParam
.
put
(
"treasureAward"
,
treasureAward
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/cases/live/red/Limited.java
View file @
973f688d
...
@@ -212,9 +212,7 @@ public class Limited implements AdminAuthorization {
...
@@ -212,9 +212,7 @@ public class Limited implements AdminAuthorization {
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
System
.
out
.
println
(
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"
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
"访客A领取答题红包_答题正确 timestamp:"
+
new
Date
().
getTime
());
System
.
out
.
println
(
"访客A领取答题红包_答题正确 timestamp:"
+
new
Date
().
getTime
());
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"答题失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"答题失败"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/live/red/LiveVistorRed.java
View file @
973f688d
...
@@ -318,8 +318,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -318,8 +318,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*访客端-访客A获取直播间参数-getShareSign*/
/*访客端-访客A获取直播间参数-getShareSign*/
@Test
(
description
=
"访客
A
获取直播间参数"
,
priority
=
19
)
@Test
(
description
=
"访客
H
获取直播间参数"
,
priority
=
19
)
public
void
访客
A
获取直播间参数
()
public
void
访客
H
获取直播间参数
()
{
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -334,8 +334,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -334,8 +334,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*访客端-访客B查询被助力者访客A的信息*/
/*访客端-访客B查询被助力者访客A的信息*/
@Test
(
description
=
"访客
B查询被助力者访客A
的信息"
,
priority
=
20
)
@Test
(
description
=
"访客
I查询被助力者访客H
的信息"
,
priority
=
20
)
public
void
访客
B
查询被助力者访客
A
的信息
()
public
void
访客
I
查询被助力者访客
H
的信息
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -348,23 +348,25 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -348,23 +348,25 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*访客端-访客B帮访客A助力*/
/*访客端-访客B帮访客A助力*/
@Test
(
description
=
"访客
B帮访客A
助力"
,
priority
=
21
)
@Test
(
description
=
"访客
I帮访客H
助力"
,
priority
=
21
)
public
void
访客
B
帮访客
A
助力
()
public
void
访客
I
帮访客
H
助力
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
2000
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
params
.
put
(
"shareSign"
,
red_sharesign
);
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confRedPacketId"
,
confId_Red
);
assistParam
.
put
(
"shareSign"
,
red_sharesign
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
);
assistParam
.
put
(
"shareType"
,
5
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"confId"
,
confId_Red
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
}
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客D给访客B助力失败"
,
response
.
body
().
asString
()));
}
/*访客端-访客B获取直播间参数-getShareSign*/
/*访客端-访客B获取直播间参数-getShareSign*/
@Test
(
description
=
"访客
B
获取直播间参数"
,
priority
=
22
)
@Test
(
description
=
"访客
I
获取直播间参数"
,
priority
=
22
)
public
void
访客
B
获取直播间参数
()
public
void
访客
I
获取直播间参数
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -378,9 +380,9 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -378,9 +380,9 @@ public class LiveVistorRed implements AdminAuthorization {
Assert
.
assertNotNull
(
red_sharesign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"获取直播间参数失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
red_sharesign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"获取直播间参数失败"
,
response
.
body
().
asString
()));
}
}
/*访客端-访客A查询被助力者访客B的信息*/
@Test
(
description
=
"访客
A查询被助力者访客B
的信息"
,
priority
=
23
)
@Test
(
description
=
"访客
H查询被助力者访客I
的信息"
,
priority
=
23
)
public
void
访客
A
查询被助力者访客
B
的信息
()
public
void
访客
H
查询被助力者访客
I
的信息
()
{
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -393,21 +395,22 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -393,21 +395,22 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*访客端-访客A帮访客B助力*/
/*访客端-访客A帮访客B助力*/
@Test
(
description
=
"访客
A帮访客B
助力"
,
priority
=
24
)
@Test
(
description
=
"访客
H帮访客I
助力"
,
priority
=
24
)
public
void
访客
A
帮访客
B
助力
()
public
void
访客
H
帮访客
I
助力
()
{
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
2000
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Map
<
String
,
Object
>
assistParam
=
new
HashMap
<>();
params
.
put
(
"shareSign"
,
red_sharesign
);
assistParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confRedPacketId"
,
confId_Red
);
assistParam
.
put
(
"shareSign"
,
red_sharesign
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
);
assistParam
.
put
(
"shareType"
,
5
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
assistParam
.
put
(
"confId"
,
confId_Red
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Response
response
=
network
.
postResponse
(
assistParam
,
BasicConfig
.
MOBILE_assist
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
assistParam
,
BasicConfig
.
MOBILE_assist
,
"访客D给访客B助力失败"
,
response
.
body
().
asString
()));
}
}
/*被助力者A-手气王助力详情信息查询*/
/*被助力者A-手气王助力详情信息查询*/
@Test
(
description
=
"红包详情助力信息"
,
priority
=
25
)
@Test
(
description
=
"红包详情助力信息"
,
priority
=
25
)
public
void
红包详情助力信息
()
public
void
红包详情助力信息
()
...
@@ -423,8 +426,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -423,8 +426,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*被助力者B-手气王助力详情信息查询*/
/*被助力者B-手气王助力详情信息查询*/
@Test
(
description
=
"被助力者
B
-红包详情助力信息"
,
priority
=
26
)
@Test
(
description
=
"被助力者
I
-红包详情助力信息"
,
priority
=
26
)
public
void
被助力者
B
红包详情助力信息
()
public
void
被助力者
I
红包详情助力信息
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -464,8 +467,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -464,8 +467,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*查询访客端访客B红包状态*/
/*查询访客端访客B红包状态*/
@Test
(
description
=
"查询访客端访客
B
红包状态"
,
priority
=
29
)
@Test
(
description
=
"查询访客端访客
I
红包状态"
,
priority
=
29
)
public
void
查询访客端访客
B
红包状态
()
public
void
查询访客端访客
I
红包状态
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -478,8 +481,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -478,8 +481,8 @@ public class LiveVistorRed implements AdminAuthorization {
/*访客A开手气王红包*/
/*访客A开手气王红包*/
@Test
(
description
=
"访客
A
开手气王红包"
,
priority
=
30
)
@Test
(
description
=
"访客
H
开手气王红包"
,
priority
=
30
)
public
void
访客
A
开手气王红包
()
public
void
访客
H
开手气王红包
()
{
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
63000
);
ThreadSleepUtils
.
sleep
(
63000
);
...
@@ -493,8 +496,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -493,8 +496,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
}
/*访客B开手气王红包*/
/*访客B开手气王红包*/
@Test
(
description
=
"访客
B
开手气王红包"
,
priority
=
31
)
@Test
(
description
=
"访客
I
开手气王红包"
,
priority
=
31
)
public
void
访客
B
开手气王红包
()
public
void
访客
I
开手气王红包
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -567,8 +570,8 @@ public class LiveVistorRed implements AdminAuthorization {
...
@@ -567,8 +570,8 @@ public class LiveVistorRed implements AdminAuthorization {
/*访客B领红包轮询结果*/
/*访客B领红包轮询结果*/
@Test
(
description
=
"访客
B
领手气王红包轮询结果"
,
priority
=
36
)
@Test
(
description
=
"访客
I
领手气王红包轮询结果"
,
priority
=
36
)
public
void
访客
B
领手气王红包轮询结果
()
public
void
访客
I
领手气王红包轮询结果
()
{
{
visitorAuth8
();
visitorAuth8
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
src/test/java/com/kjj/cases/live/treasure/Treasure.java
View file @
973f688d
...
@@ -32,7 +32,6 @@ public class Treasure implements AdminAuthorization {
...
@@ -32,7 +32,6 @@ public class Treasure implements AdminAuthorization {
}
}
public
List
<
WelfareList
>
id
;
public
List
<
WelfareList
>
id
;
public
String
ConfId
;
public
String
ConfId
;
public
String
token
;
public
String
shareSign
;
public
String
shareSign
;
public
JSONObject
treasureConf
;
public
JSONObject
treasureConf
;
...
@@ -162,22 +161,35 @@ public class Treasure implements AdminAuthorization {
...
@@ -162,22 +161,35 @@ public class Treasure implements AdminAuthorization {
}
}
//邀请链路
@Test
(
description
=
"访客H
分享直播间
"
,
priority
=
8
)
@Test
(
description
=
"访客H
获取分享加密串
"
,
priority
=
8
)
public
void
访客
H
分享直播间
()
{
public
void
访客
H
获取分享加密串
()
{
visitorAuth9
();
visitorAuth9
();
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
()));
signParam
.
put
(
"shareType"
,
2
);
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
data
;
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H与访客B邀请关系绑定"
,
priority
=
9
)
@Test
(
description
=
"根据分享类型获取分享内容"
,
priority
=
9
)
public
void
根据分享类型获取分享内容
()
{
visitorAuth2
();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareType"
,
7
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_helpInfo
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_helpInfo
,
"根据分享类型获取分享内容"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H与访客B邀请关系绑定"
,
priority
=
10
)
public
void
访客
H
与访客
B
邀请关系绑定
()
{
public
void
访客
H
与访客
B
邀请关系绑定
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -189,46 +201,76 @@ public class Treasure implements AdminAuthorization {
...
@@ -189,46 +201,76 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客B获取绑定结果和绑定凭证"
,
priority
=
1
0
)
@Test
(
description
=
"访客B获取绑定结果和绑定凭证"
,
priority
=
1
1
)
public
void
访客
B
获取绑定结果和绑定凭证
()
{
public
void
访客
B
获取绑定结果和绑定凭证
()
{
visitorAuth2
();
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
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
)
public
void
未登录查询分享人头像昵称
()
{
visitorAuth2
();
Map
<
String
,
Object
>
simpleParam
=
new
HashMap
<>();
simpleParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
simpleParam
.
put
(
"shareSign"
,
shareSign
);
simpleParam
.
put
(
"shareType"
,
7
);
simpleParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
getResponse
(
simpleParam
,
BasicConfig
.
MOBILE_simple
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
simpleParam
,
BasicConfig
.
MOBILE_simple
,
"未登录查询分享人头像昵称失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
访客B根据绑定凭证发放抽奖码"
,
priority
=
11
)
@Test
(
description
=
"
已登录查询分享人头像昵称"
,
priority
=
13
)
public
void
访客
B
根据绑定凭证发放抽奖码
()
{
public
void
已登录查询分享人头像昵称
()
{
visitorAuth2
();
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MOBILE_info
);
System
.
out
.
println
(
success
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_info
,
"已登录查询分享人头像昵称失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"用户B给用户H助力"
,
priority
=
14
)
public
void
用户
B
给用户
H
助力
()
{
visitorAuth2
();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
infoParam
.
put
(
"shareType"
,
7
);
infoParam
.
put
(
"confId"
,
ConfId
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户B给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客B获取直播所有的订阅消息模板"
,
priority
=
1
2
)
@Test
(
description
=
"访客B获取直播所有的订阅消息模板"
,
priority
=
1
5
)
public
void
获取
B
直播所有的订阅消息模板
()
{
public
void
获取
B
直播所有的订阅消息模板
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"app
i
d"
,
"wx4d7276f866bd24c8"
);
sycParam
.
put
(
"app
I
d"
,
"wx4d7276f866bd24c8"
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
);
Object
data
=
sycRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
sycRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
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
=
"访客B预约直播间"
,
priority
=
1
3
)
@Test
(
description
=
"访客B预约直播间"
,
priority
=
1
6
)
public
void
访客
B
预约直播间
()
{
public
void
访客
B
预约直播间
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
...
@@ -245,7 +287,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -245,7 +287,7 @@ public class Treasure implements AdminAuthorization {
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
=
"访客B关注直播间"
,
priority
=
1
4
)
@Test
(
description
=
"访客B关注直播间"
,
priority
=
1
7
)
public
void
访客
B
关注直播间
()
{
public
void
访客
B
关注直播间
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
...
@@ -260,7 +302,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -260,7 +302,7 @@ public class Treasure implements AdminAuthorization {
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
=
"访客B关注状态查询"
,
priority
=
1
5
)
@Test
(
description
=
"访客B关注状态查询"
,
priority
=
1
8
)
public
void
访客
B
关注状态查询
()
{
public
void
访客
B
关注状态查询
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
...
@@ -272,7 +314,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -272,7 +314,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客B保存海报获得抽奖码"
,
priority
=
1
6
)
@Test
(
description
=
"访客B保存海报获得抽奖码"
,
priority
=
1
9
)
public
void
访客
B
保存海报获得抽奖码
()
{
public
void
访客
B
保存海报获得抽奖码
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
...
@@ -284,7 +326,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -284,7 +326,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"查询访客B抽奖码数量"
,
priority
=
17
)
@Test
(
description
=
"查询访客B抽奖码数量"
,
priority
=
20
)
public
void
查询访客
B
抽奖码数量
()
{
public
void
查询访客
B
抽奖码数量
()
{
visitorAuth2
();
visitorAuth2
();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
...
@@ -296,48 +338,47 @@ public class Treasure implements AdminAuthorization {
...
@@ -296,48 +338,47 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客K邀请关系绑定"
,
priority
=
18
)
@Test
(
description
=
"访客K邀请关系绑定"
,
priority
=
21
)
public
void
访客
K
邀请关系绑定
()
{
public
void
访客
K
邀请关系绑定
()
{
visitorAuth11
();
visitorAuth11
();
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
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
Response
response
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客K获取绑定结果和绑定凭证"
,
priority
=
19
)
@Test
(
description
=
"访客K获取绑定结果和绑定凭证"
,
priority
=
22
)
public
void
访客
K
获取绑定结果和绑定凭证
()
{
public
void
访客
K
获取绑定结果和绑定凭证
()
{
visitorAuth11
();
visitorAuth11
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
访客K根据绑定凭证发放抽奖码"
,
priority
=
20
)
@Test
(
description
=
"
用户K给用户H助力"
,
priority
=
23
)
public
void
访客
K
根据绑定凭证发放抽奖码
()
{
public
void
用户
K
给用户
H
助力
()
{
visitorAuth11
();
visitorAuth11
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户K给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客L邀请关系绑定"
,
priority
=
2
1
)
@Test
(
description
=
"访客L邀请关系绑定"
,
priority
=
2
4
)
public
void
访客
L
邀请关系绑定
()
{
public
void
访客
L
邀请关系绑定
()
{
visitorAuth12
();
visitorAuth12
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -349,36 +390,35 @@ public class Treasure implements AdminAuthorization {
...
@@ -349,36 +390,35 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客L获取绑定结果和绑定凭证"
,
priority
=
2
2
)
@Test
(
description
=
"访客L获取绑定结果和绑定凭证"
,
priority
=
2
5
)
public
void
访客
L
获取绑定结果和绑定凭证
()
{
public
void
访客
L
获取绑定结果和绑定凭证
()
{
visitorAuth12
();
visitorAuth12
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
访客L根据绑定凭证发放抽奖码"
,
priority
=
23
)
@Test
(
description
=
"
用户L给用户H助力"
,
priority
=
26
)
public
void
访客
L
根据绑定凭证发放抽奖码
()
{
public
void
用户
L
给用户
H
助力
()
{
visitorAuth12
();
visitorAuth12
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户L给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客M邀请关系绑定"
,
priority
=
2
4
)
@Test
(
description
=
"访客M邀请关系绑定"
,
priority
=
2
7
)
public
void
访客
M
邀请关系绑定
()
{
public
void
访客
M
邀请关系绑定
()
{
visitorAuth13
();
visitorAuth13
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -390,35 +430,34 @@ public class Treasure implements AdminAuthorization {
...
@@ -390,35 +430,34 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客M获取绑定结果和绑定凭证"
,
priority
=
2
5
)
@Test
(
description
=
"访客M获取绑定结果和绑定凭证"
,
priority
=
2
8
)
public
void
访客
M
获取绑定结果和绑定凭证
()
{
public
void
访客
M
获取绑定结果和绑定凭证
()
{
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
访客M根据绑定凭证发放抽奖码"
,
priority
=
26
)
@Test
(
description
=
"
用户M给用户H助力"
,
priority
=
29
)
public
void
访客
M
根据绑定凭证发放抽奖码
()
{
public
void
用户
M
给用户
H
助力
()
{
visitorAuth13
();
visitorAuth13
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户M给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客P邀请关系绑定"
,
priority
=
27
)
@Test
(
description
=
"访客P邀请关系绑定"
,
priority
=
30
)
public
void
访客
P
邀请关系绑定
()
{
public
void
访客
P
邀请关系绑定
()
{
visitorAuth16
();
visitorAuth16
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -430,35 +469,34 @@ public class Treasure implements AdminAuthorization {
...
@@ -430,35 +469,34 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客P获取绑定结果和绑定凭证"
,
priority
=
28
)
@Test
(
description
=
"访客P获取绑定结果和绑定凭证"
,
priority
=
31
)
public
void
访客
P
获取绑定结果和绑定凭证
()
{
public
void
访客
P
获取绑定结果和绑定凭证
()
{
visitorAuth16
();
visitorAuth16
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
访客P根据绑定凭证发放抽奖码"
,
priority
=
29
)
@Test
(
description
=
"
用户P给用户H助力"
,
priority
=
32
)
public
void
访客
P
根据绑定凭证发放抽奖码
()
{
public
void
用户
P
给用户
H
助力
()
{
visitorAuth16
();
visitorAuth16
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户P给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客Q邀请关系绑定"
,
priority
=
3
0
)
@Test
(
description
=
"访客Q邀请关系绑定"
,
priority
=
3
3
)
public
void
访客
Q
邀请关系绑定
()
{
public
void
访客
Q
邀请关系绑定
()
{
visitorAuth17
();
visitorAuth17
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -470,35 +508,34 @@ public class Treasure implements AdminAuthorization {
...
@@ -470,35 +508,34 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客Q获取绑定结果和绑定凭证"
,
priority
=
3
1
)
@Test
(
description
=
"访客Q获取绑定结果和绑定凭证"
,
priority
=
3
4
)
public
void
访客
Q
获取绑定结果和绑定凭证
()
{
public
void
访客
Q
获取绑定结果和绑定凭证
()
{
visitorAuth17
();
visitorAuth17
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"
访客Q根据绑定凭证发放抽奖码"
,
priority
=
32
)
@Test
(
description
=
"
用户Q给用户H助力"
,
priority
=
35
)
public
void
访客
Q
根据绑定凭证发放抽奖码
()
{
public
void
用户
Q
给用户
H
助力
()
{
visitorAuth17
();
visitorAuth17
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"用户Q给用户H助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H查询第1次参与详情的进度显示"
,
priority
=
3
3
)
@Test
(
description
=
"访客H查询第1次参与详情的进度显示"
,
priority
=
3
6
)
public
void
访客
H
查询第
1
次参与详情的进度显示
()
{
public
void
访客
H
查询第
1
次参与详情的进度显示
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -512,13 +549,14 @@ public class Treasure implements AdminAuthorization {
...
@@ -512,13 +549,14 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H开启第1轮宝箱获得实物"
,
priority
=
3
4
)
@Test
(
description
=
"访客H开启第1轮宝箱获得实物"
,
priority
=
3
7
)
public
void
访客
H
开启第
1
轮宝箱获得实物
()
{
public
void
访客
H
开启第
1
轮宝箱获得实物
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"openTimes"
,
1
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
...
@@ -526,12 +564,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -526,12 +564,13 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第1轮开宝箱参与详情"
,
priority
=
3
5
)
@Test
(
description
=
"访客H第1轮开宝箱参与详情"
,
priority
=
3
8
)
public
void
访客
H
第
1
轮开宝箱参与详情
()
{
public
void
访客
H
第
1
轮开宝箱参与详情
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"openTimes"
,
1
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
System
.
out
.
println
(
treasureType
);
...
@@ -545,7 +584,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -545,7 +584,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第2次参与详情的进度显示"
,
priority
=
3
6
)
@Test
(
description
=
"访客H第2次参与详情的进度显示"
,
priority
=
3
9
)
public
void
访客
H
第
2
次参与详情的进度显示
()
{
public
void
访客
H
第
2
次参与详情的进度显示
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -559,13 +598,14 @@ public class Treasure implements AdminAuthorization {
...
@@ -559,13 +598,14 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H开启第2轮宝箱降级抽奖码"
,
priority
=
37
)
@Test
(
description
=
"访客H开启第2轮宝箱降级抽奖码"
,
priority
=
40
)
public
void
访客
H
开启第
2
轮宝箱降级抽奖码
()
{
public
void
访客
H
开启第
2
轮宝箱降级抽奖码
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"openTimes"
,
2
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
...
@@ -574,12 +614,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -574,12 +614,13 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第2轮开宝箱参与详情"
,
priority
=
38
)
@Test
(
description
=
"访客H第2轮开宝箱参与详情"
,
priority
=
41
)
public
void
访客
H
第
2
轮开宝箱参与详情
()
{
public
void
访客
H
第
2
轮开宝箱参与详情
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"openTimes"
,
2
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
System
.
out
.
println
(
treasureType
);
...
@@ -593,7 +634,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -593,7 +634,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"宝箱实物中奖无限制"
,
priority
=
39
)
@Test
(
description
=
"宝箱实物中奖无限制"
,
priority
=
42
)
public
void
宝箱实物中奖无限制
()
{
public
void
宝箱实物中奖无限制
()
{
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
JSONObject
treasureAward
=
treasureConf
.
getJSONObject
(
"treasureAward"
);
treasureAward
.
put
(
"winLimitCount"
,-
1
);
//-1无限制,1限制1次
treasureAward
.
put
(
"winLimitCount"
,-
1
);
//-1无限制,1限制1次
...
@@ -604,7 +645,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -604,7 +645,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第3次参与详情的进度显示"
,
priority
=
4
0
)
@Test
(
description
=
"访客H第3次参与详情的进度显示"
,
priority
=
4
3
)
public
void
访客
H
第
3
次参与详情的进度显示
()
{
public
void
访客
H
第
3
次参与详情的进度显示
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
@@ -617,13 +658,14 @@ public class Treasure implements AdminAuthorization {
...
@@ -617,13 +658,14 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
invitationNum
>
0
,
network
.
message
(
InfoParam
,
BasicConfig
.
MANAGER_treasureUserInfo
,
"查询第3次参与详情进度失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
invitationNum
>
0
,
network
.
message
(
InfoParam
,
BasicConfig
.
MANAGER_treasureUserInfo
,
"查询第3次参与详情进度失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H开启第3轮宝箱获得实物"
,
priority
=
4
1
)
@Test
(
description
=
"访客H开启第3轮宝箱获得实物"
,
priority
=
4
4
)
public
void
访客
H
开启第
3
轮宝箱获得实物
()
{
public
void
访客
H
开启第
3
轮宝箱获得实物
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"openTimes"
,
3
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
...
@@ -631,12 +673,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -631,12 +673,13 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第3轮开宝箱参与详情"
,
priority
=
4
2
)
@Test
(
description
=
"访客H第3轮开宝箱参与详情"
,
priority
=
4
5
)
public
void
访客
H
第
3
轮开宝箱参与详情
()
{
public
void
访客
H
第
3
轮开宝箱参与详情
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"openTimes"
,
3
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
System
.
out
.
println
(
treasureType
);
...
@@ -650,21 +693,20 @@ public class Treasure implements AdminAuthorization {
...
@@ -650,21 +693,20 @@ public class Treasure implements AdminAuthorization {
//B 用户邀请
//B 用户邀请
@Test
(
description
=
"访客M
分享直播间"
,
priority
=
43
)
@Test
(
description
=
"访客M
获取分享加密串"
,
priority
=
46
)
public
void
访客
M
分享直播间
()
{
public
void
访客
M
获取分享加密串
()
{
visitorAuth13
();
visitorAuth13
();
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
()));
signParam
.
put
(
"shareType"
,
2
);
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
data
;
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客M与访客N邀请关系绑定"
,
priority
=
4
4
)
@Test
(
description
=
"访客M与访客N邀请关系绑定"
,
priority
=
4
7
)
public
void
访客
M
与访客
N
邀请关系绑定
()
{
public
void
访客
M
与访客
N
邀请关系绑定
()
{
visitorAuth14
();
visitorAuth14
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -676,34 +718,34 @@ public class Treasure implements AdminAuthorization {
...
@@ -676,34 +718,34 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客N获取绑定结果和绑定凭证"
,
priority
=
4
5
)
@Test
(
description
=
"访客N获取绑定结果和绑定凭证"
,
priority
=
4
8
)
public
void
访客
N
获取绑定结果和绑定凭证
()
{
public
void
访客
N
获取绑定结果和绑定凭证
()
{
visitorAuth14
();
visitorAuth14
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客N根据绑定凭证发放抽奖码"
,
priority
=
46
)
public
void
访客
N
根据绑定凭证发放抽奖码
()
{
@Test
(
description
=
"访客N给访客M助力"
,
priority
=
49
)
public
void
访客
N
给访客
M
助力
()
{
visitorAuth14
();
visitorAuth14
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"访客N给访客M助力失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客M与访客R邀请关系绑定"
,
priority
=
47
)
@Test
(
description
=
"访客M与访客R邀请关系绑定"
,
priority
=
50
)
public
void
访客
M
与访客
R
邀请关系绑定
()
{
public
void
访客
M
与访客
R
邀请关系绑定
()
{
visitorAuth18
();
visitorAuth18
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -715,35 +757,35 @@ public class Treasure implements AdminAuthorization {
...
@@ -715,35 +757,35 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客R获取绑定结果和绑定凭证"
,
priority
=
48
)
@Test
(
description
=
"访客R获取绑定结果和绑定凭证"
,
priority
=
51
)
public
void
访客
R
获取绑定结果和绑定凭证
()
{
public
void
访客
R
获取绑定结果和绑定凭证
()
{
visitorAuth18
();
visitorAuth18
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客R根据绑定凭证发放抽奖码"
,
priority
=
49
)
@Test
(
description
=
"访客R给访客M助力"
,
priority
=
52
)
public
void
访客
R
根据绑定凭证发放抽奖码
()
{
public
void
访客
R
给访客
M
助力
()
{
visitorAuth14
();
visitorAuth18
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"访客R给访客M助力失败"
,
response
.
body
().
asString
()));
}
}
//验证实物奖品数量是否会超发
//验证实物奖品数量是否会超发
@Test
(
description
=
"访客H第4次参与详情的进度显示"
,
priority
=
5
0
)
@Test
(
description
=
"访客H第4次参与详情的进度显示"
,
priority
=
5
3
)
public
void
访客
H
第
4
次参与详情的进度显示
()
{
public
void
访客
H
第
4
次参与详情的进度显示
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -756,7 +798,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -756,7 +798,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客M第1次参与详情的进度显示"
,
priority
=
5
1
)
@Test
(
description
=
"访客M第1次参与详情的进度显示"
,
priority
=
5
4
)
public
void
访客
M
第
1
次参与详情的进度显示
()
{
public
void
访客
M
第
1
次参与详情的进度显示
()
{
visitorAuth13
();
visitorAuth13
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -770,20 +812,22 @@ public class Treasure implements AdminAuthorization {
...
@@ -770,20 +812,22 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"
开启第4轮宝箱实物是否超发"
,
priority
=
52
)
@Test
(
description
=
"
访客H和访客M开启第4轮宝箱实物是否超发"
,
priority
=
55
)
public
void
开启第
4
轮宝箱实物是否超发
()
{
public
void
访客
H
和访客
M
开启第
4
轮宝箱实物是否超发
()
{
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
visitorAuth9
();
visitorAuth9
();
openParam
.
put
(
"openTimes"
,
4
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
Assert
.
assertTrue
(
receiveStatus
==
0
,
network
.
message
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
,
"开启第4轮宝箱失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
receiveStatus
==
0
,
network
.
message
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
,
"开启第4轮宝箱失败"
,
response
.
body
().
asString
()));
visitorAuth13
();
visitorAuth13
();
openParam
.
put
(
"openTimes"
,
1
);
Response
response1
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response1
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus1
=
response1
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus1
=
response1
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus1
);
System
.
out
.
println
(
receiveStatus1
);
...
@@ -792,12 +836,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -792,12 +836,13 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"
查询访客H第4轮开宝箱参与详情"
,
priority
=
53
)
@Test
(
description
=
"
访客H和访客M第4轮开宝箱参与详情"
,
priority
=
56
)
public
void
查询访客
H
第
4
轮开宝箱参与详情
()
{
public
void
访客
H
和访客
M
第
4
轮开宝箱参与详情
()
{
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
visitorAuth9
();
visitorAuth9
();
infoParam
.
put
(
"openTimes"
,
4
);
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
...
@@ -810,6 +855,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -810,6 +855,7 @@ public class Treasure implements AdminAuthorization {
visitorAuth13
();
visitorAuth13
();
infoParam
.
put
(
"openTimes"
,
1
);
Response
responseB
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
responseB
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType1
=
responseB
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType1
=
responseB
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType1
);
System
.
out
.
println
(
treasureType1
);
...
@@ -823,7 +869,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -823,7 +869,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"宝箱红包限制1次"
,
priority
=
5
4
)
@Test
(
description
=
"宝箱红包限制1次"
,
priority
=
5
7
)
public
void
宝箱红包限制
1
次
()
{
public
void
宝箱红包限制
1
次
()
{
JSONObject
treasureRed
=
treasureConf
.
getJSONObject
(
"treasureRed"
);
JSONObject
treasureRed
=
treasureConf
.
getJSONObject
(
"treasureRed"
);
...
@@ -838,7 +884,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -838,7 +884,7 @@ public class Treasure implements AdminAuthorization {
}
}
//访客A领取红包
//访客A领取红包
@Test
(
description
=
"访客H第5次参与详情的进度显示"
,
priority
=
5
5
)
@Test
(
description
=
"访客H第5次参与详情的进度显示"
,
priority
=
5
8
)
public
void
访客
H
第
5
次参与详情的进度显示
()
{
public
void
访客
H
第
5
次参与详情的进度显示
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -850,13 +896,14 @@ public class Treasure implements AdminAuthorization {
...
@@ -850,13 +896,14 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
invitationNum
>
0
,
network
.
message
(
InfoParam
,
BasicConfig
.
MANAGER_treasureUserInfo
,
"查询第5次参与详情进度失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
invitationNum
>
0
,
network
.
message
(
InfoParam
,
BasicConfig
.
MANAGER_treasureUserInfo
,
"查询第5次参与详情进度失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H开启第5次宝箱获得红包"
,
priority
=
5
6
)
@Test
(
description
=
"访客H开启第5次宝箱获得红包"
,
priority
=
5
9
)
public
void
访客
H
开启第
5
次宝箱获得红包
()
{
public
void
访客
H
开启第
5
次宝箱获得红包
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
15000
);
ThreadSleepUtils
.
sleep
(
15000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"openTimes"
,
5
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
...
@@ -865,12 +912,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -865,12 +912,13 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第5轮开宝箱参与详情"
,
priority
=
57
)
@Test
(
description
=
"访客H第5轮开宝箱参与详情"
,
priority
=
60
)
public
void
访客
H
第
5
轮开宝箱参与详情
()
{
public
void
访客
H
第
5
轮开宝箱参与详情
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"openTimes"
,
5
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
System
.
out
.
println
(
treasureType
);
...
@@ -884,7 +932,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -884,7 +932,7 @@ public class Treasure implements AdminAuthorization {
//访客A降级抽奖码
//访客A降级抽奖码
@Test
(
description
=
"访客H第6次参与详情的进度显示"
,
priority
=
58
)
@Test
(
description
=
"访客H第6次参与详情的进度显示"
,
priority
=
61
)
public
void
访客
H
第
6
次参与详情的进度显示
()
{
public
void
访客
H
第
6
次参与详情的进度显示
()
{
visitorAuth9
();
visitorAuth9
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -896,13 +944,14 @@ public class Treasure implements AdminAuthorization {
...
@@ -896,13 +944,14 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
invitationNum
>
0
,
network
.
message
(
InfoParam
,
BasicConfig
.
MANAGER_treasureUserInfo
,
"查询第6次参与详情进度失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
invitationNum
>
0
,
network
.
message
(
InfoParam
,
BasicConfig
.
MANAGER_treasureUserInfo
,
"查询第6次参与详情进度失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客H开启第6次宝箱降级抽奖码"
,
priority
=
59
)
@Test
(
description
=
"访客H开启第6次宝箱降级抽奖码"
,
priority
=
62
)
public
void
访客
H
开启第
6
次宝箱降级抽奖码
()
{
public
void
访客
H
开启第
6
次宝箱降级抽奖码
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"openTimes"
,
6
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
...
@@ -910,12 +959,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -910,12 +959,13 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H第6轮开宝箱参与详情"
,
priority
=
6
0
)
@Test
(
description
=
"访客H第6轮开宝箱参与详情"
,
priority
=
6
3
)
public
void
访客
H
第
6
轮开宝箱参与详情
()
{
public
void
访客
H
第
6
轮开宝箱参与详情
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"openTimes"
,
6
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
System
.
out
.
println
(
treasureType
);
...
@@ -928,21 +978,21 @@ public class Treasure implements AdminAuthorization {
...
@@ -928,21 +978,21 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客N
分享直播间"
,
priority
=
61
)
@Test
(
description
=
"访客N
获取分享加密串"
,
priority
=
64
)
public
void
访客
N
分享直播间
()
{
public
void
访客
N
获取分享加密串
()
{
visitorAuth14
();
visitorAuth14
();
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
()));
signParam
.
put
(
"shareType"
,
2
);
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_sign
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
String
data
=
signRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
data
;
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_
sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客N与访客O邀请关系绑定"
,
priority
=
62
)
@Test
(
description
=
"访客N与访客O邀请关系绑定"
,
priority
=
65
)
public
void
访客
N
与访客
O
邀请关系绑定
()
{
public
void
访客
N
与访客
O
邀请关系绑定
()
{
visitorAuth15
();
visitorAuth15
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
...
@@ -954,36 +1004,36 @@ public class Treasure implements AdminAuthorization {
...
@@ -954,36 +1004,36 @@ public class Treasure implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客O获取绑定结果和绑定凭证"
,
priority
=
6
3
)
@Test
(
description
=
"访客O获取绑定结果和绑定凭证"
,
priority
=
6
6
)
public
void
访客
O
获取绑定结果和绑定凭证
()
{
public
void
访客
O
获取绑定结果和绑定凭证
()
{
visitorAuth15
();
visitorAuth15
();
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Integer
type
=
tokenRes
.
jsonPath
().
getInt
(
"data.type"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
type
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
System
.
out
.
println
(
token
);
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客O
根据绑定凭证发放抽奖码"
,
priority
=
64
)
@Test
(
description
=
"访客O
给访客N助力"
,
priority
=
67
)
public
void
访客
O
根据绑定凭证发放抽奖码
()
{
public
void
访客
O
给访客
N
助力
()
{
visitorAuth15
();
visitorAuth15
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
infoParam
.
put
(
"shareSign"
,
shareSign
);
codeParam
.
put
(
"token"
,
token
);
infoParam
.
put
(
"shareType"
,
7
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
infoParam
.
put
(
"confId"
,
ConfId
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
postResponse
(
infoParam
,
BasicConfig
.
MOBILE_assist
);
System
.
out
.
println
(
success
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
MOBILE_assist
,
"访客O给访客N助力失败"
,
response
.
body
().
asString
()));
}
}
//访客M和N同时抢红包
//访客M和N同时抢红包
@Test
(
description
=
"访客M参与详情的进度显示"
,
priority
=
6
5
)
@Test
(
description
=
"访客M参与详情的进度显示"
,
priority
=
6
8
)
public
void
访客
M
参与详情的进度显示
()
{
public
void
访客
M
参与详情的进度显示
()
{
visitorAuth13
();
visitorAuth13
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -996,7 +1046,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -996,7 +1046,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客N参与详情的进度显示"
,
priority
=
6
6
)
@Test
(
description
=
"访客N参与详情的进度显示"
,
priority
=
6
9
)
public
void
访客
N
参与详情的进度显示
()
{
public
void
访客
N
参与详情的进度显示
()
{
visitorAuth14
();
visitorAuth14
();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
InfoParam
=
new
HashMap
<>();
...
@@ -1010,19 +1060,21 @@ public class Treasure implements AdminAuthorization {
...
@@ -1010,19 +1060,21 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客M和访客N同时开启宝箱验证红包是否超发"
,
priority
=
67
)
@Test
(
description
=
"访客M和访客N同时开启宝箱验证红包是否超发"
,
priority
=
70
)
public
void
访客
M
和访客
N
同时开启宝箱验证红包是否超发
()
{
public
void
访客
M
和访客
N
同时开启宝箱验证红包是否超发
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
openParam
.
put
(
"treasureConfId"
,
ConfId
);
openParam
.
put
(
"treasureConfId"
,
ConfId
);
visitorAuth13
();
visitorAuth13
();
openParam
.
put
(
"openTimes"
,
2
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus
=
response
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus
);
System
.
out
.
println
(
receiveStatus
);
Assert
.
assertTrue
(
receiveStatus
==
0
,
network
.
message
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
,
"开启第4轮宝箱失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
receiveStatus
==
0
,
network
.
message
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
,
"开启第4轮宝箱失败"
,
response
.
body
().
asString
()));
visitorAuth14
();
visitorAuth14
();
openParam
.
put
(
"openTimes"
,
1
);
Response
response1
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
Response
response1
=
network
.
postResponse
(
openParam
,
BasicConfig
.
MANAGER_openTreasure
);
int
receiveStatus1
=
response1
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
int
receiveStatus1
=
response1
.
jsonPath
().
getInt
(
"data.receiveStatus"
);
System
.
out
.
println
(
receiveStatus1
);
System
.
out
.
println
(
receiveStatus1
);
...
@@ -1032,12 +1084,13 @@ public class Treasure implements AdminAuthorization {
...
@@ -1032,12 +1084,13 @@ public class Treasure implements AdminAuthorization {
@Test
(
description
=
"访客M和访客N第7轮开宝箱参与详情"
,
priority
=
68
)
@Test
(
description
=
"访客M和访客N第7轮开宝箱参与详情"
,
priority
=
71
)
public
void
访客
M
和访客
N
第
7
轮开宝箱参与详情
()
{
public
void
访客
M
和访客
N
第
7
轮开宝箱参与详情
()
{
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
visitorAuth13
();
visitorAuth13
();
infoParam
.
put
(
"openTimes"
,
2
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType
=
response
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType
);
System
.
out
.
println
(
treasureType
);
...
@@ -1049,6 +1102,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -1049,6 +1102,7 @@ public class Treasure implements AdminAuthorization {
visitorAuth14
();
visitorAuth14
();
infoParam
.
put
(
"openTimes"
,
1
);
Response
response1
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
Response
response1
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
int
treasureType1
=
response1
.
jsonPath
().
getInt
(
"data.treasureType"
);
int
treasureType1
=
response1
.
jsonPath
().
getInt
(
"data.treasureType"
);
System
.
out
.
println
(
treasureType1
);
System
.
out
.
println
(
treasureType1
);
...
@@ -1060,7 +1114,7 @@ public class Treasure implements AdminAuthorization {
...
@@ -1060,7 +1114,7 @@ public class Treasure implements AdminAuthorization {
}
}
@Test
(
description
=
"访客H宝箱领取记录"
,
priority
=
69
)
@Test
(
description
=
"访客H宝箱领取记录"
,
priority
=
72
)
public
void
访客
H
宝箱领取记录
()
{
public
void
访客
H
宝箱领取记录
()
{
visitorAuth9
();
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
1000
);
ThreadSleepUtils
.
sleep
(
1000
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
973f688d
...
@@ -38,18 +38,25 @@ public class BasicConfig {
...
@@ -38,18 +38,25 @@ public class BasicConfig {
public
static
String
VISITORKEY11
=
"LEH7epeHVDJWzhZ6DiexTHnsaP1qQtqg4bchCs73vvVo9tdZjkmmjNMWkCsgrygU4cJaXfwzr7j51EK9Xcxdt2YdXnQjU"
;
public
static
String
VISITORKEY11
=
"LEH7epeHVDJWzhZ6DiexTHnsaP1qQtqg4bchCs73vvVo9tdZjkmmjNMWkCsgrygU4cJaXfwzr7j51EK9Xcxdt2YdXnQjU"
;
//直播访客 (饺子)ID:97
//直播访客 (饺子)ID:97
public
static
String
VISITORKEY12
=
"5MgSyboxqzAQZZJEsTf43nVX38FgyAUo2fAxaP2wGJUTHcnhCNQ6xm4rZ8nMSjRk2BTsYwRhe1kABXuFmTA7JsepCEpa"
;
public
static
String
VISITORKEY12
=
"5MgSyboxqzAQZZJEsTf43nVX38FgyAUo2fAxaP2wGJUTHcnhCNQ6xm4rZ8nMSjRk2BTsYwRhe1kABXuFmTA7JsepCEpa"
;
//直播访客 (大妹子
保险)ID:102
//直播访客 (大妹子
)ID:299
public
static
String
VISITORKEY13
=
"LEH7epeHVDJWzhZ6DiexTHnsa
P1qN9UZzYqpqzJA2Rdew611Z1Jx5JYQdByks4WNm9sPEYEcPjPWGB332v28BWjXfbFH
f"
;
public
static
String
VISITORKEY13
=
"LEH7epeHVDJWzhZ6DiexTHnsa
N9w9oWNN5DjmEBUV6rxQBX1gPqEDy6fBAMhJF4ZNUHR681CqgJaAwkQttsd8aB5WdCD
f"
;
//直播访客 (光头强)ID:
173
//直播访客 (光头强)ID:
540
public
static
String
VISITORKEY14
=
"LEH7epeHVDJWzhZ6DiexTHnsa
P1qN9UaB5Y7kQYL8TWRUMmAdzUP34yhV8w3PVg4uV5rxYeuetNdSU1HkUJ84QzXYYSF1
"
;
public
static
String
VISITORKEY14
=
"LEH7epeHVDJWzhZ6DiexTHnsa
N9w9oWNUSEzLEnhXW7GvsDSbF1XDBJeeBRLp1u37nEXDs6aRhV7i8uxwJSKdaMFDutDp
"
;
//直播访客 (少侠)ID:7
9
//直播访客 (少侠)ID:7
88
public
static
String
VISITORKEY15
=
"
5MgSyboxqzAQZZJEsTf43nVX38FgxYNfSo46ZMTRoniw9Rwh4vcC4373uQZR8B4f7re8nYAH3ePzUamTSWp57TLkhYGM
"
;
public
static
String
VISITORKEY15
=
"
LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNQGsjS7kCzWj4MRh8UEgj65qMf774qQKtXQCskA56o29SkFTd6Zvc82mKjQ2P1
"
;
//直播访客 (抬头有飞碟)ID:99
//直播访客 (抬头有飞碟)ID:99
public
static
String
VISITORKEY16
=
"5MgSyboxqzAQZZJEsTf43nVX38FgxYNfT62QtXBfd44D2QpfhS1MHjzggYiRmLtzAqHLps4SB7m5PsqQQYkjS7hcPHSu"
;
public
static
String
VISITORKEY16
=
"5MgSyboxqzAQZZJEsTf43nVX38FgxYNfT62QtXBfd44D2QpfhS1MHjzggYiRmLtzAqHLps4SB7m5PsqQQYkjS7hcPHSu"
;
//直播访客 (枫城)ID:77
//直播访客 (枫城)ID:77
public
static
String
VISITORKEY17
=
"5MgSyboxqzAQZZJEsTf43nVX38FgxYNfR7C5mkWn1EaJAymDPCSQyz3eaqsq7Wn47NU1cUqKXMHSEEbHfhXiv9Bq6XCc"
;
public
static
String
VISITORKEY17
=
"5MgSyboxqzAQZZJEsTf43nVX38FgxYNfR7C5mkWn1EaJAymDPCSQyz3eaqsq7Wn47NU1cUqKXMHSEEbHfhXiv9Bq6XCc"
;
//直播访客 (小老弟来了)ID:94
//直播访客 (小老弟来了)ID:726
public
static
String
VISITORKEY18
=
"5MgSyboxqzAQZZJEsTf43nVX38FgxYNfQ9pD69dnWxFV6NvpU2hiZ9J5kVEeFYdcviUxqNs5i37hvQEzCtzqhr7ywbwq"
;
public
static
String
VISITORKEY18
=
"LEH7epeHVDJWzhZ6DiexTHnsaN9w9oXAbLLH4y37kY1Bh1zjcGqq8H65TzBAApa8c4h8PYXwogLPa8swFPNEpBqgqBRPH"
;
//直播访客 (林国芸)ID:786
public
static
String
visitorAuth19
=
"LEH7epeHVDJWzhZ6DiexTHnsaN9w9oXAUTTB6fYfPQ57LstgL84LnTWTZRadaM23vPXd7x2Q8Dos7RdCpWYg9AcJeUDz5"
;
//直播访客 (孙心桂)ID:785
public
static
String
visitorAuth20
=
"LEH7epeHVDJWzhZ6DiexTHnsaN9w9oXATWauEgZhrnVmFDGYrbyvfbCiHrAsmpMp7LRpUYvHTCCVYrfQJZZZeAGXs5q9B"
;
//直播访客 (谢翊美)ID:791
public
static
String
visitorAuth21
=
"LEH7epeHVDJWzhZ6DiexTHnsaN9w9oX4LYmRiH4EYLayw7oTtnaZ4YpLUcVaMTnAUuz5jSPcnRQgDm7R2XRS6AQgJqtta"
;
//***********************************************************************
//***********************************************************************
// 基础线代理人 TKU
// 基础线代理人 TKU
...
@@ -91,13 +98,26 @@ public class BasicConfig {
...
@@ -91,13 +98,26 @@ public class BasicConfig {
public
static
final
String
MANAGER_detail_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/detail"
;
public
static
final
String
MANAGER_detail_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/detail"
;
public
static
final
String
MANAGER_del_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/delete"
;
public
static
final
String
MANAGER_del_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/delete"
;
//助播端
public
static
final
String
MOBILE_guessList
=
MOBILE_HOST
+
"/conf/live/red/guess/list"
;
public
static
final
String
MOBILE_saveOrUpdate2
=
MOBILE_HOST
+
"/conf/live/red/guess/saveOrUpdate"
;
public
static
final
String
MOBILE_detail1
=
MOBILE_HOST
+
"/conf/live/red/guess/detail"
;
public
static
final
String
MOBILE_startOrEnd
=
MOBILE_HOST
+
"/conf/live/red/guess/startOrEnd"
;
public
static
final
String
MOBILE_saveOrUpdate
=
MOBILE_HOST
+
"/conf/pre/red/guess/saveOrUpdate"
;
public
static
final
String
MOBILE_saveOrUpdate
=
MOBILE_HOST
+
"/conf/pre/red/guess/saveOrUpdate"
;
public
static
final
String
MOBILE_findDetail
=
MOBILE_HOST
+
"/conf/pre/red/findDetail"
;
public
static
final
String
MOBILE_findDetail
=
MOBILE_HOST
+
"/conf/pre/red/findDetail"
;
public
static
final
String
MOBILE_list
=
MOBILE_HOST
+
"/conf/pre/red/guess/list"
;
public
static
final
String
MOBILE_list
=
MOBILE_HOST
+
"/conf/pre/red/guess/list"
;
public
static
final
String
MOBILE_detail
=
MOBILE_HOST
+
"/conf/pre/red/guess/detail"
;
public
static
final
String
MOBILE_detail
=
MOBILE_HOST
+
"/conf/pre/red/guess/detail"
;
public
static
final
String
MOBILE_delete
=
MOBILE_HOST
+
"/conf/pre/red/guess/delete"
;
public
static
final
String
MOBILE_delete
=
MOBILE_HOST
+
"/conf/pre/red/guess/delete"
;
public
static
final
String
MOBILE_confDetail
=
MOBILE_HOST
+
"/clue/guess/number/red/confDetail"
;
public
static
final
String
MOBILE_userDetail
=
MOBILE_HOST
+
"/clue/guess/number/red/userDetail"
;
public
static
final
String
MOBILE_guess
=
MOBILE_HOST
+
"/clue/guess/number/red/guess"
;
public
static
final
String
MOBILE_open
=
MOBILE_HOST
+
"/clue/guess/number/red/open"
;
public
static
final
String
MOBILE_result
=
MOBILE_HOST
+
"/clue/guess/number/red/result"
;
// public static final String MOBILE_ = MOBILE_HOST + "";
// public static final String MOBILE_ = MOBILE_HOST + "";
// public static final String MOBILE_ = MOBILE_HOST + "";
// *************** 宝箱裂变 ***************
// *************** 宝箱裂变 ***************
public
static
final
String
MANAGER_getList4Admin
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/getList4Admin"
;
public
static
final
String
MANAGER_getList4Admin
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/getList4Admin"
;
...
@@ -114,10 +134,25 @@ public class BasicConfig {
...
@@ -114,10 +134,25 @@ public class BasicConfig {
public
static
final
String
MANAGER_participateList
=
MOBILE_HOST
+
"/kjy/live/treasure/participateList"
;
public
static
final
String
MANAGER_participateList
=
MOBILE_HOST
+
"/kjy/live/treasure/participateList"
;
// *************** 宝箱停留时长 ***************
// *************** 助力分享 ***************
public
static
final
String
MOBILE_sign
=
MOBILE_HOST
+
"/kjy/live/share/help/sign"
;
public
static
final
String
MOBILE_simple
=
MOBILE_HOST
+
"/kjy/live/help/simple"
;
public
static
final
String
MOBILE_info
=
MOBILE_HOST
+
"/kjy/live/help/info"
;
public
static
final
String
MOBILE_helpInfo
=
MOBILE_HOST
+
"/kjy/live/share/help/info"
;
public
static
final
String
MOBILE_assist
=
MOBILE_HOST
+
"/kjy/live/help/assist"
;
// *************** 时长宝箱 ***************
public
static
final
String
MANAGER_list1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/list"
;
public
static
final
String
MANAGER_list1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/list"
;
public
static
final
String
MANAGER_detail1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/detail"
;
public
static
final
String
MANAGER_detail1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/detail"
;
public
static
final
String
MANAGER_update1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/update"
;
public
static
final
String
MANAGER_update1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/update"
;
public
static
final
String
MOBILE_timeDetail
=
MOBILE_HOST
+
"/kjy/live/treasure/time/detail"
;
public
static
final
String
MOBILE_joinDetail
=
MOBILE_HOST
+
"/kjy/live/treasure/time/joinDetail/simple"
;
public
static
final
String
MOBILE_finish
=
MOBILE_HOST
+
"/kjy/live/treasure/time/finish"
;
public
static
final
String
MOBILE_joinDetail1
=
MOBILE_HOST
+
"/kjy/live/treasure/time/joinDetail"
;
public
static
final
String
MOBILE_treasureOpen
=
MOBILE_HOST
+
"/kjy/live/treasure/time/open"
;
public
static
final
String
MOBILE_joinResult
=
MOBILE_HOST
+
"/kjy/live/treasure/time/joinResult"
;
// *************** 代理人指定中奖 ***************
// *************** 代理人指定中奖 ***************
...
@@ -190,9 +225,11 @@ public class BasicConfig {
...
@@ -190,9 +225,11 @@ public class BasicConfig {
public
static
final
String
MANAGER_rewardList
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/list"
;
public
static
final
String
MANAGER_rewardList
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/list"
;
public
static
final
String
MANAGER_delete
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/delete"
;
public
static
final
String
MANAGER_delete
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/delete"
;
public
static
final
String
MANAGER_update
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/update"
;
public
static
final
String
MANAGER_update
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/update"
;
public
static
final
String
MANAGER_TreasureBenefits
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/list"
;
public
static
final
String
MANAGER_TreasureDetail
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/detail"
;
//小程序分享
public
static
final
String
MANAGER_TreasureConUpdate
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/update"
;
public
static
final
String
MANAGER_saveOrUpdateMpShare
=
MANAGER_HOST
+
"/kjy/manager/live/share/saveOrUpdateMpShare"
;
public
static
final
String
MANAGER_
=
MANAGER_HOST
+
""
;
// public static final String MANAGER_ = MANAGER_HOST + "";
// *************** 代理人 ***************
// *************** 代理人 ***************
//代理人列表//
//代理人列表//
...
@@ -238,6 +275,8 @@ public class BasicConfig {
...
@@ -238,6 +275,8 @@ public class BasicConfig {
public
static
final
String
MOBILE_Code
=
MOBILE_HOST
+
"/clue/invitation/code"
;
public
static
final
String
MOBILE_Code
=
MOBILE_HOST
+
"/clue/invitation/code"
;
public
static
final
String
MOBILE_MyLotteryCode
=
MOBILE_HOST
+
"/kjy/live/lottery/myLotteryCode"
;
public
static
final
String
MOBILE_MyLotteryCode
=
MOBILE_HOST
+
"/kjy/live/lottery/myLotteryCode"
;
//投票
//投票
public
static
final
String
MOBILE_ChoiceCurrentDetail
=
MOBILE_HOST
+
"/conf/live/choice/currentDetail"
;
public
static
final
String
MOBILE_ChoiceCurrentDetail
=
MOBILE_HOST
+
"/conf/live/choice/currentDetail"
;
public
static
final
String
MOBILE_AddChoice
=
MOBILE_HOST
+
"/conf/live/choice/addChoice"
;
public
static
final
String
MOBILE_AddChoice
=
MOBILE_HOST
+
"/conf/live/choice/addChoice"
;
...
...
src/test/java/com/kjj/utils/JsonUtil.java
View file @
973f688d
...
@@ -3,6 +3,7 @@ package com.kjj.utils;
...
@@ -3,6 +3,7 @@ package com.kjj.utils;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.kjj.bean.manager.GuessList
;
import
groovy.json.JsonBuilder
;
import
groovy.json.JsonBuilder
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
...
...
src/test/liveTestNG.xml
View file @
973f688d
...
@@ -19,6 +19,12 @@
...
@@ -19,6 +19,12 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"小程序分享"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.Share"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"获取抽奖码校验"
>
<test
preserve-order=
"true"
name=
"获取抽奖码校验"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.LotteryCode.LotteryCode"
/>
<class
name=
"com.kjj.cases.live.LotteryCode.LotteryCode"
/>
...
@@ -37,7 +43,6 @@
...
@@ -37,7 +43,6 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"宝箱时长"
>
<test
preserve-order=
"true"
name=
"宝箱时长"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.manager.TreasureTime"
/>
<class
name=
"com.kjj.cases.live.manager.TreasureTime"
/>
...
@@ -102,6 +107,7 @@
...
@@ -102,6 +107,7 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.anchor.OpenLive"
/>
<class
name=
"com.kjj.cases.live.anchor.OpenLive"
/>
...
@@ -119,6 +125,13 @@
...
@@ -119,6 +125,13 @@
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"猜数字红包"
>
<classes>
<class
name=
"com.kjj.cases.live.guess.LiveGuess"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"免费领福利"
>
<test
preserve-order=
"true"
name=
"免费领福利"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.FreeReward.FreeReward"
/>
<class
name=
"com.kjj.cases.live.FreeReward.FreeReward"
/>
...
@@ -171,6 +184,12 @@
...
@@ -171,6 +184,12 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"直播中时长宝箱"
>
<classes>
<class
name=
"com.kjj.cases.live.lottery.TreasureTime"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.anchor.CloseLive"
/>
<class
name=
"com.kjj.cases.live.anchor.CloseLive"
/>
...
...
test-output/report.html
View file @
973f688d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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