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
45ef1c14
Commit
45ef1c14
authored
Apr 16, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '20210416bxl' into 'master'
问题 See merge request test-group/kejiji!54
parents
f696cd5d
b24d3bee
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
238 additions
and
4 deletions
+238
-4
HistoryList.java
src/test/java/com/kjj/bean/issue/HistoryList.java
+7
-0
LastList.java
src/test/java/com/kjj/bean/issue/LastList.java
+10
-0
QuestionList.java
src/test/java/com/kjj/bean/issue/QuestionList.java
+12
-0
issuelist.java
src/test/java/com/kjj/bean/issue/issuelist.java
+10
-0
Question.java
src/test/java/com/kjj/cases/live/question/Question.java
+179
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+11
-0
liveTestNG.xml
src/test/liveTestNG.xml
+9
-4
No files found.
src/test/java/com/kjj/bean/issue/HistoryList.java
0 → 100644
View file @
45ef1c14
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
@Data
public
class
HistoryList
{
}
src/test/java/com/kjj/bean/issue/LastList.java
0 → 100644
View file @
45ef1c14
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
@Data
public
class
LastList
{
private
String
id
;
private
String
question
;
private
String
askNum
;
}
src/test/java/com/kjj/bean/issue/QuestionList.java
0 → 100644
View file @
45ef1c14
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
QuestionList
{
private
List
<
HistoryList
>
historyList
;
private
List
<
LastList
>
lastList
;
}
src/test/java/com/kjj/bean/issue/issuelist.java
0 → 100644
View file @
45ef1c14
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
@Data
public
class
issuelist
{
private
String
id
;
private
String
question
;
private
String
askNum
;
}
src/test/java/com/kjj/cases/live/question/Question.java
0 → 100644
View file @
45ef1c14
package
com
.
kjj
.
cases
.
live
.
question
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.issue.QuestionList
;
import
com.kjj.bean.issue.issuelist
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
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.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Question
implements
AdminAuthorization
{
List
<
String
>
questionIds
=
new
ArrayList
<>();
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"
,
"测试问题六"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuestionAdd
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuestionAdd
,
"助播端添加问题失败"
,
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_QuestionList
);
List
<
issuelist
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
issuelist
.
class
);
list
.
forEach
(
issue
->
questionIds
.
add
(
issue
.
getId
()));
System
.
out
.
println
(
questionIds
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuestionList
,
"助播端查询问题列表失败"
,
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
(
"questionIds"
,
questionIds
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuestionSend
);
System
.
out
.
println
(
"params = "
+
JSON
.
toJSONString
(
params
));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuestionSend
,
"助播端上架问题失败"
,
response
.
body
().
asString
()));
}
//访客端
/*访客端查询问题列表*/
@Test
(
description
=
"访客端查询问题列表"
,
priority
=
4
)
public
void
访客端查询问题列表
()
{
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_QuesClueList
);
QuestionList
list
=
JsonUtil
.
parseResponseToBean
(
response
,
QuestionList
.
class
);
questionId
=
list
.
getLastList
().
get
(
0
).
getId
();
System
.
out
.
println
(
questionIds
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesClueList
,
"助播端查询问题列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客端发起问题"
,
priority
=
5
)
public
void
访客端发起问题
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionIds"
,
questionIds
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AskQuestion
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AskQuestion
,
"访客端发起问题失败"
,
response
.
body
().
asString
()));
}
//代理端
/*代理端查询问题列表*/
@Test
(
description
=
"代理端查询问题列表"
,
priority
=
6
)
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_QuesClueList
);
QuestionList
list
=
JsonUtil
.
parseResponseToBean
(
response
,
QuestionList
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesClueList
,
"助播端查询问题列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理端发起问题"
,
priority
=
7
)
public
void
代理端发起问题
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionIds"
,
questionIds
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AskQuestion
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AskQuestion
,
"代理端发起问题失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"助播端发送公告"
,
priority
=
8
)
public
void
助播端发送公告
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"content"
,
"上架公告"
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_LiveNotice
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_LiveNotice
,
"助播端发送公告失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"助播端公告查询"
,
priority
=
9
)
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_LiveNotice
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNotice
,
"助播端公告查询失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客端公告查询"
,
priority
=
10
)
public
void
访客端公告查询
()
{
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_ClueNotice
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNotice
,
"访客端公告查询失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人端公告查询"
,
priority
=
11
)
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_ClueNotice
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNotice
,
"代理人端公告查询失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
45ef1c14
...
@@ -183,6 +183,17 @@ public class BasicConfig {
...
@@ -183,6 +183,17 @@ public class BasicConfig {
public
static
final
String
MOBILE_SubmitAnswer
=
MOBILE_HOST
+
"/clue/choice/submitAnswer"
;
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_AnswerNum
=
MOBILE_HOST
+
"/clue/choice/answerNum"
;
//问题
public
static
final
String
MOBILE_QuestionAdd
=
MOBILE_HOST
+
"/conf/live/question/addQuestion"
;
public
static
final
String
MOBILE_QuestionList
=
MOBILE_HOST
+
"/conf/live/question/list"
;
public
static
final
String
MOBILE_QuestionSend
=
MOBILE_HOST
+
"/conf/live/question/send"
;
public
static
final
String
MOBILE_QuesClueList
=
MOBILE_HOST
+
"/clue/question/list"
;
public
static
final
String
MOBILE_AskQuestion
=
MOBILE_HOST
+
"/kjy/live/user/askQuestion"
;
public
static
final
String
MOBILE_LiveNotice
=
MOBILE_HOST
+
"/conf/live/info/notice"
;
public
static
final
String
MOBILE_ClueNotice
=
MOBILE_HOST
+
"/clue/info/notice"
;
//红包//
//红包//
public
static
final
String
MOBILE_AnchorRedList
=
MOBILE_HOST
+
"/conf/live/red/findRedList"
;
public
static
final
String
MOBILE_AnchorRedList
=
MOBILE_HOST
+
"/conf/live/red/findRedList"
;
public
static
final
String
MOBILE_FindRedList
=
MOBILE_HOST
+
"/clue/red/findRedList"
;
public
static
final
String
MOBILE_FindRedList
=
MOBILE_HOST
+
"/clue/red/findRedList"
;
...
...
src/test/liveTestNG.xml
View file @
45ef1c14
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<classes>
<classes>
<class
name=
"com.kjj.cases.live.anchor.OpenLive"
/>
<class
name=
"com.kjj.cases.live.anchor.OpenLive"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
...
@@ -89,6 +89,11 @@
...
@@ -89,6 +89,11 @@
<class
name=
"com.kjj.cases.live.choice.Choice"
/>
<class
name=
"com.kjj.cases.live.choice.Choice"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"问题"
>
<classes>
<class
name=
"com.kjj.cases.live.question.Question"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.anchor.CloseLive"
/>
<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