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
03c34ab2
Commit
03c34ab2
authored
Apr 14, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2f9cdc98
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
603 additions
and
76 deletions
+603
-76
LotteryList.java
src/test/java/com/kjj/bean/lottery/LotteryList.java
+9
-0
AdminAuthorization.java
src/test/java/com/kjj/cases/live/AdminAuthorization.java
+33
-4
Lottery.java
src/test/java/com/kjj/cases/live/Lottery.java
+525
-48
OpenLive.java
src/test/java/com/kjj/cases/live/OpenLive.java
+2
-2
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
+5
-5
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+29
-17
No files found.
src/test/java/com/kjj/bean/lottery/LotteryList.java
0 → 100644
View file @
03c34ab2
package
com
.
kjj
.
bean
.
lottery
;
import
lombok.Data
;
@Data
public
class
LotteryList
{
private
int
drawDownNum
;
}
src/test/java/com/kjj/cases/live/AdminAuthorization.java
View file @
03c34ab2
...
...
@@ -35,14 +35,43 @@ public interface AdminAuthorization {
}
/**
* 访客(
🍗
)授权
* 访客(
慧锋
)授权
*/
default
void
visitorAuth2
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY1
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY1
);
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY2
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY2
);
}
/**
* 访客(刘超)授权
*/
default
void
visitorAuth3
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY3
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY3
);
}
/**
* 访客(志勇)授权
*/
default
void
visitorAuth4
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY4
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY4
);
}
/**
* 访客(周成)授权
*/
default
void
visitorAuth5
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY5
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY5
);
}
/**
* 访客(斌斌)授权
*/
default
void
visitorAuth6
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY6
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY6
);
}
}
src/test/java/com/kjj/cases/live/Lottery.java
View file @
03c34ab2
...
...
@@ -17,9 +17,12 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
public
class
Lottery
implements
AdminAuthorization
{
public
class
Lottery
implements
AdminAuthorization
{
public
List
<
ConfidList
>
List_Confid
;
public
String
shareSign
;
public
String
token
;
public
String
drawDownNum
;
@Test
(
description
=
"代理人抽奖活动弹层福利列表"
,
priority
=
1
)
public
void
抽奖活动弹层福利列表
()
{
...
...
@@ -38,13 +41,14 @@ public class Lottery implements AdminAuthorization{
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
getLiveAwardListRes
=
network
.
getResponse
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
);
List
<
ConfidList
>
list
=
JsonUtil
.
parseResponseToListBean
(
getLiveAwardListRes
,
ConfidList
.
class
);
List
<
ConfidList
>
list
=
JsonUtil
.
parseResponseToListBean
(
getLiveAwardListRes
,
ConfidList
.
class
);
System
.
out
.
println
(
list
);
this
.
List_Confid
=
list
;
this
.
List_Confid
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
,
"抽奖标记为false"
,
getLiveAwardListRes
.
body
().
asString
()));
}
@Test
(
description
=
"直播中访客到场"
,
priority
=
3
)
public
void
直播中访客到场
()
{
@Test
(
description
=
"访客A到场"
,
priority
=
3
)
public
void
访客
A
到场
()
{
visitorAuth
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -54,8 +58,20 @@ public class Lottery implements AdminAuthorization{
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客抽奖活动弹层福利列表"
,
priority
=
4
)
public
void
访客抽奖活动弹层福利列表
()
{
@Test
(
description
=
"访客B到场"
,
priority
=
4
)
public
void
访客
B
到场
()
{
visitorAuth2
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A抽奖查询抽奖活动弹层"
,
priority
=
5
)
public
void
访客
A
抽奖查询抽奖活动弹层
()
{
visitorAuth
();
Map
<
String
,
Object
>
listLiveLotterParam
=
new
HashMap
<>();
listLiveLotterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -66,7 +82,7 @@ public class Lottery implements AdminAuthorization{
}
@Test
(
description
=
"开始第一轮抽奖"
,
priority
=
5
)
@Test
(
description
=
"开始第一轮抽奖"
,
priority
=
6
)
public
void
开始第一轮抽奖
()
{
adminAuth
();
Map
<
String
,
Object
>
startParam
=
new
HashMap
<>();
...
...
@@ -77,8 +93,9 @@ public class Lottery implements AdminAuthorization{
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
startParam
,
BasicConfig
.
ANCHOR_start
,
"开启第一轮抽奖失败"
,
startRes
.
body
().
asString
()));
}
@Test
(
description
=
"正在抽奖的福利"
,
priority
=
6
)
public
void
正在抽奖的福利
()
{
@Test
(
description
=
"访客A查询正在抽奖的福利"
,
priority
=
7
)
public
void
访客
A
查询正在抽奖的福利
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
...
...
@@ -91,19 +108,22 @@ public class Lottery implements AdminAuthorization{
}
@Test
(
description
=
"助播视角_权益列表"
,
priority
=
7
)
public
void
助播端权益列表
()
{
adminAuth
();
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
listRes
=
network
.
getResponse
(
listParam
,
BasicConfig
.
ANCHOR_list
);
Object
data
=
listRes
.
jsonPath
().
getJsonObject
(
"data"
);
@Test
(
description
=
"访客B查询正在抽奖的福利"
,
priority
=
8
)
public
void
访客
B
查询正在抽奖的福利
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
infoRes
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
USER_info
);
System
.
out
.
println
(
"result="
+
infoRes
.
asString
());
Object
data
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
listParam
,
BasicConfig
.
ANCHOR_list
,
"主播端权益列表查询失败"
,
listRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
USER_info
,
"获取正在抽奖的福利失败"
,
infoRes
.
body
().
asString
()));
}
@Test
(
description
=
"
抽奖状态查询"
,
priority
=
8
)
public
void
抽奖状态查询
()
{
@Test
(
description
=
"
查询是否可以结束抽奖"
,
priority
=
9
)
public
void
查询是否可以结束抽奖
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
...
...
@@ -115,7 +135,7 @@ public class Lottery implements AdminAuthorization{
Assert
.
assertTrue
(
data
,
network
.
message
(
statusParam
,
BasicConfig
.
ANCHOR_status
,
"抽奖状态查询失败"
,
statusRes
.
body
().
asString
()));
}
@Test
(
description
=
"结束第一轮抽奖"
,
priority
=
9
)
@Test
(
description
=
"结束第一轮抽奖"
,
priority
=
10
)
public
void
结束第一轮抽奖
()
{
adminAuth
();
Map
<
String
,
Object
>
endParam
=
new
HashMap
<>();
...
...
@@ -128,8 +148,20 @@ public class Lottery implements AdminAuthorization{
}
@Test
(
description
=
"访客查询抽奖是否结束"
,
priority
=
10
)
public
void
访客查询抽奖是否结束
()
{
@Test
(
description
=
"助播查询抽奖权益列表"
,
priority
=
11
)
public
void
助播查询抽奖权益列表
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
listRes
=
network
.
getResponse
(
listParam
,
BasicConfig
.
ANCHOR_list
);
Object
data
=
listRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
listParam
,
BasicConfig
.
ANCHOR_list
,
"主播端权益列表查询失败"
,
listRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A查询抽奖是否结束"
,
priority
=
12
)
public
void
访客
A
查询抽奖是否结束
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
...
...
@@ -140,10 +172,23 @@ public class Lottery implements AdminAuthorization{
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_hasEnd
,
"查询抽奖结束状态失败"
,
hasEndRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客B查询抽奖是否结束"
,
priority
=
13
)
public
void
访客
B
查询抽奖是否结束
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
hasEndParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
hasEndParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_hasEnd
);
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_hasEnd
,
"查询抽奖结束状态失败"
,
hasEndRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客
查询是否中奖"
,
priority
=
11
)
public
void
访客查询是否中奖
()
{
@Test
(
description
=
"访客
A查询是否中奖"
,
priority
=
14
)
public
void
访客
A
查询是否中奖
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
...
...
@@ -153,14 +198,32 @@ public class Lottery implements AdminAuthorization{
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客查询中奖失败"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
){
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
}
}
@Test
(
description
=
"访客B查询是否中奖"
,
priority
=
15
)
public
void
访客
B
查询是否中奖
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
hasEndParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
hasEndParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"访客查询中奖失败"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
}
}
@Test
(
description
=
"访客查看榜单"
,
priority
=
12
)
public
void
访客查看榜单
()
{
@Test
(
description
=
"查看第一轮抽奖榜单"
,
priority
=
16
)
public
void
查看第一轮抽奖榜单
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
pageListParam
=
new
HashMap
<>();
...
...
@@ -176,21 +239,21 @@ public class Lottery implements AdminAuthorization{
}
@Test
(
description
=
"获取
喜报"
,
priority
=
13
)
public
void
获取喜报
()
{
@Test
(
description
=
"获取
第一轮喜报"
,
priority
=
17
)
public
void
获取
第一轮
喜报
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
allLotteryNameParam
=
new
HashMap
<>();
allLotteryNameParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
allLotteryNameParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Response
allLotteryNameRes
=
network
.
getResponse
(
allLotteryNameParam
,
BasicConfig
.
USER_allLotteryName
);
Boolean
success
=
allLotteryNameRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
allLotteryNameParam
,
BasicConfig
.
USER_allLotteryName
,
"获取喜报失败"
,
allLotteryNameRes
.
body
().
asString
()));
Object
data
=
allLotteryNameRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
allLotteryNameParam
,
BasicConfig
.
USER_allLotteryName
,
"获取喜报失败"
,
allLotteryNameRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询用户是否提交姓名"
,
priority
=
14
)
@Test
(
description
=
"查询用户是否提交姓名"
,
priority
=
18
)
public
void
查询用户是否提交姓名
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
...
...
@@ -203,24 +266,438 @@ public class Lottery implements AdminAuthorization{
}
@Test
(
description
=
"提交姓名"
,
priority
=
1
5
)
@Test
(
description
=
"提交姓名"
,
priority
=
1
9
)
public
void
提交姓名
()
{
visitorAuth
();
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
submitInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
submitInfoParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
submitInfoParam
.
put
(
"winnerName"
,
"
嘿保险
XX"
);
submitInfoParam
.
put
(
"winnerName"
,
"
中奖姓名
XX"
);
submitInfoParam
.
put
(
"region"
,
""
);
submitInfoParam
.
put
(
"location"
,
""
);
submitInfoParam
.
put
(
"phoneNum"
,
""
);
Response
submitInfoRes
=
network
.
postResponse
(
submitInfoParam
,
BasicConfig
.
USER_submitInfo
);
Boolean
result
=
submitInfoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
result
);
Assert
.
assertTrue
(
result
,
network
.
message
(
submitInfoParam
,
BasicConfig
.
USER_submitInfo
,
"
获取喜报
失败"
,
submitInfoRes
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
submitInfoParam
,
BasicConfig
.
USER_submitInfo
,
"
提交姓名
失败"
,
submitInfoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A中奖任务"
,
priority
=
20
)
public
void
访客
A
中奖任务
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Object
data
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A中奖任务_分享直播间"
,
priority
=
21
)
public
void
访客
A
中奖任务
_
分享直播间
()
{
visitorAuth
();
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
=
"中奖任务邀请C关系绑定"
,
priority
=
22
)
public
void
中奖任务邀请
C
关系绑定
()
{
visitorAuth3
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请C绑定结果和绑定凭证"
,
priority
=
23
)
public
void
获取访客
C
绑定结果和绑定凭证
()
{
visitorAuth3
();
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
=
"中奖任务邀请C根据绑定凭证发放抽奖码"
,
priority
=
24
)
public
void
中奖任务邀请
C
根据绑定凭证发放抽奖码
()
{
visitorAuth
();
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
=
"访客C到场"
,
priority
=
25
)
public
void
访客
C
到场
()
{
visitorAuth3
();
Map
<
String
,
Object
>
connectSuccessParam
=
new
HashMap
<>();
connectSuccessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
connectSuccessoRes
=
network
.
getResponse
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
);
boolean
success
=
connectSuccessoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
connectSuccessoRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客C关注直播间"
,
priority
=
26
)
public
void
访客
C
关注直播间
()
{
visitorAuth3
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
//访客B绑定访客A后获取访客A的中奖任务信息
@Test
(
description
=
"访客C获取访客A的中奖任务信息"
,
priority
=
27
)
public
void
访客
C
获取访客
A
的中奖任务信息
()
{
visitorAuth3
();
Map
<
String
,
Object
>
inviteDrawDetailParam
=
new
HashMap
<>();
inviteDrawDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
inviteDrawDetailRes
=
network
.
getResponse
(
inviteDrawDetailParam
,
BasicConfig
.
ANCHOR_inviteDrawDetail
);
Object
result
=
inviteDrawDetailRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
result
);
Assert
.
assertNotNull
(
result
,
network
.
message
(
inviteDrawDetailParam
,
BasicConfig
.
ANCHOR_inviteDrawDetail
,
"查询邀请人中奖信息失败"
,
inviteDrawDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客C抽奖码数量"
,
priority
=
28
)
public
void
访客
C
抽奖码数量
()
{
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A中奖任务是否完成"
,
priority
=
29
)
public
void
访客
A
中奖任务是否完成
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Object
data
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A抽奖券列表"
,
priority
=
30
)
public
void
访客
A
抽奖券列表
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
5000
);
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
=
"访客B幸运任务"
,
priority
=
31
)
public
void
访客
B
幸运任务
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Object
data
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
}
//完成幸运任务逻辑
@Test
(
description
=
"访客B直播中分享直播间"
,
priority
=
32
)
public
void
访客
B
直播中分享直播间
()
{
visitorAuth2
();
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
=
"幸运任务邀请D关系绑定"
,
priority
=
33
)
public
void
幸运任务邀请
D
关系绑定
()
{
visitorAuth4
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请D绑定结果和绑定凭证"
,
priority
=
34
)
public
void
幸运任务邀请
D
绑定结果和绑定凭证
()
{
visitorAuth4
();
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
=
"幸运任务邀请D根据绑定凭证发放抽奖码"
,
priority
=
35
)
public
void
幸运任务邀请
D
根据绑定凭证发放抽奖码
()
{
visitorAuth2
();
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
=
"幸运任务邀请E关系绑定"
,
priority
=
36
)
public
void
幸运任务邀请
E
关系绑定
()
{
visitorAuth5
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请E绑定结果和绑定凭证"
,
priority
=
37
)
public
void
幸运任务邀请
E
绑定结果和绑定凭证
()
{
visitorAuth5
();
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
=
"幸运任务邀请E根据绑定凭证发放抽奖码"
,
priority
=
38
)
public
void
幸运任务邀请
E
根据绑定凭证发放抽奖码
()
{
visitorAuth2
();
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
=
"幸运任务邀请F关系绑定"
,
priority
=
39
)
public
void
幸运任务邀请
F
关系绑定
()
{
visitorAuth6
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请F绑定结果和绑定凭证"
,
priority
=
40
)
public
void
幸运任务邀请
F
绑定结果和绑定凭证
()
{
visitorAuth6
();
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
=
"幸运任务邀请F根据绑定凭证发放抽奖码"
,
priority
=
41
)
public
void
幸运任务邀请
F
根据绑定凭证发放抽奖码
()
{
visitorAuth2
();
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
=
42
)
public
void
访客
B
幸运任务是否完成
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
luckDetailParam
=
new
HashMap
<>();
luckDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
luckDetailRes
=
network
.
getResponse
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
);
Object
data
=
luckDetailRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
luckDetailParam
,
BasicConfig
.
ANCHOR_luckDetail
,
"查询中奖任务失败"
,
luckDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客B的抽奖券列表"
,
priority
=
43
)
public
void
访客
B
的抽奖券列表
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
10000
);
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
(
JSON
.
toJSON
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"查询邀请人抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客B的抽奖码数量"
,
priority
=
44
)
public
void
访客
B
抽奖码数量
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始第二轮抽奖"
,
priority
=
45
)
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
(
"confId"
,
this
.
List_Confid
.
get
(
1
).
getWelfareConfId
());
Response
startRes
=
network
.
postResponse
(
startParam
,
BasicConfig
.
ANCHOR_start
);
Object
data
=
startRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
startParam
,
BasicConfig
.
ANCHOR_start
,
"开启第二轮抽奖失败"
,
startRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询第二轮正在抽奖的福利"
,
priority
=
46
)
public
void
查询第二轮正在抽奖的福利
()
{
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
infoRes
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
USER_info
);
System
.
out
.
println
(
"result="
+
infoRes
.
asString
());
Object
data
=
infoRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
infoParam
,
BasicConfig
.
USER_info
,
"获取正在抽奖的福利失败"
,
infoRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询第二轮是否可以结束抽奖状态"
,
priority
=
47
)
public
void
查询第二轮是否可以结束抽奖状态
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
statusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
statusParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
1
).
getWelfareConfId
());
Response
statusRes
=
network
.
postResponse
(
statusParam
,
BasicConfig
.
ANCHOR_status
);
boolean
data
=
statusRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
statusParam
,
BasicConfig
.
ANCHOR_status
,
"抽奖状态查询失败"
,
statusRes
.
body
().
asString
()));
}
@Test
(
description
=
"结束第二轮抽奖"
,
priority
=
48
)
public
void
结束第二轮抽奖
()
{
adminAuth
();
Map
<
String
,
Object
>
endParam
=
new
HashMap
<>();
endParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
endParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
1
).
getWelfareConfId
());
Response
endRes
=
network
.
postResponse
(
endParam
,
BasicConfig
.
ANCHOR_end
);
Boolean
data
=
endRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
endParam
,
BasicConfig
.
ANCHOR_end
,
"结束第二轮抽奖失败"
,
endRes
.
body
().
asString
()));
}
@Test
(
description
=
"查看第二轮抽奖榜单"
,
priority
=
49
)
public
void
查看第二轮抽奖榜单
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
pageListParam
=
new
HashMap
<>();
pageListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
pageListParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
1
).
getWelfareConfId
());
pageListParam
.
put
(
"pageIndex"
,
1
);
pageListParam
.
put
(
"pageSize"
,
50
);
Response
pageListRes
=
network
.
getResponse
(
pageListParam
,
BasicConfig
.
USER_pageList
);
Object
data
=
pageListRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
pageListParam
,
BasicConfig
.
USER_pageList
,
"中奖列表查询失败"
,
pageListRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取第二轮喜报"
,
priority
=
50
)
public
void
获取第二轮喜报
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
allLotteryNameParam
=
new
HashMap
<>();
allLotteryNameParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
allLotteryNameParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
1
).
getWelfareConfId
());
Response
allLotteryNameRes
=
network
.
getResponse
(
allLotteryNameParam
,
BasicConfig
.
USER_allLotteryName
);
Object
data
=
allLotteryNameRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
allLotteryNameParam
,
BasicConfig
.
USER_allLotteryName
,
"获取喜报失败"
,
allLotteryNameRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/OpenLive.java
View file @
03c34ab2
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
...
...
@@ -33,8 +34,7 @@ public class OpenLive implements AdminAuthorization {
Object
data
=
openRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
10000
);
}
...
...
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
View file @
03c34ab2
...
...
@@ -151,9 +151,9 @@ public class SaveAndUpdate implements AdminAuthorization {
saveOrUpdate4Param
.
put
(
"surveyLink"
,
"https://kjj.m.duibatest.com.cn/live/pages/survey/index?id=41"
);
Response
saveOrUpdate4Res
=
network
.
postResponse
(
saveOrUpdate4Param
,
BasicConfig
.
MANAGER_SAVEORUPDATE4
);
boolean
data
5
=
saveOrUpdate4Res
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
5
);
Assert
.
assertTrue
(
data
5
,
network
.
message
(
saveOrUpdate4Param
,
BasicConfig
.
MANAGER_SAVEORUPDATE4
,
"问卷配置失败"
,
saveOrUpdate4Res
.
body
().
asString
()));
boolean
data
=
saveOrUpdate4Res
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveOrUpdate4Param
,
BasicConfig
.
MANAGER_SAVEORUPDATE4
,
"问卷配置失败"
,
saveOrUpdate4Res
.
body
().
asString
()));
}
//直播中奖品配置
...
...
@@ -161,8 +161,8 @@ public class SaveAndUpdate implements AdminAuthorization {
public
void
直播中抽奖
()
{
Map
<
String
,
Object
>
add1Param
=
new
HashMap
<>();
add1Param
.
put
(
"liveId"
,
liveID
);
add1Param
.
put
(
"interactNum"
,
1
00
);
add1Param
.
put
(
"showInteractNum"
,
1
00
);
add1Param
.
put
(
"interactNum"
,
1
);
add1Param
.
put
(
"showInteractNum"
,
1
);
add1Param
.
put
(
"welfareId"
,
191
);
add1Param
.
put
(
"afterMin"
,
20
);
Response
add1Res
=
network
.
postResponse
(
add1Param
,
BasicConfig
.
MANAGER_ADD1
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
03c34ab2
...
...
@@ -14,8 +14,16 @@ public class BasicConfig {
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
//直播访客 (嘿 保险)
public
static
String
VISITORKEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKnNHmHY52FxaDfigK3U4NQpLsQrodQUPUXwmumQ1kr3xsfZoGw7cEswYryWfUtMW"
;
//直播访客 (🍗)
public
static
String
VISITORKEY1
=
"LEH7epeHVDJWzhZ6DiexTHnsYWTEo46qxbPUiJ1xnTqmCJPHLGsoTuy5C2psyH1j5t5ppr3BNQLrBXrBmsmJUDJcXSivb"
;
//直播访客 (茶仔)
public
static
String
VISITORKEY2
=
"zFNkBc7JtvLPL6ifAfXbcgYH7WrugVmhv4CXQVq1CN1Y2C8pcBXoPvUPFbkWj7HbdkFpe4oX6SLjczK3ruYpQ8EaQ5"
;
//直播访客 (刘超)
public
static
String
VISITORKEY3
=
"LEH7epeHVDJWzhZ6DiexTHnsaP3ed5NWb7fwGDRPzUCcfxMKyEZr5fYSmKv5AZVQu1w2FRoEvz6mP3RzfeKLqjV8Kq1XE"
;
//直播访客 (志勇)
public
static
String
VISITORKEY4
=
"zFNkBc7JtvLPL6ifAfXbcgYH7WruadyTs58VQNVezBEHURWFkb861yA3TQfkngLojnBnDenawiYNbNADYRdv1vFcDi"
;
//直播访客 (周成)
public
static
String
VISITORKEY5
=
"zFNkBc7JtvLPL6ifAfXbcgYH7WruadzDMUjR7buv4kTkfKtxsjyzHLTi7V9HNnQ7ia7Reb5rk5k11dFQPNSuMzsEMW"
;
//直播访客 (斌斌)
public
static
String
VISITORKEY6
=
"DyGoVEPj7nANppy7P8NS4Z4v3PAwxeqJodqYrmwYkoHYMsV4yAxbTXwZ5wWmGQTddQgxdWoNCmN43P8fzhcuWRmdE"
;
// 基础线代理人 TKU
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
// 基础线访客 TKU
...
...
@@ -40,17 +48,15 @@ public class BasicConfig {
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST1
=
"https://kjj.m.duibatest.com.cn"
;
// ***************
主播端
***************
// ***************
开启&结束直播
***************
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
public
static
final
String
ANCHOR_CLOSE
=
MOBILE_HOST
+
"/conf/live/close"
;
// *************** 代理人指定中奖 ***************
public
static
final
String
MOBILE_getSpecifyAwardConf
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getSpecifyAwardConf"
;
public
static
final
String
MOBILE_getAgentParticipateCond
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getAgentParticipateCond"
;
public
static
final
String
MOBILE_getLiveAwardList
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getLiveAwardList"
;
public
static
final
String
ANCHOR_start
=
MOBILE_HOST
+
"/conf/live/lottery/start"
;
public
static
final
String
ANCHOR_status
=
MOBILE_HOST
+
"/conf/live/lottery/status"
;
public
static
final
String
ANCHOR_end
=
MOBILE_HOST
+
"/conf/live/lottery/end"
;
public
static
final
String
ANCHOR_list
=
MOBILE_HOST
+
"/conf/live/lottery/list"
;
public
static
final
String
ANCHOR_List
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/list"
;
public
static
final
String
ANCHOR_add
=
MOBILE_HOST
+
"/conf/pre/lottery/add"
;
public
static
final
String
ANCHOR_preModify
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/modify"
;
...
...
@@ -60,7 +66,15 @@ public class BasicConfig {
public
static
final
String
ANCHOR_list1
=
MOBILE_HOST
+
"/conf/pre/lottery/list"
;
public
static
final
String
ANCHOR_preAdd
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/add"
;
public
static
final
String
ANCHOR_preDelete
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/delete"
;
// *************** 直播抽奖 ***************
public
static
final
String
MOBILE_status1
=
MOBILE_HOST
+
"/index/status"
;
public
static
final
String
MOBILE_AgentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
public
static
final
String
MOBILE_SpecifyAwardUserSelectList
=
MOBILE_HOST
+
"/kjy/live/agent/specifyAwardUserSelectList"
;
public
static
final
String
MOBILE_AgentSpecifyAwardSubmit
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardSubmit"
;
public
static
final
String
MOBILE_agentSpecifyAwardUserList
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardUserList"
;
public
static
final
String
MOBILE_agentSpecifyAwardInfo
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardInfo"
;
public
static
final
String
MOBILE_agentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
// *************** 直播中抽奖 ***************
public
static
final
String
USER_getLiveAwardList
=
MOBILE_HOST
+
"/kjy/live/conf/specifyAward/getLiveAwardList"
;
public
static
final
String
USER_listLiveLottery
=
MOBILE_HOST
+
"/kjy/live/lottery/listLiveLottery"
;
public
static
final
String
USER_pageList
=
MOBILE_HOST
+
"/clue/lottery/pageList"
;
...
...
@@ -71,6 +85,13 @@ public class BasicConfig {
public
static
final
String
USER_hasEnd
=
MOBILE_HOST
+
"/clue/lottery/hasEnd"
;
public
static
final
String
USER_info
=
MOBILE_HOST
+
"/clue/lottery/info"
;
public
static
final
String
USER_connectSuccess
=
MOBILE_HOST
+
"/kjy/live/connectSuccess"
;
public
static
final
String
ANCHOR_start
=
MOBILE_HOST
+
"/conf/live/lottery/start"
;
public
static
final
String
ANCHOR_list
=
MOBILE_HOST
+
"/conf/live/lottery/list"
;
public
static
final
String
ANCHOR_status
=
MOBILE_HOST
+
"/conf/live/lottery/status"
;
public
static
final
String
ANCHOR_end
=
MOBILE_HOST
+
"/conf/live/lottery/end"
;
public
static
final
String
ANCHOR_luckDetail
=
MOBILE_HOST
+
"/clue/lottery/task/luckDetail"
;
public
static
final
String
ANCHOR_inviteDrawDetail
=
MOBILE_HOST
+
"/clue/lottery/task/inviteDrawDetail"
;
public
static
final
String
ANCHOR_flag
=
MOBILE_HOST
+
"/clue/lottery/flag"
;
// *************** 访客端 ***************
public
static
final
String
USER_SUBSCRIBE
=
MOBILE_HOST
+
"/kjy/live/user/appointment/subscribe"
;
public
static
final
String
USER_FIND
=
MOBILE_HOST
+
"/kjy/live/user/subscribe/find"
;
...
...
@@ -79,8 +100,6 @@ public class BasicConfig {
public
static
final
String
USER_myCount
=
MOBILE_HOST
+
"/kjy/live/user/lottery/myCount"
;
public
static
final
String
USER_wxIdAllList
=
MOBILE_HOST1
+
"/kjy/mp/msg/config/live/user/wxIdAllList"
;
// *************** 直播管理端 ***************
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
public
static
final
String
MANAGER_GETCONFDETAIL
=
MANAGER_HOST
+
"/kjy/manager/live/conf/getConfDetail"
;
...
...
@@ -129,18 +148,11 @@ public class BasicConfig {
public
static
final
String
MOBILE_GetAgentPosterInfo
=
MOBILE_HOST
+
"/kjy/live/share/getAgentPosterInfo"
;
public
static
final
String
MOBILE_ClueNum
=
MOBILE_HOST
+
"/kjy/live/agent/clue/clueNum"
;
public
static
final
String
MOBILE_ClueList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/list"
;
public
static
final
String
MOBILE_AgentSpecifyAwardSubmit
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardSubmit"
;
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
public
static
final
String
MOBILE_binding
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_AgentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
public
static
final
String
MOBILE_Token
=
MOBILE_HOST
+
"/clue/invitation/token"
;
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_SpecifyAwardUserSelectList
=
MOBILE_HOST
+
"/kjy/live/agent/specifyAwardUserSelectList"
;
public
static
final
String
MOBILE_status1
=
MOBILE_HOST
+
"/index/status"
;
public
static
final
String
MOBILE_agentSpecifyAwardUserList
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardUserList"
;
public
static
final
String
MOBILE_agentSpecifyAwardInfo
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardInfo"
;
public
static
final
String
MOBILE_agentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
//红包//
...
...
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