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
118a3139
Commit
118a3139
authored
Apr 15, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '20210415bxl1' into 'master'
投票 See merge request test-group/kejiji!51
parents
1e29d713
b4a0dc18
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
312 additions
and
3 deletions
+312
-3
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
Choice.java
src/test/java/com/kjj/cases/live/choice/Choice.java
+208
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+3
-3
liveTestNG.xml
src/test/liveTestNG.xml
+5
-0
No files found.
src/test/java/com/kjj/bean/choice/Ansernum.java
0 → 100644
View file @
118a3139
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 @
118a3139
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 @
118a3139
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 @
118a3139
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 @
118a3139
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 @
118a3139
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 @
118a3139
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 @
118a3139
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 @
118a3139
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/cases/live/choice/Choice.java
0 → 100644
View file @
118a3139
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/config/BasicConfig.java
View file @
118a3139
...
...
@@ -141,7 +141,6 @@ public class BasicConfig {
public
static
final
String
MOBILE_MyCustomerList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/myCustomerList"
;
public
static
final
String
MOBILE_RewardAgentList
=
MOBILE_HOST
+
"/kjy/live/reward/agent/list"
;
//查询资料列表//
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
public
static
final
String
MOBILE_ResourceOn
=
MOBILE_HOST
+
"/conf/live/push/on"
;
...
...
@@ -164,14 +163,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"
;
...
...
src/test/liveTestNG.xml
View file @
118a3139
...
...
@@ -84,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