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
15b684e2
Commit
15b684e2
authored
Apr 12, 2021
by
别湘灵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理人首页
parent
d454d407
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
179 additions
and
158 deletions
+179
-158
RedLuckResult.java
src/test/java/com/kjj/bean/RedLuckResult.java
+1
-1
RedOpendate.java
src/test/java/com/kjj/bean/RedOpendate.java
+11
-0
LiveVistorRed.java
src/test/java/com/kjj/cases/live/LiveVistorRed.java
+165
-156
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-1
No files found.
src/test/java/com/kjj/bean/RedLuckResult.java
View file @
15b684e2
...
@@ -20,7 +20,7 @@ public class RedLuckResult {
...
@@ -20,7 +20,7 @@ public class RedLuckResult {
}
}
private
String
hasNext
;
...
...
src/test/java/com/kjj/bean/RedOpendate.java
0 → 100644
View file @
15b684e2
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
RedOpendate
{
private
int
state
;
private
String
amount
;
private
String
luck
;
private
String
code
;
}
src/test/java/com/kjj/cases/live/LiveVistorRed.java
View file @
15b684e2
...
@@ -8,7 +8,6 @@ import com.kjj.utils.JsonUtil;
...
@@ -8,7 +8,6 @@ import com.kjj.utils.JsonUtil;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -18,13 +17,7 @@ import java.util.Map;
...
@@ -18,13 +17,7 @@ import java.util.Map;
public
class
LiveVistorRed
implements
AdminAuthorization
{
public
class
LiveVistorRed
implements
AdminAuthorization
{
public
String
confId_Red
;
public
String
confId_Red
;
public
String
red_sharesign
;
@BeforeClass
public
void
setUp
()
{
adminAuth
();
}
private
AnchorRedList
.
RedList
getRed
(
List
<
AnchorRedList
.
RedList
>
lists
){
private
AnchorRedList
.
RedList
getRed
(
List
<
AnchorRedList
.
RedList
>
lists
){
for
(
AnchorRedList
.
RedList
red
:
lists
)
{
for
(
AnchorRedList
.
RedList
red
:
lists
)
{
if
(
red
.
getRedStatus
()==
1
){
if
(
red
.
getRedStatus
()==
1
){
...
@@ -34,68 +27,137 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -34,68 +27,137 @@ public class LiveVistorRed implements AdminAuthorization{
return
null
;
return
null
;
}
}
/*主播端添加红包*/
@Test
(
description
=
"主播端添加红包"
,
priority
=
1
)
public
void
主播端添加红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"luck"
,
"0"
);
params
.
put
(
"general"
,
"0"
);
params
.
put
(
"totalAmount"
,
"200"
);
params
.
put
(
"showAmount"
,
"200"
);
params
.
put
(
"luckAmount"
,
"80"
);
params
.
put
(
"luckNum"
,
"1"
);
params
.
put
(
"luckHelpNum"
,
"1"
);
params
.
put
(
"generalNum"
,
"4"
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
""
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedSaveOrUpdate
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedSaveOrUpdate
,
"主播端添加红包失败"
,
response
.
body
().
asString
()));
}
/*主播端红包轮次查询*/
/*主播端红包轮次查询*/
@Test
(
description
=
"主播端红包轮次查询"
,
priority
=
1
)
@Test
(
description
=
"主播端红包轮次查询"
,
priority
=
2
)
public
void
主播端红包轮次查询
()
public
void
主播端红包轮次查询
()
{
{
adminAuth
();
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_AnchorRedList
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AnchorRedList
);
AnchorRedList
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
AnchorRedList
.
class
);
AnchorRedList
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
AnchorRedList
.
class
);
AnchorRedList
.
RedList
notPublishRed
=
getRed
(
Beans
.
getRedList
());
AnchorRedList
.
RedList
notPublishRed
=
getRed
(
Beans
.
getRedList
());
confId_Red
=
notPublishRed
.
getConfId
();
confId_Red
=
notPublishRed
.
getConfId
();
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AnchorRedList
,
"查询主播端红包轮次失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AnchorRedList
,
"查询主播端红包轮次失败"
,
response
.
body
().
asString
()));
}
}
/*主播端上架普通红包*/
/*主播端上架普通红包*/
@Test
(
description
=
"主播端上架普通红包"
,
priority
=
2
)
@Test
(
description
=
"主播端上架普通红包"
,
priority
=
3
)
public
void
主播端上架手气王红包
()
public
void
主播端上架手气王红包
()
{
{
adminAuth
();
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_Grounding
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_Grounding
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"
data
"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"
success
"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Grounding
,
"上架普通红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Grounding
,
"上架普通红包失败"
,
response
.
body
().
asString
()));
}
}
/*
主播端发放普通红包
*/
/*
访客端-获取直播间参数-getShareSign
*/
@Test
(
description
=
"
主播端发放普通红包"
,
priority
=
3
)
@Test
(
description
=
"
获取直播间参数"
,
priority
=
4
)
public
void
主播端发放普通红包
()
public
void
获取直播间参数
()
{
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareType"
,
2
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedGetShareSign
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
red_sharesign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
red_sharesign
);
Assert
.
assertNotNull
(
red_sharesign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"获取直播间参数失败"
,
response
.
body
().
asString
()));
}
/*访客端助力者-助力查询*/
@Test
(
description
=
"助力者助力查询"
,
priority
=
5
)
public
void
助力者助力查询
()
{
visitorAuth2
();
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
(
"
confId"
,
confId_Red
);
params
.
put
(
"
confId"
,
confId_Red
);
params
.
put
(
"
shareSign"
,
red_sharesign
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_Red
Start
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_Red
HelpQuery
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
RedHelpQuery
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedHelpQuery
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Red
Start
,
"上架普通红包
失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Red
HelpQuery
,
"帮好友助力
失败"
,
response
.
body
().
asString
()));
}
}
/*
开红包
*/
/*
访客端助力者-帮好友助力1
*/
@Test
(
description
=
"
开红包"
,
priority
=
4
)
@Test
(
description
=
"
帮好友助力"
,
priority
=
6
)
public
void
开红包
()
public
void
帮好友助力
()
{
{
visitorAuth2
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareSign"
,
red_sharesign
);
params
.
put
(
"confRedPacketId"
,
confId_Red
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
}
ThreadSleepUtils
.
sleep
(
60000
);
/*访客端助力者-帮好友助力2*/
@Test
(
description
=
"帮好友助力2"
,
priority
=
7
)
public
void
帮好友助力
2
()
{
visitorAuth
();
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"shareSign"
,
red_sharesign
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedOpen
);
params
.
put
(
"confRedPacketId"
,
confId_Red
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedOpen
,
"开红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
}
/*主播端发放普通红包*/
@Test
(
description
=
"主播端发放普通红包"
,
priority
=
8
)
public
void
主播端发放普通红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
confId_Red
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedStart
,
"上架普通红包失败"
,
response
.
body
().
asString
()));
}
}
/*查询红包开始时间,倒计时*/
/*查询红包开始时间,倒计时*/
@Test
(
description
=
"查询红包开始时间"
,
priority
=
5
)
@Test
(
description
=
"查询红包开始时间"
,
priority
=
9
)
public
void
查询红包开始时间
()
public
void
查询红包开始时间
()
{
{
adminAuth
();
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
...
@@ -105,47 +167,55 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -105,47 +167,55 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedGetSimple
,
"查询主播端发放红包开始时间失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedGetSimple
,
"查询主播端发放红包开始时间失败"
,
response
.
body
().
asString
()));
}
}
/*
主播端获取剩余红包金额
*/
/*
被助力者-红包助力详情信息查询
*/
@Test
(
description
=
"
获取剩余红包金额"
,
priority
=
6
)
@Test
(
description
=
"
红包详情助力信息"
,
priority
=
10
)
public
void
获取剩余红包金额
()
public
void
红包详情助力信息
()
{
{
visitorAuth
();
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
(
"confId"
,
confId_Red
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetSurplusAmount
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedHelpDetail
);
RedHepDetail
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedHepDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_
GetSurplusAmount
,
"查询剩余红包
失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_
RedHelpDetail
,
"查询红包状态
失败"
,
response
.
body
().
asString
()));
}
}
/*
主播端添加
红包*/
/*
开
红包*/
@Test
(
description
=
"
主播端添加红包"
,
priority
=
7
)
@Test
(
description
=
"
开红包"
,
priority
=
11
)
public
void
主播端添加
红包
()
public
void
开
红包
()
{
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
60000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"luck"
,
"0"
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"general"
,
"0"
);
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"totalAmount"
,
"200"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedOpen
);
params
.
put
(
"showAmount"
,
"200"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
params
.
put
(
"luckAmount"
,
"80"
);
params
.
put
(
"luckNum"
,
"1"
);
params
.
put
(
"luckHelpNum"
,
"1"
);
params
.
put
(
"generalNum"
,
"4"
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
""
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedSaveOrUpdate
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Red
SaveOrUpdate
,
"主播端添加
红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Red
Open
,
"开
红包失败"
,
response
.
body
().
asString
()));
}
}
/*领红包轮询结果*/
@Test
(
description
=
"领红包轮询结果"
,
priority
=
12
)
public
void
领红包轮询结果
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
confId_Red
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_OpenState
);
RedOpendate
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedOpendate
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_OpenState
,
"领红包轮询结果查询失败"
,
response
.
body
().
asString
()));
}
/*访客端领取红包*/
/*查询访客端红包状态*/
/*查询访客端红包状态*/
@Test
(
description
=
"红包状态查询"
,
priority
=
8
)
@Test
(
description
=
"红包状态查询"
,
priority
=
13
)
public
void
红包状态查询列表
()
public
void
红包状态查询列表
()
{
{
visitorAuth
();
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_FindRedList
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_FindRedList
);
...
@@ -154,9 +224,10 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -154,9 +224,10 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_FindRedList
,
"查询红包状态失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_FindRedList
,
"查询红包状态失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"红包个数"
,
priority
=
9
)
@Test
(
description
=
"红包个数"
,
priority
=
14
)
public
void
红包个数
()
public
void
红包个数
()
{
{
visitorAuth
();
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
...
@@ -167,9 +238,10 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -167,9 +238,10 @@ public class LiveVistorRed implements AdminAuthorization{
}
}
/*红包简介详情*/
/*红包简介详情*/
@Test
(
description
=
"红包简介详情"
,
priority
=
1
0
)
@Test
(
description
=
"红包简介详情"
,
priority
=
1
5
)
public
void
红包查询列表
()
public
void
红包查询列表
()
{
{
visitorAuth
();
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
...
@@ -179,23 +251,13 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -179,23 +251,13 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedFindSimpleDetail
,
"查询红包列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedFindSimpleDetail
,
"查询红包列表失败"
,
response
.
body
().
asString
()));
}
}
/*红包详情助力信息*/
@Test
(
description
=
"红包详情助力信息"
,
priority
=
11
)
public
void
红包详情助力信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
confId_Red
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedHelpDetail
);
RedHepDetail
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedHepDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedHelpDetail
,
"查询红包状态失败"
,
response
.
body
().
asString
()));
}
/*获取红包小程序分享信息*/
/*获取红包小程序分享信息*/
@Test
(
description
=
"获取红包小程序分享信息"
,
priority
=
1
2
)
@Test
(
description
=
"获取红包小程序分享信息"
,
priority
=
1
6
)
public
void
获取红包小程序分享信息
()
public
void
获取红包小程序分享信息
()
{
{
visitorAuth
();
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_GetRedMpShare
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetRedMpShare
);
...
@@ -204,93 +266,26 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -204,93 +266,26 @@ public class LiveVistorRed implements AdminAuthorization{
}
}
/*领红包结果*/
@Test
(
description
=
"领红包结果"
,
priority
=
17
)
public
void
领红包结果
()
/*查询红包领取列表*/
@Test
(
description
=
"查询红包领取列表"
,
priority
=
13
)
public
void
查询红包领取列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedResultList
);
RedLuckResult
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedLuckResult
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedResultList
,
"查询红包领取列表失败"
,
response
.
body
().
asString
()));
}
/*获取直播间参数-getShareSign*/
@Test
(
description
=
"获取直播间参数"
,
priority
=
14
)
public
void
获取直播间参数
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"shareType"
,
2
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedGetShareSign
);
GetShareSign
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
GetShareSign
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedGetShareSign
,
"获取直播间参数失败"
,
response
.
body
().
asString
()));
}
/*帮好友助力*/
@Test
(
description
=
"帮好友助力"
,
priority
=
15
)
public
void
帮好友助力
()
{
{
visitorAuth
();
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
()));
params
.
put
(
"shareSign"
,
"2fk2w3aVT6eyfgwFQZJEAqTFpYerrB8SZ2CuWvbmWTX6W42em1tNHR664Gzo9wU5fhSZyHYtLrFcWYrZURc8CU49UAw"
);
params
.
put
(
"confRedPacketId"
,
"Kj21NDE2NTU"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
}
/*助力查询*/
@Test
(
description
=
"助力查询"
,
priority
=
16
)
public
void
助力查询
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"shareSign"
,
"2fk2w3aVT6eyfgwFQZJEAqTFpYerrB8SZ2CuWvbmWTZWET36mtkmgvaiyvG3hx95Zn1aoQ1KTKB5HYDKJVc9mbzmHL7"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedState
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedHelpQuery
);
RedState
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedState
.
class
);
RedHelpQuery
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedHelpQuery
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedHelpQuery
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedState
,
"领红包结果查询失败"
,
response
.
body
().
asString
()));
}
/* 助力列表*/
@Test
(
description
=
"助力列表"
,
priority
=
17
)
public
void
助力列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
"Kj22NTM5MQ"
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedHelpInfo
);
RedHelpInfo
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedHelpInfo
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedHelpInfo
,
"查询助力列表失败"
,
response
.
body
().
asString
()));
}
}
/*手气王公示*/
/*手气王公示*/
@Test
(
description
=
"手气王公示"
,
priority
=
18
)
@Test
(
description
=
"手气王公示"
,
priority
=
18
)
public
void
手气王公示
()
public
void
手气王公示
()
{
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
15000
);
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
...
@@ -300,21 +295,35 @@ public class LiveVistorRed implements AdminAuthorization{
...
@@ -300,21 +295,35 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckResult
,
"查询手气王公示失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckResult
,
"查询手气王公示失败"
,
response
.
body
().
asString
()));
}
}
/*查询红包领取列表*/
@Test
(
description
=
"查询红包领取列表"
,
priority
=
19
)
public
void
查询红包领取列表
()
/*领红包结果*/
@Test
(
description
=
"领红包结果"
,
priority
=
19
)
public
void
领红包结果
()
{
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
10000
);
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
()));
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"confId"
,
confId_Red
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedState
);
params
.
put
(
"pageIndex"
,
1
);
RedState
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedState
.
class
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedResultList
);
RedLuckResult
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedLuckResult
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedResultList
,
"查询红包领取列表失败"
,
response
.
body
().
asString
()));
}
/*主播端获取剩余红包金额*/
@Test
(
description
=
"获取剩余红包金额"
,
priority
=
20
)
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_GetSurplusAmount
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_
RedState
,
"领红包结果查询
失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_
GetSurplusAmount
,
"查询剩余红包
失败"
,
response
.
body
().
asString
()));
}
}
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
15b684e2
...
@@ -3,7 +3,7 @@ package com.kjj.config;
...
@@ -3,7 +3,7 @@ package com.kjj.config;
public
class
BasicConfig
{
public
class
BasicConfig
{
public
static
int
apiCount
;
//接口数量统计
public
static
int
apiCount
;
//接口数量统计
// 是否开启钉钉机器人推送
// 是否开启钉钉机器人推送
public
static
final
boolean
isPushReport
=
tru
e
;
//true
public
static
final
boolean
isPushReport
=
fals
e
;
//true
// 代理人微信昵称
// 代理人微信昵称
public
static
final
String
WECHAT_NAME
=
"嘿保险"
;
//true
public
static
final
String
WECHAT_NAME
=
"嘿保险"
;
//true
// 代理人的openid(固定)
// 代理人的openid(固定)
...
@@ -153,6 +153,7 @@ public class BasicConfig {
...
@@ -153,6 +153,7 @@ public class BasicConfig {
public
static
final
String
MOBILE_RedLuckResult
=
MOBILE_HOST
+
"/clue/red/luckResultList"
;
public
static
final
String
MOBILE_RedLuckResult
=
MOBILE_HOST
+
"/clue/red/luckResultList"
;
public
static
final
String
MOBILE_RedLuckHelp
=
MOBILE_HOST
+
"/kjy/live/user/red/help"
;
public
static
final
String
MOBILE_RedLuckHelp
=
MOBILE_HOST
+
"/kjy/live/user/red/help"
;
public
static
final
String
MOBILE_QuesRewardList
=
MOBILE_HOST
+
"/conf/live/ques/reward/list"
;
public
static
final
String
MOBILE_QuesRewardList
=
MOBILE_HOST
+
"/conf/live/ques/reward/list"
;
public
static
final
String
MOBILE_OpenState
=
MOBILE_HOST
+
"/clue/red/open/state"
;
...
...
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