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
7b95cd47
Commit
7b95cd47
authored
Apr 27, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
奖品签收
parent
13fe04ee
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1195 additions
and
233 deletions
+1195
-233
QuseRewardList.java
src/test/java/com/kjj/bean/answer/QuseRewardList.java
+1
-1
AdminAuthorization.java
...est/java/com/kjj/cases/live/admin/AdminAuthorization.java
+2
-2
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+73
-0
Add.java
src/test/java/com/kjj/cases/live/manager/QuesReward/Add.java
+268
-0
TeamAssignment.java
...com/kjj/cases/live/manager/QuesReward/TeamAssignment.java
+7
-7
Unlimited.java
...java/com/kjj/cases/live/manager/QuesReward/Unlimited.java
+32
-2
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/manager/SaveAndUpdate.java
+1
-212
Limited.java
src/test/java/com/kjj/cases/live/red/Limited.java
+527
-0
Unlimited.java
src/test/java/com/kjj/cases/live/red/Unlimited.java
+251
-0
User.java
src/test/java/com/kjj/cases/live/user/User.java
+4
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-2
liveTestNG.xml
src/test/liveTestNG.xml
+27
-7
No files found.
src/test/java/com/kjj/bean/answer/QuseRewardList.java
View file @
7b95cd47
...
...
@@ -7,7 +7,7 @@ import java.util.List;
@Data
public
class
QuseRewardList
{
private
List
<
QuesList
>
list
;
private
List
<
Qu
seRewardList
.
Qu
esList
>
list
;
@Data
public
static
class
QuesList
{
private
String
quesConfId
;
...
...
src/test/java/com/kjj/cases/live/admin/AdminAuthorization.java
View file @
7b95cd47
...
...
@@ -27,7 +27,7 @@ public interface AdminAuthorization {
}
/**
* 访客A(
嘿保险)授权,代理人指定中奖用户 ,ID:907
* 访客A(
志勇)授权,代理人指定中奖用户
*/
default
void
visitorAuth
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY
);
...
...
@@ -89,7 +89,7 @@ public interface AdminAuthorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY8
);
}
/**
* 访客
H(喜洋洋)授权
* 访客
I(嘿保险)授权,ID:907
*/
default
void
visitorAuth9
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY9
);
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
7b95cd47
...
...
@@ -1042,5 +1042,78 @@ public class Lottery implements AdminAuthorization {
}
@Test
(
description
=
"代理人分享直播间"
,
priority
=
74
)
public
void
代理人分享直播间
()
{
agentAuth
();
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_GETSHARESIGN
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客H关系绑定"
,
priority
=
75
)
public
void
访客
H
关系绑定
()
{
visitorAuth9
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请H绑定结果和绑定凭证"
,
priority
=
76
)
public
void
获取访客
H
绑定结果和绑定凭证
()
{
visitorAuth9
();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请H根据绑定凭证发放抽奖码"
,
priority
=
77
)
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
=
"访客H到场"
,
priority
=
78
)
public
void
访客
H
到场
()
{
visitorAuth9
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/manager/QuesReward/Add.java
0 → 100644
View file @
7b95cd47
package
com
.
kjj
.
cases
.
live
.
manager
.
QuesReward
;
import
com.kjj.bean.answer.AddReward
;
import
com.kjj.bean.answer.AddWelfareConf
;
import
com.kjj.bean.answer.RewardList
;
import
com.kjj.bean.manager.AnswerBean
;
import
com.kjj.bean.manager.AnswerListBean
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Add
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
public
int
id
;
@Test
(
description
=
"答题现金红包"
,
priority
=
1
)
public
void
答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addParam
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题现金红包"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
addParam
.
put
(
"redConf"
,
redConf
);
addParam
.
put
(
"welfareConf"
,
null
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询新增答题现金红包"
,
priority
=
2
)
public
void
查询新增答题现金红包
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()-
1
);
boolean
red
=
reward
.
getQuesType
()
==
1
;
id
=
reward
.
getId
();
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题现金红包配置失败"
,
rewardRes
.
body
().
asString
()));
}
@Test
(
description
=
"修改答题现金红包"
,
priority
=
3
)
public
void
修改答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"id"
,
id
);
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addParam
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确选项"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误选项"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题现金红包"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
addParam
.
put
(
"redConf"
,
redConf
);
addParam
.
put
(
"welfareConf"
,
null
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_update
);
boolean
data
=
addRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_update
,
"修改答题红包配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"删除新增答题现金红包"
,
priority
=
4
)
public
void
删除新增答题现金红包
()
{
Map
<
String
,
Object
>
delParam
=
new
HashMap
<>();
delParam
.
put
(
"id"
,
id
);
Response
delRes
=
network
.
getResponse
(
delParam
,
BasicConfig
.
MANAGER_delete
);
boolean
data
=
delRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
delParam
,
BasicConfig
.
MANAGER_delete
,
"删除答题现金红包"
,
delRes
.
body
().
asString
()));
}
@Test
(
description
=
"新增答题现金红包"
,
priority
=
5
)
public
void
新增答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addParam
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题现金红包1"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
addParam
.
put
(
"redConf"
,
redConf
);
addParam
.
put
(
"welfareConf"
,
null
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
addRes
.
body
().
asString
()));
Map
<
String
,
Object
>
add1Param
=
new
HashMap
<>();
add1Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
add1Param
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers1
=
new
ArrayList
<>();
AnswerBean
Answer1
=
new
AnswerBean
();
Answer1
.
setOptionDetail
(
"正确"
);
Answer1
.
setOptionType
(
1
);
Answers1
.
add
(
Answer1
);
AnswerBean
Answer_1
=
new
AnswerBean
();
Answer_1
.
setOptionDetail
(
"错误"
);
Answer_1
.
setOptionType
(
2
);
Answers
.
add
(
Answer_1
);
AnswerListBean
bean1
=
new
AnswerListBean
();
bean1
.
setQuestionDetail
(
"答题现金红包2"
);
bean1
.
setOptionList
(
Answers1
);
add1Param
.
put
(
"questionConf"
,
bean1
);
AddReward
redConf1
=
new
AddReward
();
redConf1
.
setAmount
(
100
);
redConf1
.
setShowAmount
(
100
);
redConf1
.
setNum
(
3
);
add1Param
.
put
(
"redConf"
,
redConf1
);
add1Param
.
put
(
"welfareConf"
,
null
);
Response
add1Res
=
network
.
postResponse
(
add1Param
,
BasicConfig
.
MANAGER_add
);
boolean
data1
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
add1Param
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
add1Res
.
body
().
asString
()));
}
@Test
(
description
=
"查询答题现金红包"
,
priority
=
6
)
public
void
查询答题现金红包
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()-
1
);
boolean
red
=
reward
.
getQuesType
()
==
1
;
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题现金红包配置失败"
,
rewardRes
.
body
().
asString
()));
}
//有奖答题_实物奖品
@Test
(
description
=
"新增答题实物奖品"
,
priority
=
7
)
public
void
新增答题实物奖品
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addParam
.
put
(
"quesType"
,
"2"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确选项"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误选项"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题实物奖品1"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
addParam
.
put
(
"redConf"
,
null
);
AddWelfareConf
welfareConf
=
new
AddWelfareConf
();
welfareConf
.
setWelfareId
(
190
);
welfareConf
.
setNum
(
100
);
addParam
.
put
(
"welfareConf"
,
welfareConf
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"新增答题实物奖品配置失败"
,
addRes
.
body
().
asString
()));
Map
<
String
,
Object
>
add1Param
=
new
HashMap
<>();
add1Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
add1Param
.
put
(
"quesType"
,
"2"
);
List
<
AnswerBean
>
Answers1
=
new
ArrayList
<>();
AnswerBean
Answer1
=
new
AnswerBean
();
Answer1
.
setOptionDetail
(
"正确选项"
);
Answer1
.
setOptionType
(
1
);
Answers1
.
add
(
Answer1
);
AnswerBean
Answer_2
=
new
AnswerBean
();
Answer_2
.
setOptionDetail
(
"错误选项"
);
Answer_2
.
setOptionType
(
2
);
Answers1
.
add
(
Answer_2
);
AnswerListBean
bean1
=
new
AnswerListBean
();
bean1
.
setQuestionDetail
(
"答题实物奖品2"
);
bean1
.
setOptionList
(
Answers
);
add1Param
.
put
(
"questionConf"
,
bean1
);
add1Param
.
put
(
"redConf"
,
null
);
AddWelfareConf
welfareConf1
=
new
AddWelfareConf
();
welfareConf1
.
setWelfareId
(
190
);
welfareConf1
.
setNum
(
100
);
add1Param
.
put
(
"welfareConf"
,
welfareConf1
);
Response
add1Res
=
network
.
postResponse
(
add1Param
,
BasicConfig
.
MANAGER_add
);
boolean
data1
=
add1Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
add1Param
,
BasicConfig
.
MANAGER_add
,
"新增答题实物奖品配置失败"
,
add1Res
.
body
().
asString
()));
}
//有奖答题实物奖品列表数据查询
@Test
(
description
=
"查询答题实物奖品"
,
priority
=
8
)
public
void
查询答题实物奖品
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()-
1
);
boolean
red
=
reward
.
getQuesType
()
==
2
;
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题实物奖品失败"
,
rewardRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/manager/QuesReward/TeamAssignment.java
View file @
7b95cd47
...
...
@@ -45,7 +45,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"获取答题按团队分配的团队列表"
,
priority
=
2
)
public
void
获取答题按团队分配的团队列表
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
);
...
...
@@ -58,7 +58,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"添加团队"
,
priority
=
3
)
public
void
添加团队
()
{
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
addTeamParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addTeamParam
.
put
(
"teamIds"
,
Arrays
.
asList
(
3837
,
3324
,
3817
));
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
);
...
...
@@ -72,7 +72,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"获取答题已分配的团队列表"
,
priority
=
4
)
public
void
获取答题已分配的团队列表
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
);
...
...
@@ -86,7 +86,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"单个团队删除"
,
priority
=
5
)
public
void
单个团队删除
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
TeamParam
.
put
(
"id"
,
this
.
teamID
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
TeamParam
,
BasicConfig
.
MANAGER_delTeam
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
@@ -98,7 +98,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"一键清空团队"
,
priority
=
6
)
public
void
一键清空团队
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
Response
response
=
network
.
postResponse
(
TeamParam
,
BasicConfig
.
MANAGER_deleteAll
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -109,7 +109,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"添加指定中奖团队"
,
priority
=
7
)
public
void
添加指定中奖团队
()
{
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
addTeamParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addTeamParam
.
put
(
"teamIds"
,
Arrays
.
asList
(
3817
));
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
);
...
...
@@ -123,7 +123,7 @@ public class TeamAssignment implements AdminAuthorization {
@Test
(
description
=
"开启团队配置开关"
,
priority
=
8
)
public
void
开启团队配置开关
()
{
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
2
).
getId
());
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_updateTeam
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
src/test/java/com/kjj/cases/live/manager/QuesReward/Unlimited.java
View file @
7b95cd47
...
...
@@ -19,7 +19,37 @@ public class Unlimited implements AdminAuthorization {
BaseUtils
.
ssoLogin
();
}
@Test
(
description
=
"获取有奖答题列表信息"
,
priority
=
1
)
@Test
(
description
=
"修改本场答题规则仅一次中奖"
,
priority
=
1
)
public
void
修改本场答题规则仅一次中奖
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
// updateParam.put("liveId", 2960);
updateParam
.
put
(
"redPacketRuleType"
,
1
);
updateParam
.
put
(
"welfareRuleType"
,
1
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_updateQuestionPrizesRule
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_updateQuestionPrizesRule
,
"答题有奖红包规则无限制"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"答题有奖限制中奖1次"
,
priority
=
2
)
public
void
答题有奖限制中奖
1
次
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
// getConfParam.put("liveId", 2960);
Response
response
=
network
.
getResponse
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
);
Object
redPacketRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.redPacketRuleType"
);
System
.
out
.
println
(
redPacketRuleType
);
Assert
.
assertEquals
(
redPacketRuleType
,
1
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
Object
welfareRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.welfareRuleType"
);
System
.
out
.
println
(
welfareRuleType
);
Assert
.
assertEquals
(
welfareRuleType
,
1
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取有奖答题列表信息"
,
priority
=
3
)
public
void
获取有奖答题列表信息
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
@@ -31,7 +61,7 @@ public class Unlimited implements AdminAuthorization {
}
@Test
(
description
=
"本场答题无限制中奖规则"
,
priority
=
2
)
@Test
(
description
=
"本场答题无限制中奖规则"
,
priority
=
4
)
public
void
本场答题无限制中奖规则
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/cases/live/manager/SaveAndUpdate.java
View file @
7b95cd47
...
...
@@ -20,7 +20,6 @@ public class SaveAndUpdate implements AdminAuthorization {
public
String
liveID
;
public
String
EncodeLiveID
;
public
long
welfareConfId
;
public
int
id
;
@BeforeClass
public
void
setUp
()
{
...
...
@@ -334,218 +333,8 @@ public class SaveAndUpdate implements AdminAuthorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
saveOrUpdateRedParam
,
BasicConfig
.
MANAGER_SAVEORUPDATERED
,
"普通红包配置失败"
,
saveOrUpdateRedRes
.
body
().
asString
()));
}
@Test
(
description
=
"答题现金红包"
,
priority
=
16
)
public
void
答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
addParam
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"选项一"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"选项二"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题现金红包"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
addParam
.
put
(
"redConf"
,
redConf
);
addParam
.
put
(
"welfareConf"
,
null
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询新增答题现金红包"
,
priority
=
17
)
public
void
查询新增答题现金红包
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
liveID
);
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()-
1
);
boolean
red
=
reward
.
getQuesType
()
==
1
;
id
=
reward
.
getId
();
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题现金红包配置失败"
,
rewardRes
.
body
().
asString
()));
}
@Test
(
description
=
"删除新增答题现金红包"
,
priority
=
18
)
public
void
删除新增答题现金红包
()
{
Map
<
String
,
Object
>
delParam
=
new
HashMap
<>();
delParam
.
put
(
"id"
,
id
);
Response
delRes
=
network
.
getResponse
(
delParam
,
BasicConfig
.
MANAGER_delete
);
boolean
data
=
delRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
delParam
,
BasicConfig
.
MANAGER_delete
,
"删除答题现金红包"
,
delRes
.
body
().
asString
()));
}
@Test
(
description
=
"新增答题现金红包"
,
priority
=
19
)
public
void
新增答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
addParam
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"选项一"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"选项二"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题现金红包"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
addParam
.
put
(
"redConf"
,
redConf
);
addParam
.
put
(
"welfareConf"
,
null
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"修改答题现金红包"
,
priority
=
20
)
public
void
修改答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"id"
,
id
);
addParam
.
put
(
"liveId"
,
liveID
);
addParam
.
put
(
"quesType"
,
"1"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确选项"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误选项"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题现金红包"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
addParam
.
put
(
"redConf"
,
redConf
);
addParam
.
put
(
"welfareConf"
,
null
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_update
);
boolean
data
=
addRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_update
,
"修改答题红包配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询答题现金红包"
,
priority
=
21
)
public
void
查询答题现金红包
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
liveID
);
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()-
1
);
boolean
red
=
reward
.
getQuesType
()
==
1
;
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题现金红包配置失败"
,
rewardRes
.
body
().
asString
()));
}
//有奖答题_实物奖品
@Test
(
description
=
"答题实物奖品"
,
priority
=
22
)
public
void
答题实物奖品
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
addParam
.
put
(
"quesType"
,
"2"
);
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确选项"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误选项"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"答题实物奖品"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
addParam
.
put
(
"redConf"
,
null
);
AddWelfareConf
welfareConf
=
new
AddWelfareConf
();
welfareConf
.
setWelfareId
(
190
);
welfareConf
.
setNum
(
100
);
addParam
.
put
(
"welfareConf"
,
welfareConf
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"答题实物奖品配置失败"
,
addRes
.
body
().
asString
()));
}
//有奖答题实物奖品列表数据查询
@Test
(
description
=
"查询答题实物奖品"
,
priority
=
23
)
public
void
查询答题实物奖品
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
liveID
);
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()-
1
);
boolean
red
=
reward
.
getQuesType
()
==
2
;
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题实物奖品失败"
,
rewardRes
.
body
().
asString
()));
}
//直播前奖品配置
@Test
(
description
=
"直播前抽奖"
,
priority
=
24
)
public
void
直播前抽奖
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
addParam
.
put
(
"interactNum"
,
1
);
addParam
.
put
(
"showInteractNum"
,
1
);
addParam
.
put
(
"welfareId"
,
191
);
long
startTime
=
DateUtils
.
addHours
(
new
Date
(),
4
).
getTime
();
addParam
.
put
(
"startTime"
,
startTime
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
MANAGER_ADD
);
Object
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_ADD
,
"直播前抽奖配置失败"
,
addRes
.
body
().
asString
()));
}
//配置免费福利
@Test
(
description
=
"配置免费福利"
,
priority
=
25
)
@Test
(
description
=
"配置免费福利"
,
priority
=
16
)
public
void
配置免费福利
()
{
Map
<
String
,
Object
>
saveOrUpdate8Param
=
new
HashMap
<>();
saveOrUpdate8Param
.
put
(
"liveId"
,
liveID
);
...
...
src/test/java/com/kjj/cases/live/red/Limited.java
0 → 100644
View file @
7b95cd47
package
com
.
kjj
.
cases
.
live
.
red
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.answer.*
;
import
com.kjj.bean.manager.TeamAssignmentList
;
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
javax.xml.crypto.Data
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Limited
implements
AdminAuthorization
{
private
List
<
QuseRewardList
.
QuesList
>
quesConfId
;
/*主播端添加有奖答题-现金红包*/
@Test
(
description
=
"主播端添加有奖答题现金红包"
,
priority
=
1
)
public
void
主播端添加有奖答题现金红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"quesType"
,
"1"
);
AddAnswer
RedDetail
=
new
AddAnswer
();
RedDetail
.
setTotalAmount
(
100
);
RedDetail
.
setShowAmount
(
100
);
RedDetail
.
setTotalNum
(
3
);
params
.
put
(
"redDetail"
,
RedDetail
);
QuesConf
quesConf
=
new
QuesConf
();
quesConf
.
setQuestionDetail
(
"问题"
);
List
<
Option
>
optionlist
=
new
ArrayList
<>();
quesConf
.
setOptionList
(
optionlist
);
Option
option1
=
new
Option
();
option1
.
setOptionDetail
(
"正确"
);
option1
.
setOptionType
(
1
);
option1
.
setAnswerLen
(
2
);
optionlist
.
add
(
option1
);
Option
option2
=
new
Option
();
option2
.
setOptionDetail
(
"错误"
);
option2
.
setOptionType
(
2
);
option2
.
setAnswerLen
(
2
);
optionlist
.
add
(
option2
);
params
.
put
(
"questionConf"
,
quesConf
);
params
.
put
(
"confId"
,
""
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
System
.
out
.
println
(
"params = "
+
JSON
.
toJSONString
(
params
));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesSaveOrUpdate
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesSaveOrUpdate
,
"主播端添加有奖答题现金红包失败"
,
response
.
body
().
asString
()));
}
/*主播端添加有奖答题-奖品奖励*/
@Test
(
description
=
"主播端添加有奖答题奖品奖励"
,
priority
=
2
)
public
void
主播端添加有奖答题奖品奖励
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"quesType"
,
"2"
);
WelfareDetail
welfareDetail
=
new
WelfareDetail
();
welfareDetail
.
setRewardId
(
"Kj22MTU0Mw"
);
welfareDetail
.
setRewardNum
(
"1"
);
params
.
put
(
"welfareDetail"
,
welfareDetail
);
QuesConf
quesConf
=
new
QuesConf
();
quesConf
.
setQuestionDetail
(
"盲盒锦鲤奖品"
);
List
<
Option
>
optionlist
=
new
ArrayList
<>();
quesConf
.
setOptionList
(
optionlist
);
Option
option1
=
new
Option
();
option1
.
setOptionDetail
(
"正确"
);
option1
.
setOptionType
(
1
);
option1
.
setAnswerLen
(
2
);
optionlist
.
add
(
option1
);
Option
option2
=
new
Option
();
option2
.
setOptionDetail
(
"错误1"
);
option2
.
setOptionType
(
2
);
option2
.
setAnswerLen
(
3
);
optionlist
.
add
(
option2
);
params
.
put
(
"questionConf"
,
quesConf
);
params
.
put
(
"confId"
,
""
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
System
.
out
.
println
(
"params = "
+
JSON
.
toJSONString
(
params
));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesSaveOrUpdate
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesSaveOrUpdate
,
"主播端添加有奖答题现金红包失败"
,
response
.
body
().
asString
()));
}
/*查询主播端有奖答题列表*/
@Test
(
description
=
"查询主播端有奖答题列表"
,
priority
=
3
)
public
void
查询主播端有奖答题列表
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardList
);
List
<
QuseRewardList
.
QuesList
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.list"
)),
QuseRewardList
.
QuesList
.
class
);
System
.
out
.
println
(
list
);
this
.
quesConfId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardList
,
"查询主播端有奖答题列表失败"
,
response
.
body
().
asString
()));
}
/*查询主播端未上架的有奖答题配置详情*/
@Test
(
description
=
"查询第一轮答题现金红包"
,
priority
=
4
)
public
void
查询第一轮答题现金红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardGetDetail
);
RewardGetDetail
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RewardGetDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardGetDetail
,
"查询主播端有奖答题配置失败"
,
response
.
body
().
asString
()));
}
/*上架主播端未发放的有奖答题*/
@Test
(
description
=
"上架第一轮答题现金红包"
,
priority
=
5
)
public
void
上架第一轮答题现金红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放答题红包*/
@Test
(
description
=
"发放第一轮现金红包"
,
priority
=
6
)
public
void
发放第一轮现金红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
//访客端
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"访客查询答题红包配置"
,
priority
=
7
)
public
void
访客查询答题红包配置
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesDetail
);
Object
quesType
=
response
.
jsonPath
().
getJsonObject
(
"data.quesType"
);
System
.
out
.
println
(
quesType
);
Assert
.
assertEquals
(
quesType
,
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-错误选项*/
@Test
(
description
=
"领取答题红包-错误选项"
,
priority
=
8
)
public
void
领取答题红包
_
错误选项
()
{
visitorAuth2
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MjM"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-访客A选择正确选项*/
@Test
(
description
=
"领取答题红包_答题正确"
,
priority
=
9
)
public
void
访客
A
领取答题红包
_
答题正确
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertNull
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-黑名单用户选择正确选项*/
@Test
(
description
=
"领取答题红包-黑名单用户答题正确"
,
priority
=
11
)
public
void
黑名单用户领取答题红包成功
()
{
visitorAuth7
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*代理人领取答题红包*/
@Test
(
description
=
"代理人领取答题红包"
,
priority
=
12
)
public
void
代理人领取答题红包
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
()
);
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包结果*/
@Test
(
description
=
"领取答题红包结果"
,
priority
=
13
)
public
void
领取答题红包结果
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertNotNull
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"查询答题红包结果失败"
,
response
.
body
().
asString
()));
}
/*查询主播端未上架的有奖答题配置详情*/
@Test
(
description
=
"查询第二轮答题现金红包"
,
priority
=
14
)
public
void
查询第二轮答题现金红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardGetDetail
);
RewardGetDetail
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RewardGetDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardGetDetail
,
"查询主播端有奖答题配置失败"
,
response
.
body
().
asString
()));
}
/*上架主播端未发放的有奖答题*/
@Test
(
description
=
"上架第二轮答题现金红包"
,
priority
=
15
)
public
void
上架第二轮答题现金红包
()
{
ThreadSleepUtils
.
sleep
(
100000
);
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架第二轮答题红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放答题红包*/
@Test
(
description
=
"发放第二轮现金红包"
,
priority
=
16
)
public
void
发放第二轮现金红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放第二轮答题红包失败"
,
response
.
body
().
asString
()));
}
//访客端
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"访客A查询有奖答题配置详情"
,
priority
=
17
)
public
void
访客
A
查询有奖答题配置详情
()
{
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_QuesDetail
);
Object
quesType
=
response
.
jsonPath
().
getJsonObject
(
"data.quesType"
);
System
.
out
.
println
(
quesType
);
Assert
.
assertEquals
(
quesType
,
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-访客A选择正确选项*/
@Test
(
description
=
"访客A领取第二轮答题红包"
,
priority
=
18
)
public
void
访客
A
领取第二轮答题红包
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包结果*/
@Test
(
description
=
"第二轮领取答题红包结果"
,
priority
=
19
)
public
void
第二轮领取答题红包结果
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
1
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"查询答题红包结果失败"
,
response
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
30000
);
}
//*****************有奖答题福利类型*****************//
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第一轮答题福利"
,
priority
=
20
)
public
void
上架第一轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
100000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第一轮答题福利"
,
priority
=
21
)
public
void
发放第一轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客查询第一轮答题福利"
,
priority
=
22
)
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_QuesDetail
);
Object
quesType
=
response
.
jsonPath
().
getJsonObject
(
"data.quesType"
);
System
.
out
.
println
(
quesType
);
Assert
.
assertEquals
(
quesType
,
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型-错误选项*/
@Test
(
description
=
"领取有奖答题福利类型-错误选项"
,
priority
=
23
)
public
void
领取有奖答题福利类型选择错误
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MjM"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"领取有奖答题福利类型-访客A答题正确"
,
priority
=
24
)
public
void
访客
A
领取有奖答题福利类型
()
{
visitorAuth3
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertNull
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型-黑名单用户选择正确选项*/
@Test
(
description
=
"黑名单用户领取有奖答题福利-答题正确"
,
priority
=
25
)
public
void
黑名单用户领取有奖答题福利
()
{
visitorAuth7
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*代理人领取有奖答题福利类型*/
@Test
(
description
=
"代理人领取有奖答题福利类型"
,
priority
=
26
)
public
void
代理人领取有奖答题福利类型
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
()
);
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"领取有奖答题福利类型结果"
,
priority
=
27
)
public
void
领取有奖答题福利类型结果
()
{
visitorAuth3
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertNotNull
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"查询答题红包结果失败"
,
response
.
body
().
asString
()));
}
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第二轮答题福利"
,
priority
=
28
)
public
void
上架第二轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
100000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
3
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
3000
);
}
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第二轮答题福利"
,
priority
=
29
)
public
void
发放第二轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
3
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客查询第二轮答题福利"
,
priority
=
30
)
public
void
访客查询第二轮答题福利
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesDetail
);
Object
quesType
=
response
.
jsonPath
().
getJsonObject
(
"data.quesType"
);
System
.
out
.
println
(
quesType
);
Assert
.
assertEquals
(
quesType
,
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"访客A第二轮领取有奖答题福利类型-答题正确"
,
priority
=
31
)
public
void
访客
A
第二轮领取有奖答题福利类型
()
{
visitorAuth3
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
3
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"领取第二轮有奖答题福利类型结果"
,
priority
=
32
)
public
void
领取第二轮有奖答题福利类型结果
()
{
visitorAuth3
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
3
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"查询答题红包结果失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/red/Unlimited.java
0 → 100644
View file @
7b95cd47
package
com
.
kjj
.
cases
.
live
.
red
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.answer.QuseRewardList
;
import
com.kjj.bean.answer.RewardGetDetail
;
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
Unlimited
implements
AdminAuthorization
{
private
List
<
QuseRewardList
.
QuesList
>
quesConfId
;
/*查询主播端有奖答题列表*/
@Test
(
description
=
"查询主播端有奖答题列表"
,
priority
=
1
)
public
void
查询主播端有奖答题列表
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardList
);
List
<
QuseRewardList
.
QuesList
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.list"
)),
QuseRewardList
.
QuesList
.
class
);
System
.
out
.
println
(
list
);
this
.
quesConfId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardList
,
"查询主播端有奖答题列表失败"
,
response
.
body
().
asString
()));
}
/*查询主播端未上架的有奖答题配置详情*/
@Test
(
description
=
"查询第三轮答题现金红包"
,
priority
=
2
)
public
void
查询第三轮答题现金红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardGetDetail
);
RewardGetDetail
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RewardGetDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardGetDetail
,
"查询主播端有奖答题配置失败"
,
response
.
body
().
asString
()));
}
/*上架主播端未发放的有奖答题*/
@Test
(
description
=
"上架第三轮答题现金红包"
,
priority
=
3
)
public
void
上架第三轮答题现金红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
100000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
3000
);
}
/*主播端发放答题红包*/
@Test
(
description
=
"发放第三轮现金红包"
,
priority
=
4
)
public
void
发放第三轮现金红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
//访客端
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"访客查询答题红包配置"
,
priority
=
5
)
public
void
访客查询答题红包配置
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesDetail
);
Object
quesType
=
response
.
jsonPath
().
getJsonObject
(
"data.quesType"
);
System
.
out
.
println
(
quesType
);
Assert
.
assertEquals
(
quesType
,
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-错误选项*/
@Test
(
description
=
"领取答题红包-错误选项"
,
priority
=
6
)
public
void
领取答题红包
_
错误选项
()
{
visitorAuth2
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MjM"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-访客A选择正确选项*/
@Test
(
description
=
"领取答题红包_答题正确"
,
priority
=
7
)
public
void
访客
A
领取答题红包
_
答题正确
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertNull
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包-黑名单用户选择正确选项*/
@Test
(
description
=
"领取答题红包-黑名单用户答题正确"
,
priority
=
8
)
public
void
黑名单用户领取答题红包成功
()
{
visitorAuth7
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*代理人领取答题红包*/
@Test
(
description
=
"代理人领取答题红包"
,
priority
=
9
)
public
void
代理人领取答题红包
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
()
);
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取答题红包结果*/
@Test
(
description
=
"领取答题红包结果"
,
priority
=
10
)
public
void
领取答题红包结果
()
{
visitorAuth9
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
4
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertNotNull
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"查询答题红包结果失败"
,
response
.
body
().
asString
()));
}
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第一轮答题福利"
,
priority
=
11
)
public
void
上架第一轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
100000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
5
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第一轮答题福利"
,
priority
=
12
)
public
void
发放第一轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
5
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客查询第一轮答题福利"
,
priority
=
13
)
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_QuesDetail
);
Object
quesType
=
response
.
jsonPath
().
getJsonObject
(
"data.quesType"
);
System
.
out
.
println
(
quesType
);
Assert
.
assertEquals
(
quesType
,
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型-错误选项*/
@Test
(
description
=
"领取有奖答题福利类型-错误选项"
,
priority
=
14
)
public
void
领取有奖答题福利类型选择错误
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
5
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MjM"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertFalse
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"领取有奖答题福利类型-访客A答题正确"
,
priority
=
15
)
public
void
访客
A
领取有奖答题福利类型
()
{
visitorAuth3
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
5
).
getQuesConfId
());
params
.
put
(
"optionId"
,
"Kj21MTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/user/User.java
View file @
7b95cd47
...
...
@@ -290,4 +290,8 @@ public class User implements AdminAuthorization {
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
7b95cd47
...
...
@@ -27,9 +27,9 @@ public class BasicConfig {
//直播访客 (新强)
public
static
String
VISITORKEY6
=
"DyGoVEPj7nANppy7P8NS4Z4v3PAwxeqJodqYrmwYkoHYMsV4yAxbTXwZ5wWmGQTddQgxdWoNCmN43P8fzhcuWRmdE"
;
//直播访客 (熊二)
public
static
String
VISITORKEY7
=
"LEH7epeHVDJWzhZ6DiexTHns
y28pGo5XmzZG7KzUUKbJwaH84WuambhcvuhbKjYEBPivHr6LyYkQiCkh1fAg4BKKkJmoX
"
;
public
static
String
VISITORKEY7
=
"LEH7epeHVDJWzhZ6DiexTHns
aPwQpbsXDYKqcguWGz3bANuXof13XAd74h5DvPeMkgMPmBhjxykz4C2a2V4oZLhdHDMvS
"
;
//直播访客 (熊大)
public
static
String
VISITORKEY8
=
"LEH7epeHVDJWzhZ6DiexTHns
y28pGo5bL75Lr5VqnVBDBqZVAUZDaFbXuMHKrnKVvTa8qAQcvrVmqN9fxue59EMwYib7p
"
;
public
static
String
VISITORKEY8
=
"LEH7epeHVDJWzhZ6DiexTHns
aPwQpcHvNnpxzrpy7o6fLHsDiQ8X6jiwuiHAr3PWST2a1qMd5nZY6UrQdGuHCi82jhBPs
"
;
// 基础线代理人 TKU
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
...
...
src/test/liveTestNG.xml
View file @
7b95cd47
...
...
@@ -19,19 +19,20 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题
无限制
配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.
Unlimite
d"
/>
</classes>
<test
preserve-order=
"true"
name=
"有奖答题配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.
Ad
d"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题团队配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.TeamAssignment"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题限制
1次
中奖"
>
<test
preserve-order=
"true"
name=
"有奖答题限制中奖"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.limited"
/>
</classes>
...
...
@@ -118,11 +119,30 @@
<class
name=
"com.kjj.cases.live.red.LiveVistorRed"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题"
>
<!-- <test preserve-order="true" name="有奖答题">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.red.QuestionAwards"/>-->
<!-- </classes>-->
<!-- </test>-->
<test
preserve-order=
"true"
name=
"有奖答题限制1次中奖"
>
<classes>
<class
name=
"com.kjj.cases.live.red.
QuestionAwards
"
/>
<class
name=
"com.kjj.cases.live.red.
Limited
"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题无限制配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.Unlimited"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题限制无限制中奖"
>
<classes>
<class
name=
"com.kjj.cases.live.red.Unlimited"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"投票"
>
<classes>
<class
name=
"com.kjj.cases.live.choice.Choice"
/>
...
...
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