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
6691008b
Commit
6691008b
authored
Apr 13, 2021
by
别湘灵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理人首页
parent
5d0aa5da
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
335 additions
and
135 deletions
+335
-135
RedFindDetail.java
src/test/java/com/kjj/bean/RedFindDetail.java
+16
-0
RedHelpQuery.java
src/test/java/com/kjj/bean/RedHelpQuery.java
+5
-5
RedHepDetail.java
src/test/java/com/kjj/bean/RedHepDetail.java
+3
-1
RedLuckResult.java
src/test/java/com/kjj/bean/RedLuckResult.java
+2
-3
RedNum.java
src/test/java/com/kjj/bean/RedNum.java
+3
-3
RedOpendate.java
src/test/java/com/kjj/bean/RedOpendate.java
+1
-1
RedSultList.java
src/test/java/com/kjj/bean/RedSultList.java
+21
-0
LiveVistorRed.java
src/test/java/com/kjj/cases/live/LiveVistorRed.java
+281
-120
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-1
liveTestNG.xml
src/test/liveTestNG.xml
+1
-1
No files found.
src/test/java/com/kjj/bean/RedFindDetail.java
0 → 100644
View file @
6691008b
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
RedFindDetail
{
private
String
confId
;
private
String
totalAmount
;
private
String
totalNum
;
private
String
luckAmount
;
private
String
luckNum
;
private
String
luckHelpNum
;
private
String
generalNum
;
private
String
showAmount
;
private
String
afterMin
;
}
src/test/java/com/kjj/bean/RedHelpQuery.java
View file @
6691008b
...
...
@@ -5,12 +5,12 @@ import lombok.Data;
@Data
public
class
RedHelpQuery
{
private
String
avatar
;
private
String
end
;
private
String
hasConfLuck
;
private
String
help
;
private
String
helpShareUser
;
private
boolean
end
;
private
boolean
hasConfLuck
;
private
boolean
help
;
private
boolean
helpShareUser
;
private
String
nickname
;
private
String
selfShare
;
private
boolean
selfShare
;
}
...
...
src/test/java/com/kjj/bean/RedHepDetail.java
View file @
6691008b
...
...
@@ -2,8 +2,10 @@ package com.kjj.bean;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
RedHepDetail
{
private
String
helpAvatarList
;
private
List
helpAvatarList
;
private
int
myHelpNum
;
}
src/test/java/com/kjj/bean/RedLuckResult.java
View file @
6691008b
...
...
@@ -16,11 +16,10 @@ public class RedLuckResult {
{
private
String
avatar
;
private
String
nickname
;
private
String
receivedAmount
;
private
int
receivedAmount
;
}
private
String
hasNext
;
private
boolean
hasNext
;
...
...
src/test/java/com/kjj/bean/RedNum.java
View file @
6691008b
...
...
@@ -5,10 +5,10 @@ import lombok.Data;
@Data
public
class
RedNum
{
private
String
totalAmount
;
private
int
totalAmount
;
private
String
luckAmount
;
private
int
luckAmount
;
private
String
luckNum
;
private
int
luckNum
;
}
src/test/java/com/kjj/bean/RedOpendate.java
View file @
6691008b
...
...
@@ -6,6 +6,6 @@ import lombok.Data;
public
class
RedOpendate
{
private
int
state
;
private
String
amount
;
private
String
luck
;
private
boolean
luck
;
private
String
code
;
}
src/test/java/com/kjj/bean/RedSultList.java
0 → 100644
View file @
6691008b
package
com
.
kjj
.
bean
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
RedSultList
{
private
List
<
resulList
>
list
;
@Data
public
static
class
resulList
{
private
String
avatar
;
private
String
nickname
;
private
int
receivedAmount
;
private
boolean
receivedLuck
;
}
private
boolean
hasNext
;
}
src/test/java/com/kjj/cases/live/LiveVistorRed.java
View file @
6691008b
...
...
@@ -17,6 +17,7 @@ import java.util.Map;
public
class
LiveVistorRed
implements
AdminAuthorization
{
public
String
confId_Red
;
public
String
visitor_red
;
public
String
red_sharesign
;
private
AnchorRedList
.
RedList
getRed
(
List
<
AnchorRedList
.
RedList
>
lists
){
for
(
AnchorRedList
.
RedList
red
:
lists
)
{
...
...
@@ -27,10 +28,11 @@ public class LiveVistorRed implements AdminAuthorization{
return
null
;
}
/*主播端添加红包*/
@Test
(
description
=
"主播端添加
红包"
,
priority
=
1
)
/*主播端添加
手气王
红包*/
@Test
(
description
=
"主播端添加
手气王红包"
,
priority
=
1
)
public
void
主播端添加红包
()
{
ThreadSleepUtils
.
sleep
(
10000
);
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"luck"
,
"0"
);
...
...
@@ -46,11 +48,33 @@ public class LiveVistorRed implements AdminAuthorization{
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
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedSaveOrUpdate
,
"主播端添加手气王红包失败"
,
response
.
body
().
asString
()));
}
/*主播端添加普通红包*/
@Test
(
description
=
"主播端添加普通红包"
,
priority
=
2
)
public
void
主播端添加普通红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"luck"
,
"0"
);
params
.
put
(
"luckAmount"
,
"0"
);
params
.
put
(
"luckNum"
,
"0"
);
params
.
put
(
"luckHelpNum"
,
"0"
);
params
.
put
(
"general"
,
"0"
);
params
.
put
(
"totalAmount"
,
"100"
);
params
.
put
(
"showAmount"
,
"100"
);
params
.
put
(
"generalNum"
,
"3"
);
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
=
2
)
@Test
(
description
=
"主播端红包轮次查询"
,
priority
=
3
)
public
void
主播端红包轮次查询
()
{
adminAuth
();
...
...
@@ -64,14 +88,211 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AnchorRedList
,
"查询主播端红包轮次失败"
,
response
.
body
().
asString
()));
}
//主播端单个红包配置详情查询
@Test
(
description
=
"主播端单个红包配置详情查询"
,
priority
=
4
)
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
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedFindDetail
);
RedFindDetail
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedFindDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedFindDetail
,
"查询主播端单个红包配置详情失败"
,
response
.
body
().
asString
()));
}
/*主播端上架普通红包*/
@Test
(
description
=
"主播端上架普通红包"
,
priority
=
3
)
public
void
主播端上架手气王红包
()
@Test
(
description
=
"主播端上架普通红包"
,
priority
=
5
)
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_Grounding
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Grounding
,
"上架普通红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放普通红包*/
@Test
(
description
=
"主播端发放普通红包"
,
priority
=
6
)
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
=
7
)
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
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedGetSimple
);
RedGetSimple
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedGetSimple
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedGetSimple
,
"查询主播端发放红包开始时间失败"
,
response
.
body
().
asString
()));
}
/*查询访客端红包状态*/
@Test
(
description
=
"红包状态查询"
,
priority
=
8
)
public
void
红包状态查询列表
()
{
ThreadSleepUtils
.
sleep
(
2000
);
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_FindRedList
);
List
<
RedOrdinary
>
Beans
=
JsonUtil
.
parseResponseToListBean
(
response
,
RedOrdinary
.
class
);
RedOrdinary
one
=
Beans
.
get
(
0
);
System
.
out
.
println
(
one
.
getConfId
());
visitor_red
=
one
.
getConfId
();
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_FindRedList
,
"查询红包状态失败"
,
response
.
body
().
asString
()));
}
/*开普通红包*/
@Test
(
description
=
"开红包"
,
priority
=
9
)
public
void
开红包
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
60000
);
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_RedOpen
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedOpen
,
"开红包失败"
,
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
(
"confId"
,
confId_Red
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_RedOpen
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedOpen
,
"开红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"红包个数"
,
priority
=
11
)
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_RedNum
);
RedNum
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedNum
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedNum
,
"查询红包个数失败"
,
response
.
body
().
asString
()));
}
/*领普通红包轮询结果*/
@Test
(
description
=
"领普通红包轮询结果"
,
priority
=
12
)
public
void
领普通红包轮询结果
()
{
ThreadSleepUtils
.
sleep
(
10000
);
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
=
13
)
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_RedState
);
RedState
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedState
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedState
,
"领红包结果查询失败"
,
response
.
body
().
asString
()));
}
/*查询红包领取结果列表-看看大家手气*/
@Test
(
description
=
"查询红包领取结果列表"
,
priority
=
14
)
public
void
查询红包领取结果列表
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
20000
);
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
()));
}
//************手气王红包************//
//************手气王红包************//
//************手气王红包************//
/*再次查询主播端红包轮次*/
@Test
(
description
=
"再次查询主播端红包轮次"
,
priority
=
15
)
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_AnchorRedList
);
AnchorRedList
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
AnchorRedList
.
class
);
AnchorRedList
.
RedList
notPublishRed
=
getRed
(
Beans
.
getRedList
());
confId_Red
=
notPublishRed
.
getConfId
();
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AnchorRedList
,
"查询主播端红包轮次失败"
,
response
.
body
().
asString
()));
}
//主播端单个手气王红包配置详情查询
@Test
(
description
=
"主播端单个红包配置详情查询"
,
priority
=
16
)
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
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedFindDetail
);
RedFindDetail
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedFindDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedFindDetail
,
"查询主播端单个手气王红包配置详情失败"
,
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
(
"confId"
,
confId_Red
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_Grounding
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
...
...
@@ -79,12 +300,12 @@ public class LiveVistorRed implements AdminAuthorization{
}
/*访客端-获取直播间参数-getShareSign*/
@Test
(
description
=
"获取直播间参数"
,
priority
=
4
)
@Test
(
description
=
"获取直播间参数"
,
priority
=
18
)
public
void
获取直播间参数
()
{
visitorAuth
();
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
(
"shareType"
,
2
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedGetShareSign
);
HashMap
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
...
...
@@ -95,7 +316,7 @@ public class LiveVistorRed implements AdminAuthorization{
}
/*访客端助力者-助力查询*/
@Test
(
description
=
"助力者助力查询"
,
priority
=
5
)
@Test
(
description
=
"助力者助力查询"
,
priority
=
19
)
public
void
助力者助力查询
()
{
visitorAuth2
();
...
...
@@ -108,8 +329,8 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedHelpQuery
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
}
/*访客端
助力者-帮好友助力1
*/
@Test
(
description
=
"帮好友助力"
,
priority
=
6
)
/*访客端
-帮好友助力
*/
@Test
(
description
=
"帮好友助力"
,
priority
=
20
)
public
void
帮好友助力
()
{
visitorAuth2
();
...
...
@@ -123,25 +344,24 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckHelp
,
"帮好友助力失败"
,
response
.
body
().
asString
()));
}
/*
访客端助力者-帮好友助力2
*/
@Test
(
description
=
"
帮好友助力2"
,
priority
=
7
)
public
void
帮好友助力
2
()
/*
被助力者-手气王助力详情信息查询
*/
@Test
(
description
=
"
红包详情助力信息"
,
priority
=
21
)
public
void
红包详情助力信息
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_Red
);
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"
);
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_Red
LuckHelp
,
"帮好友
助力失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Red
HelpDetail
,
"查询手气王
助力失败"
,
response
.
body
().
asString
()));
}
/*主播端发放
普通
红包*/
@Test
(
description
=
"主播端发放
普通红包"
,
priority
=
8
)
public
void
主播端发放
普通
红包
()
/*主播端发放
手气王
红包*/
@Test
(
description
=
"主播端发放
手气王红包"
,
priority
=
22
)
public
void
主播端发放
手气王
红包
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -150,43 +370,28 @@ public class LiveVistorRed implements AdminAuthorization{
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
=
9
)
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
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedGetSimple
);
RedGetSimple
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedGetSimple
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedGetSimple
,
"查询主播端发放红包开始时间失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedStart
,
"发放普通红包失败"
,
response
.
body
().
asString
()));
}
/*
被助力者-红包助力详情信息查询
*/
@Test
(
description
=
"
红包详情助力信息"
,
priority
=
10
)
public
void
红包详情助力信息
()
/*
再次查询访客端红包状态
*/
@Test
(
description
=
"
再次查询红包状态"
,
priority
=
23
)
public
void
再次查询红包状态列表
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_Red
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
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
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_
FindRedList
);
List
<
RedOrdinary
>
Beans
=
JsonUtil
.
parseResponseToListBean
(
response
,
RedOrdinary
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_FindRedList
,
"查询红包状态失败"
,
response
.
body
().
asString
()));
}
/*开红包*/
@Test
(
description
=
"开
红包"
,
priority
=
11
)
public
void
开红包
()
/*开
手气王
红包*/
@Test
(
description
=
"开
手气王红包"
,
priority
=
24
)
public
void
开
手气王
红包
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
6
0
000
);
ThreadSleepUtils
.
sleep
(
6
3
000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
confId_Red
);
...
...
@@ -196,24 +401,9 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedOpen
,
"开红包失败"
,
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
=
13
)
public
void
红包状态查询列表
()
/*查询访客端手气王红包状态*/
@Test
(
description
=
"手气王红包状态查询"
,
priority
=
25
)
public
void
手气王红包状态查询列表
()
{
visitorAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -224,64 +414,53 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_FindRedList
,
"查询红包状态失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"红包个数"
,
priority
=
14
)
public
void
红包个数
()
/*领手气王红包结果查询*/
@Test
(
description
=
"领手气王红包结果查询"
,
priority
=
26
)
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_Red
Num
);
Red
Num
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedNum
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedNum
,
"查询红包个数
失败"
,
response
.
body
().
asString
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Red
State
);
Red
State
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedState
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedState
,
"领红包结果查询
失败"
,
response
.
body
().
asString
()));
}
/*
红包简介详情
*/
@Test
(
description
=
"
红包简介详情"
,
priority
=
15
)
public
void
红包查询
列表
()
/*
手气王红包领取结果列表-看看大家手气
*/
@Test
(
description
=
"
查询手气王红包领取结果列表"
,
priority
=
27
)
public
void
查询手气王红包领取结果
列表
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
15000
);
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_RedFindSimpleDetail
);
RedSimpleDetail
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedSimpleDetail
.
class
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RedResultList
);
RedSultList
Beans
=
JsonUtil
.
parseResponseToBean
(
response
,
RedSultList
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
Beans
));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedFindSimpleDetail
,
"查询红包列表失败"
,
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
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_GetRedMpShare
);
System
.
out
.
println
(
JSON
.
toJSONString
(
response
));
Assert
.
assertNotNull
(
response
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GetRedMpShare
,
"查询红包红包小程序分享信息"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedResultList
,
"查询红包领取结果列表"
,
response
.
body
().
asString
()));
}
/*领红包结果*/
@Test
(
description
=
"领红包结果"
,
priority
=
17
)
public
void
领红包结果
()
/*领红包轮询结果*/
@Test
(
description
=
"领手气王红包轮询结果"
,
priority
=
28
)
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_
Red
State
);
Red
State
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedSt
ate
.
class
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_
Open
State
);
Red
Opendate
data
=
JsonUtil
.
parseResponseToBean
(
response
,
RedOpend
ate
.
class
);
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_
OpenState
,
"领手气王红包轮询
结果查询失败"
,
response
.
body
().
asString
()));
}
/*手气王公示*/
@Test
(
description
=
"手气王公示"
,
priority
=
18
)
@Test
(
description
=
"手气王公示"
,
priority
=
29
)
public
void
手气王公示
()
{
visitorAuth
();
...
...
@@ -295,26 +474,8 @@ public class LiveVistorRed implements AdminAuthorization{
Assert
.
assertNotNull
(
Beans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RedLuckResult
,
"查询手气王公示失败"
,
response
.
body
().
asString
()));
}
/*查询红包领取列表*/
@Test
(
description
=
"查询红包领取列表"
,
priority
=
19
)
public
void
查询红包领取列表
()
{
visitorAuth
();
ThreadSleepUtils
.
sleep
(
10000
);
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
()));
}
/*主播端获取剩余红包金额*/
@Test
(
description
=
"获取剩余红包金额"
,
priority
=
2
0
)
@Test
(
description
=
"获取剩余红包金额"
,
priority
=
3
0
)
public
void
获取剩余红包金额
()
{
adminAuth
();
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
6691008b
...
...
@@ -133,12 +133,13 @@ public class BasicConfig {
//红包//
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_RedFindDetail
=
MOBILE_HOST
+
"/conf/live/red/findRedDetail"
;
public
static
final
String
MOBILE_GetSurplusAmount
=
MOBILE_HOST
+
"/conf/live/red/getSurplusAmount"
;
public
static
final
String
MOBILE_Grounding
=
MOBILE_HOST
+
"/conf/live/red/up"
;
public
static
final
String
MOBILE_RedStart
=
MOBILE_HOST
+
"/conf/live/red/start"
;
public
static
final
String
MOBILE_RedGetSimple
=
MOBILE_HOST
+
"/conf/live/red/getSimple"
;
public
static
final
String
MOBILE_RedSaveOrUpdate
=
MOBILE_HOST
+
"/conf/live/red/saveOrUpdate"
;
public
static
final
String
MOBILE_FindRedList
=
MOBILE_HOST
+
"/clue/red/findRedList"
;
public
static
final
String
MOBILE_RedFindSimpleDetail
=
MOBILE_HOST
+
"/clue/red/findSimpleDetail"
;
public
static
final
String
MOBILE_RedHelpDetail
=
MOBILE_HOST
+
"/kjy/live/user/red/help/detail"
;
public
static
final
String
MOBILE_GetRedMpShare
=
MOBILE_HOST
+
"/kjy/live/share/getRedMpShare"
;
...
...
src/test/liveTestNG.xml
View file @
6691008b
...
...
@@ -58,7 +58,7 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"红包
领取
"
>
<test
preserve-order=
"true"
name=
"红包"
>
<classes>
<class
name=
"com.kjj.cases.live.LiveVistorRed"
/>
</classes>
...
...
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