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
c81a0f32
Commit
c81a0f32
authored
Apr 13, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
02d10636
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
13 deletions
+116
-13
RewardList.java
src/test/java/com/kjj/bean/answer/RewardList.java
+1
-0
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
+101
-8
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+12
-4
ThreadSleepUtils.java
src/test/java/com/kjj/utils/ThreadSleepUtils.java
+1
-0
liveTestNG.xml
src/test/liveTestNG.xml
+1
-1
No files found.
src/test/java/com/kjj/bean/answer/RewardList.java
View file @
c81a0f32
...
...
@@ -9,6 +9,7 @@ public class RewardList {
private
List
<
RewardList
.
Reward_List
>
list
;
@Data
public
static
class
Reward_List
{
private
int
id
;
private
String
question
;
private
int
quesType
;
private
int
num
;
...
...
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
View file @
c81a0f32
...
...
@@ -19,7 +19,7 @@ public class SaveAndUpdate implements AdminAuthorization {
public
String
liveID
;
public
String
EncodeLiveID
;
public
long
welfareConfId
;
public
int
quesType
;
public
int
id
;
@Test
(
description
=
"创建直播"
,
priority
=
1
)
public
void
创建直播
()
{
...
...
@@ -330,7 +330,6 @@ 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
<>();
...
...
@@ -364,8 +363,102 @@ public class SaveAndUpdate implements AdminAuthorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
addParam
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
addRes
.
body
().
asString
()));
}
//有奖答题列表数据查询
@Test
(
description
=
"查询答题现金红包"
,
priority
=
17
)
@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
);
...
...
@@ -380,7 +473,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
//有奖答题_实物奖品
@Test
(
description
=
"答题实物奖品"
,
priority
=
18
)
@Test
(
description
=
"答题实物奖品"
,
priority
=
22
)
public
void
答题实物奖品
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
...
...
@@ -414,7 +507,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
//有奖答题实物奖品列表数据查询
@Test
(
description
=
"查询答题实物奖品"
,
priority
=
19
)
@Test
(
description
=
"查询答题实物奖品"
,
priority
=
23
)
public
void
查询答题实物奖品
()
{
Map
<
String
,
Object
>
rewardParam
=
new
HashMap
<>();
rewardParam
.
put
(
"liveId"
,
liveID
);
...
...
@@ -430,7 +523,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
//直播前奖品配置
@Test
(
description
=
"直播前抽奖"
,
priority
=
2
0
)
@Test
(
description
=
"直播前抽奖"
,
priority
=
2
4
)
public
void
直播前抽奖
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
...
...
@@ -448,7 +541,7 @@ public class SaveAndUpdate implements AdminAuthorization {
//配置免费福利
@Test
(
description
=
"配置免费福利"
,
priority
=
2
1
)
@Test
(
description
=
"配置免费福利"
,
priority
=
2
5
)
public
void
配置免费福利
()
{
Map
<
String
,
Object
>
saveOrUpdate8Param
=
new
HashMap
<>();
saveOrUpdate8Param
.
put
(
"liveId"
,
liveID
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
c81a0f32
...
...
@@ -63,7 +63,14 @@ public class BasicConfig {
// *************** 直播抽奖 ***************
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"
;
public
static
final
String
USER_result
=
MOBILE_HOST
+
"/clue/lottery/result"
;
public
static
final
String
USER_allLotteryName
=
MOBILE_HOST
+
"/clue/lottery/allLotteryName"
;
public
static
final
String
USER_locationResult
=
MOBILE_HOST
+
"/clue/lottery/locationResult"
;
public
static
final
String
USER_submitInfo
=
MOBILE_HOST
+
"/clue/lottery/submitInfo"
;
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
USER_SUBSCRIBE
=
MOBILE_HOST
+
"/kjy/live/user/appointment/subscribe"
;
public
static
final
String
USER_FIND
=
MOBILE_HOST
+
"/kjy/live/user/subscribe/find"
;
...
...
@@ -71,8 +78,8 @@ public class BasicConfig {
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"
;
public
static
final
String
USER_info
=
MOBILE_HOST1
+
"/clue/lottery/info"
;
public
static
final
String
USER_draw
=
MOBILE_HOST1
+
"/clue/lottery/draw"
;
// *************** 直播管理端 ***************
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
...
...
@@ -95,7 +102,8 @@ public class BasicConfig {
public
static
final
String
MANAGER_SAVEORUPDATE7
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_getLiveAwardList
=
MANAGER_HOST
+
"/kjy/manager/specifyAward/pre/conf/getLiveAwardList"
;
public
static
final
String
MANAGER_rewardList
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/list"
;
public
static
final
String
MANAGER_delete
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/delete"
;
public
static
final
String
MANAGER_update
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/update"
;
// *************** 代理人 ***************
//代理人列表//
...
...
src/test/java/com/kjj/utils/ThreadSleepUtils.java
View file @
c81a0f32
package
com
.
kjj
.
utils
;
//延时
public
class
ThreadSleepUtils
{
private
ThreadSleepUtils
()
{}
...
...
src/test/liveTestNG.xml
View file @
c81a0f32
...
...
@@ -58,7 +58,7 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"红包"
>
<test
preserve-order=
"true"
name=
"红包
领取
"
>
<classes>
<class
name=
"com.kjj.cases.live.LiveVistorRed"
/>
</classes>
...
...
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