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
0f39d089
Commit
0f39d089
authored
Apr 16, 2021
by
张震
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/Feature/20210416_zz' into Feature/20210416_zz
parents
9bf7a955
6d2695ad
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
554 additions
and
34 deletions
+554
-34
Ansernum.java
src/test/java/com/kjj/bean/choice/Ansernum.java
+11
-0
AnswerList.java
src/test/java/com/kjj/bean/choice/AnswerList.java
+10
-0
AnswerVosList.java
src/test/java/com/kjj/bean/choice/AnswerVosList.java
+11
-0
ChoiceList.java
src/test/java/com/kjj/bean/choice/ChoiceList.java
+10
-0
GetChoiceArray.java
src/test/java/com/kjj/bean/choice/GetChoiceArray.java
+13
-0
GetChoiceList.java
src/test/java/com/kjj/bean/choice/GetChoiceList.java
+10
-0
GetChoiceQues.java
src/test/java/com/kjj/bean/choice/GetChoiceQues.java
+11
-0
QuestionVo.java
src/test/java/com/kjj/bean/choice/QuestionVo.java
+10
-0
answer.java
src/test/java/com/kjj/bean/choice/answer.java
+10
-0
TeamList.java
src/test/java/com/kjj/bean/manager/TeamList.java
+9
-0
FreeReward.java
src/test/java/com/kjj/cases/live/FreeReward/FreeReward.java
+55
-0
Choice.java
src/test/java/com/kjj/cases/live/choice/Choice.java
+208
-0
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+31
-17
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/manager/SaveAndUpdate.java
+0
-3
Team.java
src/test/java/com/kjj/cases/live/manager/Team.java
+123
-0
User.java
src/test/java/com/kjj/cases/live/user/User.java
+3
-7
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+13
-7
liveTestNG.xml
src/test/liveTestNG.xml
+16
-0
No files found.
src/test/java/com/kjj/bean/choice/Ansernum.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
Ansernum
{
private
String
answerId
;
private
int
num
;
}
src/test/java/com/kjj/bean/choice/AnswerList.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
AnswerList
{
private
String
answer
;
private
int
num
;
private
String
resourceTitle
;
}
src/test/java/com/kjj/bean/choice/AnswerVosList.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
AnswerVosList
{
private
String
id
;
private
String
answer
;
private
String
relationResourcePushVo
;
}
src/test/java/com/kjj/bean/choice/ChoiceList.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
ChoiceList
{
private
String
answer
;
private
String
relationResourceId
;
}
src/test/java/com/kjj/bean/choice/GetChoiceArray.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
GetChoiceArray
{
private
String
id
;
private
String
question
;
private
List
<
AnswerList
>
answerList
;
private
String
resourceTitleList
;
}
\ No newline at end of file
src/test/java/com/kjj/bean/choice/GetChoiceList.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
GetChoiceList
{
private
GetChoiceArray
list
;
private
boolean
hasNext
;
}
src/test/java/com/kjj/bean/choice/GetChoiceQues.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
GetChoiceQues
{
private
QuestionVo
questionVo
;
private
List
<
AnswerVosList
>
answerVos
;
}
src/test/java/com/kjj/bean/choice/QuestionVo.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
QuestionVo
{
private
String
id
;
private
String
question
;
}
src/test/java/com/kjj/bean/choice/answer.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
choice
;
import
lombok.Data
;
@Data
public
class
answer
{
private
String
answer
;
private
int
num
;
private
String
resourceTitle
;
}
src/test/java/com/kjj/bean/manager/TeamList.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
TeamList
{
public
int
id
;
}
src/test/java/com/kjj/cases/live/FreeReward/FreeReward.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
cases
.
live
.
FreeReward
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
FreeReward
implements
AdminAuthorization
{
public
String
configId
;
@Test
(
description
=
"查询免费领福利"
,
priority
=
1
)
public
void
查询免费领福利
()
{
visitorAuth2
();
Map
<
String
,
Object
>
FreeRewardParam
=
new
HashMap
<>();
FreeRewardParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
FreeRewardRes
=
network
.
getResponse
(
FreeRewardParam
,
BasicConfig
.
ANCHOR_listLiveFreeReward
);
HashMap
data
=
FreeRewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
configId
=
(
String
)
data
.
get
(
"configId"
);
System
.
out
.
println
(
configId
);
Assert
.
assertNotNull
(
configId
,
network
.
message
(
FreeRewardParam
,
BasicConfig
.
ANCHOR_listLiveFreeReward
,
"查询免费领福利失败"
,
FreeRewardRes
.
body
().
asString
()));
}
@Test
(
description
=
"领取免费福利"
,
priority
=
2
)
public
void
领取免费福利
()
{
visitorAuth2
();
Map
<
String
,
Object
>
receiveParam
=
new
HashMap
<>();
receiveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
receiveParam
.
put
(
"liveInteractConfId"
,
configId
);
Response
receiveRes
=
network
.
getResponse
(
receiveParam
,
BasicConfig
.
ANCHOR_receive
);
Object
data
=
receiveRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
receiveParam
,
BasicConfig
.
ANCHOR_receive
,
"领取免费福利失败"
,
receiveRes
.
body
().
asString
()));
}
@Test
(
description
=
"提交免费福利姓名"
,
priority
=
3
)
public
void
提交免费福利姓名
()
{
visitorAuth2
();
Map
<
String
,
Object
>
submitInfoParam
=
new
HashMap
<>();
submitInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
submitInfoParam
.
put
(
"confId"
,
configId
);
submitInfoParam
.
put
(
"winnerName"
,
"中奖姓名YY"
);
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
()));
}
}
src/test/java/com/kjj/cases/live/choice/Choice.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
cases
.
live
.
choice
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.choice.Ansernum
;
import
com.kjj.bean.choice.ChoiceList
;
import
com.kjj.bean.choice.GetChoiceArray
;
import
com.kjj.bean.choice.GetChoiceQues
;
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.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Choice
implements
AdminAuthorization
{
public
String
id
;
public
String
answerid
;
public
String
questionid
;
//************助播端************//
/*助播端添加投票*/
@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
(
"question"
,
"投票问题"
);
List
<
ChoiceList
>
choicelist
=
new
ArrayList
<>();
ChoiceList
list
=
new
ChoiceList
();
list
.
setAnswer
(
"答案一"
);
list
.
setRelationResourceId
(
""
);
choicelist
.
add
(
list
);
ChoiceList
list1
=
new
ChoiceList
();
list1
.
setAnswer
(
"答案二"
);
list1
.
setRelationResourceId
(
""
);
choicelist
.
add
(
list1
);
params
.
put
(
"answerList"
,
choicelist
);
System
.
out
.
println
(
"params = "
+
JSON
.
toJSONString
(
params
));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AddChoice
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AddChoice
,
"主播端添加投票失败"
,
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
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ChoiceCurrentDetail
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ChoiceCurrentDetail
,
"助播端获取投票详情失败"
,
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
(
"pageSize"
,
30
);
params
.
put
(
"pageIndex"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ChoiceGetList
);
List
<
GetChoiceArray
>
getchoicelist
=
JsonUtil
.
parseResponseToPageBean
(
response
,
GetChoiceArray
.
class
);
GetChoiceArray
one
=
getchoicelist
.
get
(
0
);
id
=
one
.
getId
();
System
.
out
.
println
(
id
);
System
.
out
.
println
(
getchoicelist
);
Assert
.
assertNotNull
(
getchoicelist
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ChoiceGetList
,
"助播端获取投票详情失败"
,
response
.
body
().
asString
()));
}
/*助播端上架*/
@Test
(
description
=
"助播端上架投票"
,
priority
=
4
)
public
void
助播端上架投票
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
id
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_ChoiceSend
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ChoiceSend
,
"助播端上架投票失败"
,
response
.
body
().
asString
()));
}
//访客端
/*访客端获取正在答题中的选择题*/
@Test
(
description
=
"访客端获取正在答题中的选择题"
,
priority
=
5
)
public
void
访客端获取正在答题中的选择题
()
{
ThreadSleepUtils
.
sleep
(
5000
);
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetChoiceQuestion
);
GetChoiceQues
data
=
JsonUtil
.
parseResponseToBean
(
response
,
GetChoiceQues
.
class
);
questionid
=
data
.
getQuestionVo
().
getId
();
answerid
=
data
.
getAnswerVos
().
get
(
0
).
getId
();
System
.
out
.
println
(
questionid
);
System
.
out
.
println
(
answerid
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GetChoiceQuestion
,
"访客端获取正在答题中的选择题失败"
,
response
.
body
().
asString
()));
}
/*访客端提交答案*/
@Test
(
description
=
"访客端提交答案"
,
priority
=
6
)
public
void
访客端提交答案
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"answerId"
,
answerid
);
params
.
put
(
"questionId"
,
questionid
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_SubmitAnswer
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SubmitAnswer
,
"访客端提交答案失败"
,
response
.
body
().
asString
()));
}
/*访客端获取答案的数量*/
@Test
(
description
=
"访客端获取答案的数量"
,
priority
=
7
)
public
void
访客端获取答案的数量
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionId"
,
questionid
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AnswerNum
);
List
<
Ansernum
>
data
=
JsonUtil
.
parseResponseToListBean
(
response
,
Ansernum
.
class
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AnswerNum
,
"访客端获取答案的数量失败"
,
response
.
body
().
asString
()));
}
//代理人端
/*代理人端获取正在答题中的选择题*/
@Test
(
description
=
"代理人端获取正在答题中的选择题"
,
priority
=
8
)
public
void
代理人端获取正在答题中的选择题
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetChoiceQuestion
);
GetChoiceQues
data
=
JsonUtil
.
parseResponseToBean
(
response
,
GetChoiceQues
.
class
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GetChoiceQuestion
,
"代理人端获取正在答题中的选择题失败"
,
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
(
"answerId"
,
answerid
);
params
.
put
(
"questionId"
,
questionid
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_SubmitAnswer
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SubmitAnswer
,
"代理人端提交答案失败"
,
response
.
body
().
asString
()));
}
/*代理人端获取答案的数量*/
@Test
(
description
=
"代理人端获取答案的数量"
,
priority
=
10
)
public
void
代理人端获取答案的数量
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"questionId"
,
questionid
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AnswerNum
);
List
<
Ansernum
>
data
=
JsonUtil
.
parseResponseToListBean
(
response
,
Ansernum
.
class
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AnswerNum
,
"代理人端获取答案的数量失败"
,
response
.
body
().
asString
()));
}
/*助播端下架投票*/
@Test
(
description
=
"助播端下架投票"
,
priority
=
11
)
public
void
助播端下架投票
()
{
ThreadSleepUtils
.
sleep
(
5000
);
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
id
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_ChoiceClose
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ChoiceClose
,
"助播端下架投票失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
0f39d089
...
...
@@ -13,13 +13,13 @@ import org.testng.annotations.Test;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
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
抽奖活动弹层福利列表
()
{
...
...
@@ -135,6 +135,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"结束第一轮抽奖"
,
priority
=
10
)
public
void
结束第一轮抽奖
()
{
adminAuth
();
ThreadSleepUtils
.
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
());
...
...
@@ -277,10 +278,9 @@ public class Lottery implements AdminAuthorization {
Boolean
result
=
submitInfoRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
result
);
Assert
.
assertTrue
(
result
,
network
.
message
(
submitInfoParam
,
BasicConfig
.
USER_submitInfo
,
"提交姓名失败"
,
submitInfoRes
.
body
().
asString
()));
ThreadSleepUtils
.
sleep
(
3000
);
}
@Test
(
description
=
"访客A中奖任务"
,
priority
=
20
)
public
void
访客
A
中奖任务
()
{
visitorAuth
();
...
...
@@ -420,8 +420,15 @@ public class Lottery implements AdminAuthorization {
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
()));
List
<
Object
>
values
=
myLotteryCodeRes
.
jsonPath
().
getList
(
"data.list"
);
boolean
result
=
false
;
for
(
Object
value
:
values
){
if
(
Objects
.
equals
(((
Map
)
value
).
get
(
"codeSource"
),
5
)){
result
=
true
;
break
;
}
}
Assert
.
assertNotNull
(
result
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"查询访客A抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A抽奖码数量"
,
priority
=
31
)
...
...
@@ -450,7 +457,7 @@ public class Lottery implements AdminAuthorization {
}
//完成幸运任务逻辑
@Test
(
description
=
"访客B直播中分享直播间"
,
priority
=
33
)
public
void
访客
B
直播中分享直播间
()
{
visitorAuth2
();
...
...
@@ -577,6 +584,7 @@ public class Lottery implements AdminAuthorization {
public
void
幸运任务邀请
F
根据绑定凭证发放抽奖码
()
{
visitorAuth6
();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
500
);
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
...
...
@@ -607,9 +615,16 @@ public class Lottery implements AdminAuthorization {
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
()));
List
<
Object
>
values
=
myLotteryCodeRes
.
jsonPath
().
getList
(
"data.list"
);
boolean
result
=
false
;
for
(
Object
value
:
values
){
if
(
Objects
.
equals
(((
Map
)
value
).
get
(
"codeSource"
),
8
)){
result
=
true
;
break
;
}
}
Assert
.
assertTrue
(
result
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"获取抽奖码列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客B的抽奖码数量"
,
priority
=
45
)
...
...
@@ -692,7 +707,6 @@ public class Lottery implements AdminAuthorization {
}
@Test
(
description
=
"获取第二轮喜报"
,
priority
=
51
)
public
void
获取第二轮喜报
()
{
visitorAuth
();
...
...
src/test/java/com/kjj/cases/live/manager/SaveAndUpdate.java
View file @
0f39d089
...
...
@@ -13,9 +13,7 @@ import io.restassured.response.Response;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.*
;
public
class
SaveAndUpdate
implements
AdminAuthorization
{
public
String
liveID
;
public
String
EncodeLiveID
;
...
...
@@ -60,7 +58,6 @@ public class SaveAndUpdate implements AdminAuthorization {
public
void
查询直播配置
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
liveID
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_GETCONFDETAIL
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
...
...
src/test/java/com/kjj/cases/live/manager/Team.java
0 → 100644
View file @
0f39d089
package
com
.
kjj
.
cases
.
live
.
manager
;
import
com.kjj.bean.manager.TeamList
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
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
Team
implements
AdminAuthorization
{
public
List
<
TeamList
>
id
;
@Test
(
description
=
"新增团队"
,
priority
=
1
)
public
void
新增团队
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
saveOrUpdateParam
=
new
HashMap
<>();
saveOrUpdateParam
.
put
(
"companyId"
,
101
);
saveOrUpdateParam
.
put
(
"teamName"
,
"测试团队"
);
saveOrUpdateParam
.
put
(
"expectedNum"
,
100
);
saveOrUpdateParam
.
put
(
"id"
,
""
);
Response
response
=
network
.
postResponse
(
saveOrUpdateParam
,
BasicConfig
.
MANAGER_saveOrUpdate
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
saveOrUpdateParam
,
BasicConfig
.
MANAGER_saveOrUpdate
,
"新增团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询团队列表"
,
priority
=
2
)
public
void
查询团队列表
()
{
Map
<
String
,
Object
>
teamListParam
=
new
HashMap
<>();
teamListParam
.
put
(
"companyId"
,
101
);
teamListParam
.
put
(
"pageIndex"
,
1
);
teamListParam
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
teamListParam
,
BasicConfig
.
MANAGER_teamList
);
List
<
TeamList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
TeamList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
teamListParam
,
BasicConfig
.
MANAGER_teamList
,
"查询新增团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改团队"
,
priority
=
3
)
public
void
修改团队
()
{
Map
<
String
,
Object
>
saveOrUpdateParam
=
new
HashMap
<>();
saveOrUpdateParam
.
put
(
"companyId"
,
101
);
saveOrUpdateParam
.
put
(
"id"
,
this
.
id
.
get
(
0
).
getId
());
saveOrUpdateParam
.
put
(
"teamName"
,
"测试团队"
);
Response
response
=
network
.
postResponse
(
saveOrUpdateParam
,
BasicConfig
.
MANAGER_saveOrUpdate
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
saveOrUpdateParam
,
BasicConfig
.
MANAGER_saveOrUpdate
,
"修改新增团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除团队"
,
priority
=
4
)
public
void
删除团队
()
{
Map
<
String
,
Object
>
deleteParam
=
new
HashMap
<>();
deleteParam
.
put
(
"id"
,
this
.
id
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
deleteParam
,
BasicConfig
.
MANAGER_del
);
boolean
deta
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
deta
);
Assert
.
assertTrue
(
deta
,
network
.
message
(
deleteParam
,
BasicConfig
.
MANAGER_del
,
"查询新增团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"设置内勤标识"
,
priority
=
5
)
public
void
设置内勤标识
()
{
Map
<
String
,
Object
>
teamFlagParam
=
new
HashMap
<>();
teamFlagParam
.
put
(
"id"
,
this
.
id
.
get
(
0
).
getId
());
teamFlagParam
.
put
(
"teamFlag"
,
1
);
Response
response
=
network
.
postResponse
(
teamFlagParam
,
BasicConfig
.
MANAGER_teamFlag
);
boolean
deta
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
deta
);
Assert
.
assertTrue
(
deta
,
network
.
message
(
teamFlagParam
,
BasicConfig
.
MANAGER_teamFlag
,
"查询新增团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询设置团队内勤标识"
,
priority
=
6
)
public
void
查询设置团队内勤标识
()
{
Map
<
String
,
Object
>
teamListParam
=
new
HashMap
<>();
teamListParam
.
put
(
"companyId"
,
101
);
teamListParam
.
put
(
"pageIndex"
,
1
);
teamListParam
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
teamListParam
,
BasicConfig
.
MANAGER_teamList
);
List
<
TeamList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
TeamList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
teamListParam
,
BasicConfig
.
MANAGER_teamList
,
"查询设置团队内勤标识失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"取消团队内勤标识"
,
priority
=
7
)
public
void
取消内勤标识
()
{
Map
<
String
,
Object
>
teamFlagParam
=
new
HashMap
<>();
teamFlagParam
.
put
(
"id"
,
this
.
id
.
get
(
0
).
getId
());
teamFlagParam
.
put
(
"teamFlag"
,
0
);
Response
response
=
network
.
postResponse
(
teamFlagParam
,
BasicConfig
.
MANAGER_teamFlag
);
boolean
deta
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
deta
);
Assert
.
assertTrue
(
deta
,
network
.
message
(
teamFlagParam
,
BasicConfig
.
MANAGER_teamFlag
,
"查询新增团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询取消团队内勤标识"
,
priority
=
8
)
public
void
查询取消团队内勤标识
()
{
Map
<
String
,
Object
>
teamListParam
=
new
HashMap
<>();
teamListParam
.
put
(
"companyId"
,
101
);
teamListParam
.
put
(
"pageIndex"
,
1
);
teamListParam
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
teamListParam
,
BasicConfig
.
MANAGER_teamList
);
List
<
TeamList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
TeamList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
teamListParam
,
BasicConfig
.
MANAGER_teamList
,
"查询取消内勤标识失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/user/User.java
View file @
0f39d089
...
...
@@ -2,6 +2,7 @@ package com.kjj.cases.live.user;
import
com.kjj.cases.live.admin.AdminAuthorization
;
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
;
...
...
@@ -46,6 +47,7 @@ public class User implements AdminAuthorization {
@Test
(
description
=
"根据绑定凭证发放抽奖码"
,
priority
=
3
)
public
void
根据绑定凭证发放抽奖码
()
{
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
@@ -138,8 +140,6 @@ public class User implements AdminAuthorization {
}
//访客分享直播间
@Test
(
description
=
"访客分享直播间"
,
priority
=
10
)
public
void
访客分享直播间
()
{
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
...
...
@@ -153,8 +153,6 @@ public class User implements AdminAuthorization {
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
//访客邀请绑定
@Test
(
description
=
"访客邀请关系绑定"
,
priority
=
11
)
public
void
访客邀请关系绑定
()
{
visitorAuth2
();
...
...
@@ -167,8 +165,6 @@ public class User implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客获取绑定结果和绑定凭证"
,
priority
=
12
)
public
void
访客获取绑定结果和绑定凭证
()
{
visitorAuth2
();
...
...
@@ -183,10 +179,10 @@ public class User implements AdminAuthorization {
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客根据绑定凭证发放抽奖码"
,
priority
=
13
)
public
void
访客根据绑定凭证发放抽奖码
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
0f39d089
...
...
@@ -3,9 +3,9 @@ package com.kjj.config;
public
class
BasicConfig
{
public
static
int
apiCount
;
//接口数量统计
// 是否开启钉钉机器人推送
public
static
final
boolean
isPushReport
=
fals
e
;
//true
public
static
final
boolean
isPushReport
=
tru
e
;
//true
// 代理人微信昵称
public
static
final
String
WECHAT_NAME
=
"
嘿保险
"
;
//true
public
static
final
String
WECHAT_NAME
=
"
吉吉
"
;
//true
// 代理人的openid(固定)
public
static
final
String
OPEN_ID
=
"osi5w5ggFiEXk0tPJH9b0KO_XU08"
;
//直播管理员(嘿 保险)
...
...
@@ -52,7 +52,9 @@ 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_listLiveFreeReward
=
MOBILE_HOST
+
"/kjy/live/lottery/listLiveFreeReward"
;
public
static
final
String
ANCHOR_receive
=
MOBILE_HOST
+
"/kjy/live/user/lottery/receive"
;
// *************** 代理人指定中奖 ***************
public
static
final
String
MOBILE_getSpecifyAwardConf
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getSpecifyAwardConf"
;
public
static
final
String
MOBILE_getAgentParticipateCond
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getAgentParticipateCond"
;
...
...
@@ -149,7 +151,6 @@ public class BasicConfig {
//查询资料列表//
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
public
static
final
String
MOBILE_ResourceOn
=
MOBILE_HOST
+
"/conf/live/push/on"
;
...
...
@@ -172,14 +173,15 @@ 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_ChoiceCurrentDetail
=
MOBILE_HOST
+
"/conf/live/choice/currentDetail"
;
public
static
final
String
MOBILE_AddChoice
=
MOBILE_HOST
+
"/conf/live/choice/addChoice"
;
public
static
final
String
MOBILE_ChoiceGetList
=
MOBILE_HOST
+
"/conf/live/choice/getList"
;
public
static
final
String
MOBILE_ChoiceSend
=
MOBILE_HOST
+
"/conf/live/choice/send"
;
public
static
final
String
MOBILE_ChoiceClose
=
MOBILE_HOST
+
"/conf/live/choice/close"
;
public
static
final
String
MOBILE_GetChoiceQuestion
=
MOBILE_HOST
+
"/clue/choice/getChoiceQuestion"
;
public
static
final
String
MOBILE_SubmitAnswer
=
MOBILE_HOST
+
"/clue/choice/submitAnswer"
;
public
static
final
String
MOBILE_AnswerNum
=
MOBILE_HOST
+
"/clue/choice/answerNum"
;
//红包//
public
static
final
String
MOBILE_AnchorRedList
=
MOBILE_HOST
+
"/conf/live/red/findRedList"
;
...
...
@@ -232,7 +234,11 @@ public class BasicConfig {
public
static
final
String
MANAGER_FREE
=
MANAGER_HOST
+
"/kjy/manager/live/resource/saveOrUpdateFree"
;
public
static
final
String
MANAGER_TEST
=
MANAGER_HOST
+
"/kjy/manager/live/resource/saveOrUpdateTest"
;
//***************直播团队管理*****************
public
static
final
String
MANAGER_teamList
=
MANAGER_HOST
+
"/kjy/manager/live/company/team/teamList"
;
public
static
final
String
MANAGER_saveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/company/team/saveOrUpdate"
;
public
static
final
String
MANAGER_del
=
MANAGER_HOST
+
"/kjy/manager/live/company/team/delete"
;
public
static
final
String
MANAGER_teamFlag
=
MANAGER_HOST
+
"/kjy/manager/live/company/team/teamFlag"
;
// *************** 素材ID ***************
public
static
final
String
ARTICLE_CONTENTID
=
"Kj21NjM4NDc"
;
...
...
src/test/liveTestNG.xml
View file @
0f39d089
...
...
@@ -7,6 +7,11 @@
<class
name=
"com.kjj.cases.live.manager.LiveMaterial"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"团队管理"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.Team"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"创建直播"
>
<classes>
...
...
@@ -52,6 +57,12 @@
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"免费领福利"
>
<classes>
<class
name=
"com.kjj.cases.live.FreeReward.FreeReward"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客领取资料"
>
<classes>
<class
name=
"com.kjj.cases.live.anchor.LiveVisitors"
/>
...
...
@@ -73,6 +84,11 @@
<class
name=
"com.kjj.cases.live.red.QuestionAwards"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"投票"
>
<classes>
<class
name=
"com.kjj.cases.live.choice.Choice"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
<class
name=
"com.kjj.cases.live.anchor.CloseLive"
/>
...
...
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