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
aaff3875
Commit
aaff3875
authored
Jun 01, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增猜数字红包
parent
32c5dced
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
20 deletions
+24
-20
SpokeList.java
src/test/java/com/kjj/bean/issue/SpokeList.java
+1
-1
Vo.java
src/test/java/com/kjj/bean/issue/Vo.java
+1
-1
Question.java
src/test/java/com/kjj/cases/live/question/Question.java
+15
-12
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+1
-0
JsonUtil.java
src/test/java/com/kjj/utils/JsonUtil.java
+6
-6
No files found.
src/test/java/com/kjj/bean/issue/SpokeList.java
View file @
aaff3875
...
...
@@ -6,6 +6,6 @@ import java.util.List;
@Data
public
class
SpokeList
{
private
Stri
ng
now
;
private
lo
ng
now
;
private
List
<
Vo
>
vo
;
}
src/test/java/com/kjj/bean/issue/Vo.java
View file @
aaff3875
...
...
@@ -6,6 +6,6 @@ import java.util.List;
@Data
public
class
Vo
{
private
Stri
ng
time
;
private
lo
ng
time
;
private
List
<
VoList
>
list
;
}
src/test/java/com/kjj/cases/live/question/Question.java
View file @
aaff3875
...
...
@@ -9,6 +9,7 @@ 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
;
...
...
@@ -89,7 +90,7 @@ public class Question implements AdminAuthorization {
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionId
s"
,
questionIds
);
params
.
put
(
"questionId
"
,
questionId
);
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"
);
...
...
@@ -118,11 +119,11 @@ public class Question implements AdminAuthorization {
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"questionId
s"
,
questionIds
);
params
.
put
(
"questionId
"
,
questionId
);
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
);
System
.
out
.
println
(
System
.
currentTimeMillis
()
+
","
+
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AskQuestion
,
"代理端发起问题失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -179,20 +180,22 @@ public class Question implements AdminAuthorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNotice
,
"代理人端公告查询失败"
,
response
.
body
().
asString
()));
}
public
Stri
ng
time
;
public
lo
ng
time
;
//***************评论***************//
//助播端历史评论200条
@Test
(
description
=
"助播端历史评论200条"
,
priority
=
12
)
public
void
助播端查询历史评论
()
{
ThreadSleepUtils
.
sleep
(
5000
);
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_SpokeAdmin
);
SpokeList
list
=
JsonUtil
.
parseResponseToBean1
(
response
,
SpokeList
.
class
);
time
=
list
.
getVo
().
get
(
0
).
getTime
();
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
time
=
list
.
getNow
();
System
.
out
.
println
(
time
);
System
.
out
.
println
(
list
);
System
.
out
.
println
(
System
.
currentTimeMillis
()
+
","
+
JSON
.
toJSONString
(
list
)
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"助播端评论查询失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -205,7 +208,7 @@ public class Question implements AdminAuthorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"time"
,
time
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_SpokeList
);
Spolist
list
=
JsonUtil
.
parseResponseToBean
1
(
response
,
Spolist
.
class
);
Spolist
list
=
JsonUtil
.
parseResponseToBean
TT
(
response
,
Spolist
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeList
,
"助播端评论区实时评论查询失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -218,7 +221,7 @@ public class Question implements AdminAuthorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_SpokeHistoryList
);
SpokeList
list
=
JsonUtil
.
parseResponseToBean
1
(
response
,
SpokeList
.
class
);
SpokeList
list
=
JsonUtil
.
parseResponseToBean
TT
(
response
,
SpokeList
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeHistoryList
,
"访客端评论区历史评论失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -245,7 +248,7 @@ public class Question implements AdminAuthorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"time"
,
time
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_SpokeList
);
Spolist
list
=
JsonUtil
.
parseResponseToBean
1
(
response
,
Spolist
.
class
);
Spolist
list
=
JsonUtil
.
parseResponseToBean
TT
(
response
,
Spolist
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeList
,
"直播间访客查询实时评论失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -258,7 +261,7 @@ public class Question implements AdminAuthorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_SpokeHistoryList
);
SpokeList
list
=
JsonUtil
.
parseResponseToBean
1
(
response
,
SpokeList
.
class
);
SpokeList
list
=
JsonUtil
.
parseResponseToBean
TT
(
response
,
SpokeList
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeHistoryList
,
"代理端评论区历史评论失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -285,7 +288,7 @@ public class Question implements AdminAuthorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"time"
,
time
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_SpokeList
);
Spolist
list
=
JsonUtil
.
parseResponseToBean
1
(
response
,
Spolist
.
class
);
Spolist
list
=
JsonUtil
.
parseResponseToBean
TT
(
response
,
Spolist
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeList
,
"直播间访客查询实时评论失败"
,
response
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/live/treasure/Treasure.java
View file @
aaff3875
...
...
@@ -1089,6 +1089,7 @@ public class Treasure implements AdminAuthorization {
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
infoParam
.
put
(
"treasureConfId"
,
ConfId
);
visitorAuth13
();
infoParam
.
put
(
"openTimes"
,
2
);
Response
response
=
network
.
getResponse
(
infoParam
,
BasicConfig
.
MANAGER_participateInfo
);
...
...
src/test/java/com/kjj/utils/JsonUtil.java
View file @
aaff3875
...
...
@@ -15,6 +15,12 @@ public class JsonUtil {
private
JsonUtil
()
{
}
public
static
<
T
>
T
parseResponseToBeanTT
(
Response
response
,
Class
<
T
>
tClass
)
{
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"d"
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
return
JSON
.
parseObject
(
str
,
tClass
);
}
/**
* 将响应转换成对象
* @param response
...
...
@@ -56,10 +62,4 @@ public class JsonUtil {
return
JSON
.
parseArray
(
str
,
tClass
);
}
public
static
<
T
>
T
parseResponseToBean1
(
Response
response
,
Class
<
T
>
tClass
){
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"date"
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
return
JSON
.
parseObject
(
str
,
tClass
);
}
}
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