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
73cb6da5
Commit
73cb6da5
authored
Apr 08, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a4b781d8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
384 additions
and
31 deletions
+384
-31
ConfidList.java
src/test/java/com/kjj/bean/ConfidList.java
+9
-0
LotteryList.java
src/test/java/com/kjj/bean/LotteryList.java
+21
-0
DesignatedWinner.java
src/test/java/com/kjj/cases/live/DesignatedWinner.java
+217
-21
Lottery.java
src/test/java/com/kjj/cases/live/Lottery.java
+97
-0
MngAuthorization.java
src/test/java/com/kjj/cases/live/MngAuthorization.java
+0
-2
OpenLive.java
src/test/java/com/kjj/cases/live/OpenLive.java
+11
-1
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+23
-7
liveTestNG.xml
src/test/liveTestNG.xml
+6
-0
No files found.
src/test/java/com/kjj/bean/ConfidList.java
0 → 100644
View file @
73cb6da5
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
ConfidList
{
private
String
welfareConfId
;
}
src/test/java/com/kjj/bean/LotteryList.java
0 → 100644
View file @
73cb6da5
package
com
.
kjj
.
bean
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LotteryList
{
private
List
<
List_Lottery
>
LotteryList
;
private
String
welfareId
;
private
String
configId
;
@Data
public
static
class
List_Lottery
{
private
String
id
;
private
String
name
;
}
}
src/test/java/com/kjj/cases/live/DesignatedWinner.java
View file @
73cb6da5
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.bean.LotteryList
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
DesignatedWinner
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
public
List
<
LotteryList
.
List_Lottery
>
List_Lottery
;
public
List
<
LotteryList
>
welfareId
;
@Test
(
description
=
"直播前获取权益列表"
,
priority
=
1
)
public
void
直播前获取权益列表
()
{
adminAuth
();
Map
<
String
,
Object
>
List4AdminParam
=
new
HashMap
<>();
List4AdminParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List4AdminParam
.
put
(
"welfareType"
,
6
);
List4AdminParam
.
put
(
"pageIndex"
,
1
);
List4AdminParam
.
put
(
"pageSize"
,
50
);
Response
List4AdminRes
=
network
.
getResponse
(
List4AdminParam
,
BasicConfig
.
ANCHOR_getList4Admin
);
Object
data
=
List4AdminRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
LotteryList
.
List_Lottery
>
list
=
JsonUtil
.
parseResponseToPageBean
(
List4AdminRes
,
LotteryList
.
List_Lottery
.
class
);
System
.
out
.
println
(
list
);
this
.
List_Lottery
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
List4AdminParam
,
BasicConfig
.
ANCHOR_getList4Admin
,
"获取权益列表失败"
,
List4AdminRes
.
body
().
asString
()));
}
@Test
(
description
=
"新增直播前抽奖配置"
,
priority
=
2
)
public
void
新增直播前抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
preAddParam
=
new
HashMap
<>();
preAddParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
preAddParam
.
put
(
"welfareId"
,
this
.
List_Lottery
.
get
(
3
).
getId
());
preAddParam
.
put
(
"showInteractNum"
,
20
);
preAddParam
.
put
(
"interactNum"
,
20
);
long
startTime
=
DateUtils
.
addHours
(
new
Date
(),
3
).
getTime
();
preAddParam
.
put
(
"startTime"
,
startTime
);
Response
preAddRes
=
network
.
postResponse
(
preAddParam
,
BasicConfig
.
ANCHOR_preAdd
);
Object
data
=
preAddRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
preAddParam
,
BasicConfig
.
ANCHOR_preAdd
,
"新增直播前抽奖配置失败"
,
preAddRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询新增直播前抽奖配置"
,
priority
=
3
)
public
void
查询新增直播前抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
preListParam
=
new
HashMap
<>();
preListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
preListRes
=
network
.
getResponse
(
preListParam
,
BasicConfig
.
ANCHOR_List
);
List
<
LotteryList
>
list2
=
JsonUtil
.
parseResponseToListBean
(
preListRes
,
LotteryList
.
class
);
this
.
welfareId
=
list2
;
System
.
out
.
println
(
list2
);
Assert
.
assertNotNull
(
list2
,
network
.
message
(
preListParam
,
BasicConfig
.
ANCHOR_List
,
"查询新增直播前抽奖配置失败"
,
preListRes
.
body
().
asString
()));
}
@Test
(
description
=
"修改直播前抽奖配置"
,
priority
=
4
)
public
void
修改直播前抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
preAddParam
=
new
HashMap
<>();
preAddParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
preAddParam
.
put
(
"welfareId"
,
this
.
welfareId
.
get
(
0
).
getWelfareId
());
preAddParam
.
put
(
"configId"
,
this
.
welfareId
.
get
(
0
).
getConfigId
());
preAddParam
.
put
(
"showInteractNum"
,
20
);
preAddParam
.
put
(
"interactNum"
,
20
);
long
startTime
=
DateUtils
.
addHours
(
new
Date
(),
3
).
getTime
();
preAddParam
.
put
(
"startTime"
,
startTime
);
Response
preAddRes
=
network
.
postResponse
(
preAddParam
,
BasicConfig
.
ANCHOR_preModify
);
boolean
success
=
preAddRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
preAddParam
,
BasicConfig
.
ANCHOR_preModify
,
"修改直播前抽奖配置失败"
,
preAddRes
.
body
().
asString
()));
}
@Test
(
description
=
"删除直播前抽奖配置"
,
priority
=
5
)
public
void
删除直播前抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
addParam
.
put
(
"configId"
,
this
.
welfareId
.
get
(
0
).
getConfigId
());
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
ANCHOR_preDelete
);
boolean
success
=
addRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
addParam
,
BasicConfig
.
ANCHOR_preDelete
,
"删除直播前抽奖配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播中权益列表"
,
priority
=
6
)
public
void
获取直播中权益列表
()
{
adminAuth
();
Map
<
String
,
Object
>
List4AdminParam
=
new
HashMap
<>();
List4AdminParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List4AdminParam
.
put
(
"welfareType"
,
6
);
List4AdminParam
.
put
(
"pageIndex"
,
1
);
List4AdminParam
.
put
(
"pageSize"
,
50
);
Response
List4AdminRes
=
network
.
getResponse
(
List4AdminParam
,
BasicConfig
.
ANCHOR_getList4Admin
);
Object
data
=
List4AdminRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
LotteryList
.
List_Lottery
>
list
=
JsonUtil
.
parseResponseToPageBean
(
List4AdminRes
,
LotteryList
.
List_Lottery
.
class
);
System
.
out
.
println
(
list
);
this
.
List_Lottery
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
List4AdminParam
,
BasicConfig
.
ANCHOR_getList4Admin
,
"获取直播中权益列表失败"
,
List4AdminRes
.
body
().
asString
()));
}
@Test
(
description
=
"添加直播中抽奖配置"
,
priority
=
7
)
public
void
添加直播中抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
addParam
.
put
(
"lotteryType"
,
1
);
addParam
.
put
(
"welfareId"
,
this
.
List_Lottery
.
get
(
0
).
getId
());
addParam
.
put
(
"afterMin"
,
20
);
addParam
.
put
(
"showInteractNum"
,
200
);
addParam
.
put
(
"interactNum"
,
200
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
ANCHOR_add
);
Object
data
=
addRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
ANCHOR_add
,
"添加直播中抽奖配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询新增直播中抽奖配置列表"
,
priority
=
8
)
public
void
查询新增直播中抽奖配置列表
()
{
adminAuth
();
Map
<
String
,
Object
>
list1Param
=
new
HashMap
<>();
list1Param
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
list1Res
=
network
.
getResponse
(
list1Param
,
BasicConfig
.
ANCHOR_list1
);
Object
data
=
list1Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
LotteryList
>
list1
=
JsonUtil
.
parseResponseToListBean
(
list1Res
,
LotteryList
.
class
);
this
.
welfareId
=
list1
;
Assert
.
assertNotNull
(
list1
,
network
.
message
(
list1Param
,
BasicConfig
.
ANCHOR_list1
,
"查询直播中抽奖配置失败"
,
list1Res
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播状态"
,
priority
=
1
)
@Test
(
description
=
"修改直播中抽奖配置"
,
priority
=
9
)
public
void
修改直播中抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
addParam
.
put
(
"welfareId"
,
this
.
welfareId
.
get
(
3
).
getWelfareId
());
addParam
.
put
(
"configId"
,
this
.
welfareId
.
get
(
3
).
getConfigId
());
addParam
.
put
(
"afterMin"
,
30
);
addParam
.
put
(
"showInteractNum"
,
200
);
addParam
.
put
(
"interactNum"
,
200
);
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
ANCHOR_Modify
);
boolean
success
=
addRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertNotNull
(
success
,
network
.
message
(
addParam
,
BasicConfig
.
ANCHOR_Modify
,
"修改直播中抽奖配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"删除直播中抽奖配置"
,
priority
=
10
)
public
void
删除直播中抽奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
addParam
.
put
(
"configId"
,
this
.
welfareId
.
get
(
3
).
getConfigId
());
Response
addRes
=
network
.
postResponse
(
addParam
,
BasicConfig
.
ANCHOR_delete
);
boolean
success
=
addRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
addParam
,
BasicConfig
.
ANCHOR_delete
,
"删除直播中抽奖配置失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"根据直播间id查询指定中奖配置"
,
priority
=
11
)
public
void
根据直播间
id
查询指定中奖配置
()
{
adminAuth
();
Map
<
String
,
Object
>
SpecifyAwardConfParam
=
new
HashMap
<>();
SpecifyAwardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
SpecifyAwardConfRes
=
network
.
getResponse
(
SpecifyAwardConfParam
,
BasicConfig
.
MOBILE_getSpecifyAwardConf
);
Object
data
=
SpecifyAwardConfRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
SpecifyAwardConfParam
,
BasicConfig
.
MOBILE_getSpecifyAwardConf
,
"根据直播间id查询指定中奖配置失败"
,
SpecifyAwardConfRes
.
body
().
asString
()));
}
@Test
(
description
=
"根据直播间id查询代理人参与条件"
,
priority
=
12
)
public
void
根据直播间
id
查询代理人参与条件
()
{
adminAuth
();
Map
<
String
,
Object
>
AgentParticipateCondParam
=
new
HashMap
<>();
AgentParticipateCondParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
AgentParticipateCondRes
=
network
.
getResponse
(
AgentParticipateCondParam
,
BasicConfig
.
MOBILE_getAgentParticipateCond
);
Object
data
=
AgentParticipateCondRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
AgentParticipateCondParam
,
BasicConfig
.
MOBILE_getAgentParticipateCond
,
"根据直播间id查询代理人参与条件失败"
,
AgentParticipateCondRes
.
body
().
asString
()));
}
@Test
(
description
=
"根据直播id查询抽奖奖品列表"
,
priority
=
13
)
public
void
根据直播
id
查询抽奖奖品列表
()
{
adminAuth
();
Map
<
String
,
Object
>
LiveAwardListParam
=
new
HashMap
<>();
LiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
LiveAwardListRes
=
network
.
getResponse
(
LiveAwardListParam
,
BasicConfig
.
MOBILE_getLiveAwardList
);
Object
data
=
LiveAwardListRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
LiveAwardListParam
,
BasicConfig
.
MOBILE_getLiveAwardList
,
"根据直播id查询抽奖奖品列表失败"
,
LiveAwardListRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播状态"
,
priority
=
14
)
public
void
获取直播状态
()
{
Map
<
String
,
Object
>
astatusParam
=
new
HashMap
<>();
astatusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
astatusRes
=
network
.
getResponse
(
astatusParam
,
BasicConfig
.
MOBILE_status
);
Map
<
String
,
Object
>
data
=
astatusRes
.
jsonPath
().
getJsonObject
(
"data"
);
agentAuth
();
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
statusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
statusRes
=
network
.
getResponse
(
statusParam
,
BasicConfig
.
MOBILE_status1
);
Map
<
String
,
Object
>
data
=
statusRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
int
liveStatus
=
(
int
)
data
.
get
(
"liveStatus"
);
boolean
lotteryFlag
=
(
boolean
)
data
.
get
(
"lotteryFlag"
);
Assert
.
assertEquals
(
liveStatus
,
1
,
network
.
message
(
astatusParam
,
BasicConfig
.
MOBILE_status
,
"直播状态查询失败"
,
a
statusRes
.
body
().
asString
()));
Assert
.
assertTrue
(
lotteryFlag
,
network
.
message
(
astatusParam
,
BasicConfig
.
MOBILE_status
,
"抽奖标记为false"
,
a
statusRes
.
body
().
asString
()));
Assert
.
assertEquals
(
liveStatus
,
1
,
network
.
message
(
statusParam
,
BasicConfig
.
MOBILE_status1
,
"直播状态查询失败"
,
statusRes
.
body
().
asString
()));
Assert
.
assertTrue
(
lotteryFlag
,
network
.
message
(
statusParam
,
BasicConfig
.
MOBILE_status1
,
"抽奖标记为false"
,
statusRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询指定中奖配置"
,
priority
=
2
)
@Test
(
description
=
"查询指定中奖配置"
,
priority
=
15
)
public
void
查询指定中奖配置
()
{
agentAuth
();
Map
<
String
,
Object
>
awardConfParam
=
new
HashMap
<>();
awardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
awardConfRes
=
network
.
getResponse
(
awardConfParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
);
...
...
@@ -37,19 +229,20 @@ public class DesignatedWinner implements AdminAuthorization{
Assert
.
assertNotNull
(
data
,
network
.
message
(
awardConfParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
,
"中奖配置查询失败"
,
awardConfRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询指定中奖用户列表"
,
priority
=
3
)
@Test
(
description
=
"查询指定中奖用户列表"
,
priority
=
16
)
public
void
查询指定中奖用户列表
()
{
Map
<
String
,
Object
>
UserSelectListfParam
=
new
HashMap
<>();
UserSelectListfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
UserSelectListRes
=
network
.
getResponse
(
UserSelectListfParam
,
BasicConfig
.
MOBILE_SpecifyAwardUserSelectList
);
agentAuth
();
Map
<
String
,
Object
>
UserSelectListParam
=
new
HashMap
<>();
UserSelectListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
UserSelectListRes
=
network
.
getResponse
(
UserSelectListParam
,
BasicConfig
.
MOBILE_SpecifyAwardUserSelectList
);
Object
data
=
UserSelectListRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
UserSelectList
f
Param
,
BasicConfig
.
MOBILE_SpecifyAwardUserSelectList
,
"查询指定中奖用户失败"
,
UserSelectListRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
UserSelectListParam
,
BasicConfig
.
MOBILE_SpecifyAwardUserSelectList
,
"查询指定中奖用户失败"
,
UserSelectListRes
.
body
().
asString
()));
}
@Test
(
description
=
"代理人指定访客中奖表单提交"
,
priority
=
4
)
@Test
(
description
=
"代理人指定访客中奖表单提交"
,
priority
=
17
)
public
void
代理人指定访客中奖表单提交
()
{
Map
<
String
,
Object
>
SubmitParam
=
new
HashMap
<>();
SubmitParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -61,8 +254,9 @@ public class DesignatedWinner implements AdminAuthorization{
}
@Test
(
description
=
"被代理人指定中奖的用户列表"
,
priority
=
5
)
@Test
(
description
=
"被代理人指定中奖的用户列表"
,
priority
=
18
)
public
void
被代理人指定中奖的用户列表
()
{
agentAuth
();
Map
<
String
,
Object
>
AwardUserListParam
=
new
HashMap
<>();
AwardUserListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
AwardUserListRes
=
network
.
getResponse
(
AwardUserListParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardUserList
);
...
...
@@ -72,8 +266,9 @@ public class DesignatedWinner implements AdminAuthorization{
}
@Test
(
description
=
"代理人指定中奖信息查询"
,
priority
=
6
)
@Test
(
description
=
"代理人指定中奖信息查询"
,
priority
=
19
)
public
void
代理人指定中奖信息查询
()
{
agentAuth
();
Map
<
String
,
Object
>
AwardInfoParam
=
new
HashMap
<>();
AwardInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
AAwardInfoRes
=
network
.
getResponse
(
AwardInfoParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardInfo
);
...
...
@@ -83,8 +278,9 @@ public class DesignatedWinner implements AdminAuthorization{
}
@Test
(
description
=
"代理人指定中奖配置查询"
,
priority
=
7
)
@Test
(
description
=
"代理人指定中奖配置查询"
,
priority
=
20
)
public
void
代理人指定中奖配置查询
()
{
agentAuth
();
Map
<
String
,
Object
>
AwardConfParam
=
new
HashMap
<>();
AwardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
AwardConfRes
=
network
.
getResponse
(
AwardConfParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardConf
);
...
...
src/test/java/com/kjj/cases/live/Lottery.java
0 → 100644
View file @
73cb6da5
package
com
.
kjj
.
cases
.
live
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.AgentEndList
;
import
com.kjj.bean.ConfidList
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
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
Lottery
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
List
<
ConfidList
>
List_Confid
;
@Test
(
description
=
"抽奖活动弹层福利列表"
,
priority
=
1
)
public
void
抽奖活动弹层福利列表
()
{
Map
<
String
,
Object
>
listLiveLotterParam
=
new
HashMap
<>();
listLiveLotterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
listLiveLotterRes
=
network
.
getResponse
(
listLiveLotterParam
,
BasicConfig
.
USER_listLiveLottery
);
Object
data
=
listLiveLotterRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
listLiveLotterParam
,
BasicConfig
.
USER_listLiveLottery
,
"抽奖活动弹层福利列表查询失败"
,
listLiveLotterRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询抽奖奖品列表"
,
priority
=
2
)
public
void
查询抽奖奖品列表
()
{
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
);
System
.
out
.
println
(
list
);
this
.
List_Confid
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
,
"抽奖标记为false"
,
getLiveAwardListRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始第一轮抽奖"
,
priority
=
3
)
public
void
开始第一轮抽奖
()
{
Map
<
String
,
Object
>
startParam
=
new
HashMap
<>();
startParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
startParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
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
=
4
)
public
void
助播端权益列表
()
{
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
=
"抽奖状态查询"
,
priority
=
5
)
public
void
抽奖状态查询
()
{
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
statusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
statusParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
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
=
6
)
public
void
结束第一轮抽奖
()
{
try
{
Thread
.
sleep
(
1000
);
Map
<
String
,
Object
>
endParam
=
new
HashMap
<>();
endParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
endParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
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
()));
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
src/test/java/com/kjj/cases/live/MngAuthorization.java
View file @
73cb6da5
...
...
@@ -4,8 +4,6 @@ import com.kjj.utils.NetworkUtils;
/**
* 管理员后台授权
* @author zhanghuifeng
* date 2021/2/20-13:46
*/
public
interface
MngAuthorization
{
...
...
src/test/java/com/kjj/cases/live/OpenLive.java
View file @
73cb6da5
...
...
@@ -13,8 +13,18 @@ public class OpenLive implements AdminAuthorization {
public
void
setUp
()
{
adminAuth
();
}
@Test
(
description
=
"获取直播配置详情"
,
priority
=
1
)
public
void
获取直播配置详情
()
{
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
);
Object
data
=
ConfDetailRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
,
"获取直播配置详情失败"
,
ConfDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始直播"
,
priority
=
1
)
@Test
(
description
=
"开始直播"
,
priority
=
2
)
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
73cb6da5
...
...
@@ -9,7 +9,7 @@ public class BasicConfig {
// 代理人的openid(固定)
public
static
final
String
OPEN_ID
=
"osi5w5ggFiEXk0tPJH9b0KO_XU08"
;
//直播管理员(嘿 保险)
public
static
String
ADMIN_KEY
=
"LEH7epeHVDJWzhZ6DiexTHns
xr9dj8m9E3cwnnww5M4EuupwiJ3fYP8A6Ahrc22htzmVfYnNSfxHirjfK4BMwzQgtvhqh
"
;
public
static
String
ADMIN_KEY
=
"LEH7epeHVDJWzhZ6DiexTHns
y12nWWyRsr9qezBqCy8rR8eqVZXHyQcwnLYHAkuLohC8Sy9vqcAwUZ3LuJCP5pRfjffr3
"
;
// 直播代理人 (艳玲)
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
//直播访客 (嘿 保险)
...
...
@@ -42,17 +42,32 @@ public class BasicConfig {
// *************** 主播端 ***************
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
ANCHOR_ADDQUESTION
=
MOBILE_HOST
+
"/kjy/live/assist/question/addQuestion"
;
public
static
final
String
ANCHOR_LIVECARD
=
MOBILE_HOST
+
"/kjy/mp/liveCard/getLiveEndSellerCard"
;
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"
;
public
static
final
String
ANCHOR_Modify
=
MOBILE_HOST
+
"/conf/pre/lottery/modify"
;
public
static
final
String
ANCHOR_delete
=
MOBILE_HOST
+
"/conf/pre/lottery/delete"
;
public
static
final
String
ANCHOR_getList4Admin
=
MOBILE_HOST
+
"/conf/pre/welfare/getList4Admin"
;
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
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_SUBSCRIBE
=
MOBILE_HOST
+
"/kjy/live/user/appointment/subscribe"
;
public
static
final
String
USER_FIND
=
MOBILE_HOST
+
"/kjy/live/user/subscribe/find"
;
public
static
final
String
USER_SYCAPPOINTMENT
=
MOBILE_HOST
+
"/kjy/live/user/sycAppointment"
;
public
static
final
String
USER_START
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/start"
;
public
static
final
String
USER_DRAW
=
MOBILE_HOST
+
"/kjy/live/user/lottery/draw"
;
public
static
final
String
USER_END
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/end"
;
public
static
final
String
USER_savePoster
=
MOBILE_HOST
+
"/kjy/live/user/share/savePoster"
;
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"
;
...
...
@@ -112,11 +127,12 @@ public class BasicConfig {
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_status
=
MOBILE_HOST
+
"/index/status"
;
public
static
final
String
MOBILE_status
1
=
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"
;
//***************直播素材*****************
public
static
final
String
MANAGER_SAVEORUPDATE6
=
MANAGER_HOST
+
"/kjy/manager/conf/base/welfare/saveOrUpdate"
;
public
static
final
String
MANAGER_WELFARELIST
=
MANAGER_HOST
+
"/kjy/manager/conf/base/welfare/list"
;
...
...
src/test/liveTestNG.xml
View file @
73cb6da5
...
...
@@ -19,6 +19,7 @@
<class
name=
"com.kjj.cases.live.Procurator"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人分享直播间"
>
<classes>
<class
name=
"com.kjj.cases.live.Agent"
/>
...
...
@@ -42,6 +43,11 @@
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<classes>
<class
name=
"com.kjj.cases.live.Lottery"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客领取资料"
>
<classes>
<class
name=
"com.kjj.cases.live.LiveVisitors"
/>
...
...
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