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
6c66e503
Commit
6c66e503
authored
Sep 17, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gitfeature/20210917-gxh' into 'master'
Gitfeature/20210917 gxh See merge request test-group/kejiji!121
parents
5ca9cb95
41ee78f9
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
287 additions
and
124 deletions
+287
-124
VoList.java
src/test/java/com/kjj/bean/issue/VoList.java
+2
-1
Comment.java
src/test/java/com/kjj/cases/live/liveConfig/Comment.java
+271
-0
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+1
-1
spec.java
src/test/java/com/kjj/cases/live/liveConfig/spec.java
+0
-4
Question.java
src/test/java/com/kjj/cases/live/question/Question.java
+0
-113
TimeRed.java
src/test/java/com/kjj/cases/live/treasure/TimeRed.java
+1
-0
TreasureTime.java
src/test/java/com/kjj/cases/live/treasure/TreasureTime.java
+3
-2
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-2
liveTestNG.xml
src/test/liveTestNG.xml
+7
-1
No files found.
src/test/java/com/kjj/bean/issue/VoList.java
View file @
6c66e503
...
@@ -6,5 +6,6 @@ import lombok.Data;
...
@@ -6,5 +6,6 @@ import lombok.Data;
public
class
VoList
{
public
class
VoList
{
private
String
name
;
private
String
name
;
private
String
msg
;
private
String
msg
;
private
String
replyUserId
;
private
String
replyName
;
}
}
src/test/java/com/kjj/cases/live/liveConfig/Comment.java
0 → 100644
View file @
6c66e503
package
com
.
kjj
.
cases
.
live
.
liveConfig
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.issue.SpokeList
;
import
com.kjj.bean.issue.Spolist
;
import
com.kjj.bean.issue.VoList
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.IdMakeUtil
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
public
class
Comment
implements
Authorization
{
private
long
time
;
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
@Test
(
description
=
"发送评论库的评论"
,
priority
=
1
)
public
void
发送评论库的评论
()
{
ArrayList
<
String
>
commtens
=
new
ArrayList
<>();
commtens
.
add
(
"来啦来啦"
);
commtens
.
add
(
"我也要买"
);
commtens
.
add
(
"保险性价比真高!"
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"spokeList"
,
commtens
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_send
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_send
,
"评论库发送评论失败"
,
response
.
body
().
asString
()));
}
//访客端
@Test
(
description
=
"访客A发表评论"
,
priority
=
2
)
public
void
访客
A
发表评论
()
{
visitorAuth
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"希望能好运"
);
Params
.
put
(
"type"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"访客端发表评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客B回复访客A的评论"
,
priority
=
3
)
public
void
访客
B
回复访客
A
的评论
()
{
visitorAuth2
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"你一定会好运"
);
Params
.
put
(
"replyUserId"
,
IdMakeUtil
.
encodingId
(
107L
));
Params
.
put
(
"type"
,
"2"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"访客端回复评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客C回复访客B的回复"
,
priority
=
4
)
public
void
访客
C
回复访客
B
的回复
()
{
visitorAuth3
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"你也会好运的!"
);
Params
.
put
(
"replyUserId"
,
IdMakeUtil
.
encodingId
(
122L
));
Params
.
put
(
"type"
,
"2"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"访客端回复评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"禁言访客D"
,
priority
=
5
)
public
void
禁言访客
D
()
{
adminAuth
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"userId"
,
IdMakeUtil
.
encodingId
(
89L
));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MOBILE_bannedSpoke
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_bannedSpoke
,
"禁言用户D失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"被禁言访客D回复访客B的回复"
,
priority
=
6
)
public
void
被禁言访客
D
回复访客
B
的回复
()
{
visitorAuth4
();
sleep
(
3000
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"你们都看不见我"
);
Params
.
put
(
"replyUserId"
,
IdMakeUtil
.
encodingId
(
122L
));
Params
.
put
(
"type"
,
"2"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"访客端回复评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客C回复小马甲"
,
priority
=
7
)
public
void
访客
C
回复小马甲
()
{
visitorAuth3
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"猜猜我是谁"
);
Params
.
put
(
"type"
,
"2"
);
Params
.
put
(
"replyName"
,
"小马甲A"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"访客端回复评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取历史所有评论"
,
priority
=
8
)
public
void
访客
A
获取历史所有评论
()
{
visitorAuth
();
sleep
(
20000
);
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
);
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
List
<
VoList
>
voList
=
list
.
getVo
().
get
(
0
).
getList
();
time
=
list
.
getVo
().
get
(
0
).
getTime
();
Assert
.
assertNotNull
(
list
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"历史评论空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
size
(),
7
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"历史评论数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
3
).
getReplyName
(),
""
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"访客A发表评论有回复者昵称"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
4
).
getReplyName
(),
"朱志勇"
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"访客B回复评论的回复者昵称错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
5
).
getReplyName
(),
"阿茶吖"
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"访客C回复访客B的回复者昵称错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
6
).
getReplyName
(),
"小马甲A"
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"访客C回复小马甲的回复者昵称错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客A获取实时评论"
,
priority
=
9
)
public
void
访客
A
获取实时评论
()
{
visitorAuth
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"time"
,
time
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeList
);
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"访客端实时评论查询失败"
,
response
.
body
().
asString
()));
}
//代理人端
@Test
(
description
=
"代理人A发表评论"
,
priority
=
10
)
public
void
代理人
A
发表评论
()
{
agentAuth
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"你们都来了呀"
);
Params
.
put
(
"type"
,
"1"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"代理人端发表评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人A回复访客A的评论"
,
priority
=
11
)
public
void
代理人
A
回复访客
A
的评论
()
{
agentAuth
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"我看你们都在"
);
Params
.
put
(
"replyUserId"
,
IdMakeUtil
.
encodingId
(
107L
));
Params
.
put
(
"type"
,
"2"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"代理人端回复评论失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人B回复代理人A的回复"
,
priority
=
12
)
public
void
代理人
B
回复代理人
A
的回复
()
{
agentAuth1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"不等我一起走"
);
Params
.
put
(
"replyUserId"
,
IdMakeUtil
.
encodingId
(
826L
));
Params
.
put
(
"type"
,
"2"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"代理人端回复代理人失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人B回复小马甲"
,
priority
=
13
)
public
void
代理人
B
回复小马甲
()
{
agentAuth1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"msg"
,
"不知道你是谁"
);
Params
.
put
(
"type"
,
"2"
);
Params
.
put
(
"replyName"
,
"小马甲B"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
response
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeSend
,
"代理人端回复小马甲失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人A获取实时历史所有评论"
,
priority
=
14
)
public
void
代理人
A
获取实时历史所有评论
()
{
agentAuth1
();
sleep
(
20000
);
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
);
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
time
=
list
.
getNow
();
List
<
VoList
>
voList
=
list
.
getVo
().
get
(
0
).
getList
();
time
=
list
.
getVo
().
get
(
0
).
getTime
();
Assert
.
assertNotNull
(
list
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"历史评论空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
size
(),
11
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"历史评论数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
7
).
getReplyName
(),
""
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"代理人A发表评论有回复者昵称"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
8
).
getReplyName
(),
"朱志勇"
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"代理人A回复访客A评论的回复者昵称错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
voList
.
get
(
10
).
getReplyName
(),
"小马甲B"
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"代理人B回复代理人A评论的回复者昵称错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人A获取实时评论"
,
priority
=
15
)
public
void
代理人
A
获取实时评论
()
{
agentAuth1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Params
.
put
(
"time"
,
time
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MOBILE_SpokeList
);
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
Params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"代理人端实时评论查询失败"
,
response
.
body
().
asString
()));
}
//助播端
@Test
(
description
=
"助播端查询历史评论"
,
priority
=
16
)
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
);
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
time
=
list
.
getNow
();
Assert
.
assertEquals
(
list
.
getVo
().
get
(
0
).
getList
().
size
(),
11
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"助播端评论查询失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"助播端评论区实时评论查询"
,
priority
=
17
)
public
void
助播端评论区实时评论查询
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
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
.
parseResponseToBeanTT
(
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/liveConfig/SaveLive.java
View file @
6c66e503
...
@@ -50,7 +50,7 @@ public class SaveLive implements Authorization {
...
@@ -50,7 +50,7 @@ public class SaveLive implements Authorization {
Params
.
put
(
"mpShareUrl"
,
"https://streamimg.kjjcrm.com/kjy/image/20210201/182f3659e39b4ea6898af781cc6344a1.jpg"
);
Params
.
put
(
"mpShareUrl"
,
"https://streamimg.kjjcrm.com/kjy/image/20210201/182f3659e39b4ea6898af781cc6344a1.jpg"
);
Params
.
put
(
"title"
,
"直播测试"
+
RandomUtils
.
nextInt
(
1
,
100
));
Params
.
put
(
"title"
,
"直播测试"
+
RandomUtils
.
nextInt
(
1
,
100
));
Params
.
put
(
"mpShareTitle"
,
"自动化直播"
);
Params
.
put
(
"mpShareTitle"
,
"自动化直播"
);
Params
.
put
(
"companyId"
,
101
);
Params
.
put
(
"companyId"
,
101
);
//公司
Params
.
put
(
"agentInviteAuthType"
,
1
);
Params
.
put
(
"agentInviteAuthType"
,
1
);
Params
.
put
(
"agentInviteAuthLimitNum"
,
1
);
Params
.
put
(
"agentInviteAuthLimitNum"
,
1
);
long
noticeTime
=
DateUtils
.
addHours
(
new
Date
(),
2
).
getTime
();
long
noticeTime
=
DateUtils
.
addHours
(
new
Date
(),
2
).
getTime
();
...
...
src/test/java/com/kjj/cases/live/liveConfig/spec.java
View file @
6c66e503
...
@@ -55,8 +55,4 @@ public class spec implements Authorization {
...
@@ -55,8 +55,4 @@ public class spec implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_saveSpecifyAwardConf
,
"新增指定中奖付款码失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_saveSpecifyAwardConf
,
"新增指定中奖付款码失败"
,
response
.
body
().
asString
()));
}
}
}
}
src/test/java/com/kjj/cases/live/question/Question.java
View file @
6c66e503
...
@@ -180,117 +180,4 @@ public class Question implements Authorization {
...
@@ -180,117 +180,4 @@ public class Question implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNotice
,
"代理人端公告查询失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNotice
,
"代理人端公告查询失败"
,
response
.
body
().
asString
()));
}
}
public
long
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
);
System
.
out
.
println
(
response
.
body
().
asString
());
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
time
=
list
.
getNow
();
System
.
out
.
println
(
time
);
System
.
out
.
println
(
System
.
currentTimeMillis
()
+
","
+
JSON
.
toJSONString
(
list
));
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeAdmin
,
"助播端评论查询失败"
,
response
.
body
().
asString
()));
}
//助播端评论区实时评论查询
@Test
(
description
=
"助播端评论区实时评论查询"
,
priority
=
13
)
public
void
助播端评论区实时评论查询
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
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
.
parseResponseToBeanTT
(
response
,
Spolist
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeList
,
"助播端评论区实时评论查询失败"
,
response
.
body
().
asString
()));
}
//访客端评论区历史评论
@Test
(
description
=
"访客端评论区历史评论"
,
priority
=
14
)
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_SpokeHistoryList
);
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeHistoryList
,
"访客端评论区历史评论失败"
,
response
.
body
().
asString
()));
}
//直播间访客发送给评论
@Test
(
description
=
"直播间访客发送给评论"
,
priority
=
15
)
public
void
直播间访客发送给评论
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"msg"
,
"主播真有气质"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
);
Assert
.
assertNotNull
(
response
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeSend
,
"直播间访客发送给评论失败"
,
response
.
body
().
asString
()));
}
//直播间访客查询实时评论
@Test
(
description
=
"直播间访客查询实时评论"
,
priority
=
16
)
public
void
直播间访客查询实时评论
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
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
.
parseResponseToBeanTT
(
response
,
Spolist
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeList
,
"直播间访客查询实时评论失败"
,
response
.
body
().
asString
()));
}
//代理端评论区历史评论
@Test
(
description
=
"代理端评论区历史评论"
,
priority
=
17
)
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_SpokeHistoryList
);
SpokeList
list
=
JsonUtil
.
parseResponseToBeanTT
(
response
,
SpokeList
.
class
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeHistoryList
,
"代理端评论区历史评论失败"
,
response
.
body
().
asString
()));
}
//代理端访客发送给评论
@Test
(
description
=
"直播间代理端发送给评论"
,
priority
=
18
)
public
void
直播间代理端发送给评论
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"msg"
,
"主播真有气质"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_SpokeSend
);
System
.
out
.
println
(
response
);
Assert
.
assertNotNull
(
response
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_SpokeSend
,
"直播间访客发送给评论失败"
,
response
.
body
().
asString
()));
}
//直播间代理端查询实时评论
@Test
(
description
=
"直播间代理端查询实时评论"
,
priority
=
19
)
public
void
直播间代理端查询实时评论
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
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
.
parseResponseToBeanTT
(
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/TimeRed.java
View file @
6c66e503
...
@@ -457,6 +457,7 @@ public class TimeRed implements Authorization {
...
@@ -457,6 +457,7 @@ public class TimeRed implements Authorization {
Params
.
clear
();
Params
.
clear
();
Params
.
put
(
"redRoundId"
,
list
.
get
(
4
).
getId
());
Params
.
put
(
"redRoundId"
,
list
.
get
(
4
).
getId
());
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_deleteTask
);
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_deleteTask
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_deleteTask
,
"删除第5轮时长红包任务失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_deleteTask
,
"删除第5轮时长红包任务失败"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/live/treasure/TreasureTime.java
View file @
6c66e503
...
@@ -60,8 +60,8 @@ public class TreasureTime implements Authorization {
...
@@ -60,8 +60,8 @@ public class TreasureTime implements Authorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_finish
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_finish
,
"访客H获取宝箱参与情况失败"
,
response
.
body
().
asString
()));
}
}
...
@@ -73,6 +73,7 @@ public class TreasureTime implements Authorization {
...
@@ -73,6 +73,7 @@ public class TreasureTime implements Authorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_joinDetail1
);
System
.
out
.
println
(
response
.
body
().
asString
());
List
<
CondDetail
>
treasureList
=
JsonUtil
.
parseResponseToListBean
(
response
,
CondDetail
.
class
,
"condDetail"
);
List
<
CondDetail
>
treasureList
=
JsonUtil
.
parseResponseToListBean
(
response
,
CondDetail
.
class
,
"condDetail"
);
boolean
finishFlag
=
treasureList
.
get
(
0
).
isFinishFlag
();
boolean
finishFlag
=
treasureList
.
get
(
0
).
isFinishFlag
();
System
.
out
.
println
(
finishFlag
);
System
.
out
.
println
(
finishFlag
);
...
@@ -88,8 +89,8 @@ public class TreasureTime implements Authorization {
...
@@ -88,8 +89,8 @@ public class TreasureTime implements Authorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
params
.
put
(
"treasureConfId"
,
this
.
treasureConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_treasureOpen
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H开启第1个宝箱失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_treasureOpen
,
"访客H开启第1个宝箱失败"
,
response
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
6c66e503
...
@@ -520,8 +520,6 @@ public class BasicConfig {
...
@@ -520,8 +520,6 @@ public class BasicConfig {
public
static
final
String
MANAGER_CompanyVideoDown
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/down"
;
public
static
final
String
MANAGER_CompanyVideoDown
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/down"
;
public
static
final
String
MANAGER_CompanyVideoDelete
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/delete"
;
public
static
final
String
MANAGER_CompanyVideoDelete
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/delete"
;
//查询资料列表//
//查询资料列表//
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
public
static
final
String
MOBILE_ResourceOn
=
MOBILE_HOST
+
"/conf/live/push/on"
;
public
static
final
String
MOBILE_ResourceOn
=
MOBILE_HOST
+
"/conf/live/push/on"
;
...
@@ -576,6 +574,8 @@ public class BasicConfig {
...
@@ -576,6 +574,8 @@ public class BasicConfig {
public
static
final
String
MOBILE_SpokeList
=
MOBILE_SPOKEHOST
+
"/spoke/list"
;
public
static
final
String
MOBILE_SpokeList
=
MOBILE_SPOKEHOST
+
"/spoke/list"
;
public
static
final
String
MOBILE_SpokeHistoryList
=
MOBILE_SPOKEHOST
+
"/spoke/historyList"
;
public
static
final
String
MOBILE_SpokeHistoryList
=
MOBILE_SPOKEHOST
+
"/spoke/historyList"
;
public
static
final
String
MOBILE_SpokeSend
=
MOBILE_SPOKEHOST
+
"/spoke/send"
;
public
static
final
String
MOBILE_SpokeSend
=
MOBILE_SPOKEHOST
+
"/spoke/send"
;
public
static
final
String
MANAGER_send
=
MANAGER_HOST
+
"/kjy/manager/live/spoke/send"
;
public
static
final
String
MOBILE_bannedSpoke
=
MOBILE_HOST
+
"/kjy/admin/bannedSpoke"
;
//红包//
//红包//
public
static
final
String
MOBILE_AnchorRedList
=
MOBILE_HOST
+
"/conf/live/red/findRedList"
;
public
static
final
String
MOBILE_AnchorRedList
=
MOBILE_HOST
+
"/conf/live/red/findRedList"
;
...
...
src/test/liveTestNG.xml
View file @
6c66e503
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"配置秒杀轮次及秒杀预告"
>
<test
preserve-order=
"true"
name=
"配置秒杀轮次及秒杀预告"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.secondKill.ConfSecondKill"
/>
<class
name=
"com.kjj.cases.live.secondKill.ConfSecondKill"
/>
...
@@ -47,7 +48,6 @@
...
@@ -47,7 +48,6 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.agent.Agent"
/>
<class
name=
"com.kjj.cases.live.agent.Agent"
/>
...
@@ -110,6 +110,12 @@
...
@@ -110,6 +110,12 @@
<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=
"评论及回复"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.Comment"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播中编辑资料"
>
<test
preserve-order=
"true"
name=
"直播中编辑资料"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.EvaluationConf"
/>
<class
name=
"com.kjj.cases.live.liveConfig.EvaluationConf"
/>
...
...
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