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
a7ddb004
Commit
a7ddb004
authored
Apr 15, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20210416_zz' into 'master'
完善代理人我的客户、中奖名单、精彩视频逻辑; See merge request test-group/kejiji!50
parents
73f3bd25
2630f8f1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
466 additions
and
49 deletions
+466
-49
LiveAgent.java
src/test/java/com/kjj/cases/live/agent/LiveAgent.java
+247
-46
LiveBefore.java
src/test/java/com/kjj/cases/live/agent/LiveBefore.java
+66
-0
LiveLater.java
src/test/java/com/kjj/cases/live/agent/LiveLater.java
+130
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+13
-3
liveTestNG.xml
src/test/liveTestNG.xml
+10
-0
No files found.
src/test/java/com/kjj/cases/live/agent/LiveAgent.java
View file @
a7ddb004
package
com
.
kjj
.
cases
.
live
.
agent
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.agent.AgentBean
;
import
com.kjj.bean.agent.AgentCard
;
import
com.kjj.bean.agent.AgentEndList
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang3.RandomUtils
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -25,12 +33,93 @@ public class LiveAgent implements AdminAuthorization {
public
String
invitationNum
;
public
String
allNum
;
public
String
moreThan20MinNum
;
public
String
sellerName
;
public
String
phoneNumber
;
public
String
jobNumber
;
public
String
teamName
;
//代理人页面
//查询代理人信息
@Test
(
description
=
"代理人名片信息"
,
priority
=
1
)
public
void
代理人名片信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
);
AgentCard
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
AgentCard
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"查询代理人信息失败"
,
response
.
body
().
asString
()));
}
//代理人个人信息获取
@Test
(
description
=
"获取代理人个人信息"
,
priority
=
2
)
public
void
获取代理人个人信息
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
);
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
phoneNumber
=
response
.
jsonPath
().
getString
(
"data.phoneNumber"
);
jobNumber
=
response
.
jsonPath
().
getString
(
"data.jobNumber"
);
teamName
=
response
.
jsonPath
().
getString
(
"data.teamName"
);
System
.
out
.
println
(
"sellerName="
+
sellerName
+
",phoneNumber="
+
phoneNumber
+
",jobNumber="
+
jobNumber
+
",teamName="
+
teamName
);
Assert
.
assertNotNull
(
sellerName
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人姓名失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
phoneNumber
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人手机号失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
jobNumber
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人工号失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
teamName
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人团队名称失败"
,
response
.
body
().
asString
()));
}
//修改代理人信息
@Test
(
description
=
"修改代理人信息"
,
priority
=
3
)
public
void
修改代理人信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerName"
,
"你好测试"
+
RandomUtils
.
nextInt
(
1
,
100
));
params
.
put
(
"phoneNumber"
,
"152588101691"
);
params
.
put
(
"jobNumber"
,
"TTTTTT"
);
params
.
put
(
"wechatQrCode"
,
"//yun.dui88.com/kjy/nc/qrcode1/1981ec88d22fe37041feac4724c627670817.png"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
);
Boolean
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
Boolean
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
,
"修改代理人信息失败"
,
response
.
body
().
asString
()));
}
//代理人首页直播列表
@Test
(
description
=
"代理人首页 "
,
priority
=
4
)
public
void
代理人直播列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Procurator
);
List
<
AgentBean
>
agentBeans
=
JsonUtil
.
parseResponseToPageBean
(
response
,
AgentBean
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
AgentBean
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Procurator
,
"查询直播列表失败"
,
response
.
body
().
asString
()));
}
}
//代理人首页已结束的直播列表
@Test
(
description
=
"代理人首页已结束的直播列表"
,
priority
=
5
)
public
void
代理人直播结束列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentEndList
);
List
<
AgentEndList
>
agentBeans
=
JsonUtil
.
parseResponseToPageBean
(
response
,
AgentEndList
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
AgentEndList
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentEndList
,
"查询直播结束列表失败"
,
response
.
body
().
asString
()));
}
}
//代理人直播排行榜;
// 获取个人榜;
@Test
(
description
=
"获取排行榜页面个人榜单"
,
priority
=
1
)
@Test
(
description
=
"获取排行榜页面个人榜单"
,
priority
=
6
)
public
void
获取排行榜页面个人榜单
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -42,8 +131,8 @@ public class LiveAgent implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentPersonalCharts
,
"获取个人榜单失败"
,
response
.
body
().
asString
()));
}
//获取代理人自己的榜单信息
@Test
(
description
=
"获取代理人自己的榜单信息"
,
priority
=
2
)
//获取代理人自己的榜单信息
;
@Test
(
description
=
"获取代理人自己的榜单信息"
,
priority
=
7
)
public
void
获取代理人自己的榜单信息
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -57,7 +146,7 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取团队榜;
@Test
(
description
=
"获取排行榜页面团队榜单"
,
priority
=
3
)
@Test
(
description
=
"获取排行榜页面团队榜单"
,
priority
=
8
)
public
void
获取排行榜页面团队榜单
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -77,7 +166,7 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取队内榜;
@Test
(
description
=
"获取排行榜页面队内榜单"
,
priority
=
4
)
@Test
(
description
=
"获取排行榜页面队内榜单"
,
priority
=
9
)
public
void
获取排行榜页面队内榜单
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -95,7 +184,7 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取代理人直播海报信息;
@Test
(
description
=
"获取代理人直播海报信息"
,
priority
=
5
)
@Test
(
description
=
"获取代理人直播海报信息"
,
priority
=
10
)
public
void
获取代理人直播海报信息
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -107,24 +196,43 @@ public class LiveAgent implements AdminAuthorization {
}
//代理人我的客户列表;
// 获取代理人各线索等级的线索数;
@Test
(
description
=
"获取线索等级的线索数"
,
priority
=
6
)
@Test
(
description
=
"获取线索等级的线索数"
,
priority
=
11
)
public
void
获取线索等级的线索数
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNum
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNum
,
"获取线索数失败"
,
response
.
body
().
asString
()));
}
//获取代理人所有线索数量
@Test
(
description
=
"获取所有线索数量"
,
priority
=
12
)
public
void
获取所有线索数量
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNum
);
allNum
=
response
.
jsonPath
().
getString
(
"data.allNum"
);
System
.
out
.
println
(
allNum
);
Assert
.
assertNotNull
(
allNum
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNum
,
"获取所有线索数量失败"
,
response
.
body
().
asString
()));
}
//获取观看超过20分钟的人数
@Test
(
description
=
"获取观看超过20分钟的人数"
,
priority
=
13
)
public
void
获取观看超过
20
分钟的人数
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNum
);
moreThan20MinNum
=
response
.
jsonPath
().
getString
(
"data.moreThan20MinNum"
);
System
.
out
.
println
(
"success="
+
success
+
",allNum="
+
allNum
+
",moreThan20MinNum="
+
moreThan20MinNum
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueNum
,
"获取线索数失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
allNum
,
network
.
message
(
MOBILE_TeamTeamCharts
,
"获取所有线索数量失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
moreThan20MinNum
,
network
.
message
(
MOBILE_TeamTeamCharts
,
"获取观看超过20分钟的人数失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
moreThan20MinNum
);
Assert
.
assertNotNull
(
moreThan20MinNum
,
network
.
message
(
MOBILE_ClueNum
,
"获取观看超过20分钟的人数失败"
,
response
.
body
().
asString
()));
}
// 获取直播中直播结束线索列表;
@Test
(
description
=
"获取线索列表"
,
priority
=
7
)
@Test
(
description
=
"获取线索列表"
,
priority
=
14
)
public
void
获取线索列表
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -144,10 +252,10 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取
线索列表
全部tab;
@Test
(
description
=
"获取
线索列表全部tab数据"
,
priority
=
8
)
public
void
获取
线索列表
全部
tab
数据
()
throws
IOException
{
//直播中我的客户页面
// 获取
直播中我的客户页面
全部tab;
@Test
(
description
=
"获取
直播中我的客户页面全部tab数据"
,
priority
=
15
)
public
void
获取
直播中我的客户页面
全部
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -158,76 +266,169 @@ public class LiveAgent implements AdminAuthorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取全部tab下数据失败"
,
response
.
body
().
asString
()));
}
// 获取
线索列表新客户
tab;
@Test
(
description
=
"获取
线索列表新客户tab数据"
,
priority
=
9
)
public
void
获取
线索列表新客户
tab
数据
()
throws
IOException
{
// 获取
直播中我的客户页面观看
tab;
@Test
(
description
=
"获取
直播中我的客户页面观看tab数据"
,
priority
=
16
)
public
void
获取
直播中我的客户页面观看
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
2
2
);
params
.
put
(
"actionTypeList"
,
2
5
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
新客户tab下
数据失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
直播中我的客户页面观看tab
数据失败"
,
response
.
body
().
asString
()));
}
// 获取
线索列表老客户
tab;
@Test
(
description
=
"获取
线索列表老客户tab数据"
,
priority
=
10
)
public
void
获取
线索列表老客户
tab
数据
()
throws
IOException
{
// 获取
直播中我的客户页面未观看
tab;
@Test
(
description
=
"获取
直播中我的客户页面未观看tab数据"
,
priority
=
17
)
public
void
获取
直播中我的客户页面未观看
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
2
6
);
params
.
put
(
"actionTypeList"
,
2
4
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
老客户tab下
数据失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
直播中我的客户页面未观看tab
数据失败"
,
response
.
body
().
asString
()));
}
// 获取
线索列表未观看
tab;
@Test
(
description
=
"获取
线索列表未观看tab数据"
,
priority
=
11
)
public
void
获取
线索列表未观看
tab
数据
()
throws
IOException
{
// 获取
直播中我的客户页面中奖
tab;
@Test
(
description
=
"获取
直播中我的客户页面中奖tab数据"
,
priority
=
18
)
public
void
获取
直播中我的客户页面中奖
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
24
);
params
.
put
(
"actionTypeList"
,
17
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
未观看tab下
数据失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
直播中我的客户页面中奖tab
数据失败"
,
response
.
body
().
asString
()));
}
// 获取
线索列表中奖
tab;
@Test
(
description
=
"获取
线索列表中奖tab数据"
,
priority
=
12
)
public
void
获取
线索列表中奖
tab
数据
()
throws
IOException
{
// 获取
直播中我的客户页面报名
tab;
@Test
(
description
=
"获取
直播中我的客户页面报名tab数据"
,
priority
=
19
)
public
void
获取
直播中我的客户页面报名
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
17
);
params
.
put
(
"actionTypeList"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
中奖tab下
数据失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取
直播中我的客户页面报名tab
数据失败"
,
response
.
body
().
asString
()));
}
// 获取线索列表报名tab;
@Test
(
description
=
"获取线索列表报名tab数据"
,
priority
=
13
)
public
void
获取线索列表报名
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//管理后台短视频管理
//查询获取视频列表
@Test
(
description
=
"获取视频列表"
,
priority
=
20
)
public
void
获取视频列表
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoList
,
"获取视频列表失败"
,
response
.
body
().
asString
()));
}
//保存或更新视频
@Test
(
description
=
"保存或更新视频"
,
priority
=
21
)
public
void
保存或更新视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"videoUrl"
,
"//yun.dui88.com/kjy/media/file/20210414/b3fc43806a190d56ca4ba57a9a1fef8e.mp4"
);
params
.
put
(
"videoTitle"
,
"测试测试"
);
params
.
put
(
"videoTag"
,
""
);
params
.
put
(
"resourceId"
,
null
);
params
.
put
(
"videoRemark"
,
""
);
params
.
put
(
"videoFirstImg"
,
"//yun.dui88.com/kjy/image/20210414/1618384473776.jpg"
);
params
.
put
(
"shareImageUrl"
,
"//yun.dui88.com/kjy/image/20210414/1618384473776.jpg"
);
params
.
put
(
"id"
,
68
);
params
.
put
(
"videoScreen"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_SaveOrUpdate
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_SaveOrUpdate
,
"保存或更新视频失败"
,
response
.
body
().
asString
()));
}
//置顶视频
@Test
(
description
=
"置顶视频"
,
priority
=
22
)
public
void
置顶视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoTop
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoTop
,
"置顶视频失败"
,
response
.
body
().
asString
()));
}
//取消置顶视频
@Test
(
description
=
"取消置顶视频"
,
priority
=
23
)
public
void
取消置顶视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoCancelTopt
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoCancelTopt
,
"取消置顶视频失败"
,
response
.
body
().
asString
()));
}
//上移视频
@Test
(
description
=
"上移视频"
,
priority
=
24
)
public
void
上移视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoUp
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取报名tab下数据失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoUp
,
"上移视频失败"
,
response
.
body
().
asString
()));
}
//下移视频
@Test
(
description
=
"下移视频"
,
priority
=
25
)
public
void
下移视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDown
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDown
,
"下移视频失败"
,
response
.
body
().
asString
()));
}
// //删除视频
// @Test(description="删除视频",priority = 26)
// public void 删除视频() {
// BaseUtils.ssoLogin();
// Map<String, Object> params = new HashMap<>();
// params.put("id",68);
// Response response = network.postResponse(params,BasicConfig.MANAGER_CompanyVideoDelete);
// boolean success = response.jsonPath().getBoolean("success");
// System.out.println(success);
// Assert.assertTrue(success, network.message(params, BasicConfig.MANAGER_CompanyVideoDelete, "删除视频失败", response.body().asString()));
//
// }
...
...
src/test/java/com/kjj/cases/live/agent/LiveBefore.java
0 → 100644
View file @
a7ddb004
package
com
.
kjj
.
cases
.
live
.
agent
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
LiveBefore
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
String
pageSize
;
//直播前我的客户页面
// 获取直播前我的客户页面全部tab;
@Test
(
description
=
"获取直播前我的客户页面全部tab数据"
,
priority
=
1
)
public
void
获取直播前我的客户页面全部
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_MyCustomerList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_MyCustomerList
,
"获取直播前全部tab下数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播前我的客户页面直接邀请tab;
@Test
(
description
=
"获取直播前我的客户页面直接邀请tab数据"
,
priority
=
2
)
public
void
获取直播前我的客户页面直接邀请
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"directly"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_MyCustomerList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_MyCustomerList
,
"获取直播前我的客户页面直接邀请tab数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播前我的客户页面转介绍tab;
@Test
(
description
=
"获取直播前我的客户页面转介绍tab数据"
,
priority
=
3
)
public
void
获取直播前我的客户页面转介绍
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"directly"
,
0
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_MyCustomerList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_MyCustomerList
,
"获取直播前我的客户页面转介绍tab数据失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/agent/LiveLater.java
0 → 100644
View file @
a7ddb004
package
com
.
kjj
.
cases
.
live
.
agent
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
LiveLater
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
String
pageSize
;
public
String
invitationNum
;
public
String
allNum
;
public
String
moreThan20MinNum
;
public
String
sellerName
;
public
String
phoneNumber
;
public
String
jobNumber
;
public
String
teamName
;
//直播结束我的客户页面
// 获取直播结束我的客户页面全部tab;
@Test
(
description
=
"获取直播结束我的客户页面全部tab数据"
,
priority
=
1
)
public
void
获取直播结束我的客户页面全部
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取直播结束后全部tab下数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播结束我的客户页面直接邀请tab;
@Test
(
description
=
"获取直播结束我的客户页面直接邀请tab数据"
,
priority
=
2
)
public
void
获取直播结束我的客户页面直接邀请
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
26
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取直播结束我的客户页面直接邀请tab数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播结束我的客户页面转介绍tab;
@Test
(
description
=
"获取直播结束我的客户页面转介绍tab数据"
,
priority
=
3
)
public
void
获取直播结束我的客户页面转介绍
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
22
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取直播结束我的客户页面转介绍tab数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播结束我的客户页面中奖tab;
@Test
(
description
=
"获取直播结束我的客户页面中奖tab数据"
,
priority
=
4
)
public
void
获取直播结束我的客户页面中奖
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
17
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取直播结束我的客户页面中奖tab数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播结束我的客户页面报名tab;
@Test
(
description
=
"获取直播结束我的客户页面报名tab数据"
,
priority
=
5
)
public
void
获取直播结束我的客户页面报名
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取直播结束我的客户页面报名tab数据失败"
,
response
.
body
().
asString
()));
}
// 获取直播结束我的客户页面观看20分钟+tab;
@Test
(
description
=
"获取直播结束我的客户页面观看20分钟+tab数据"
,
priority
=
6
)
public
void
获取直播结束我的客户页面观看
20
分钟以上
tab
数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"actionTypeList"
,
4
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ClueList
,
"获取直播结束我的客户页面观看20分钟以上tab数据失败"
,
response
.
body
().
asString
()));
}
//直播结束后中奖名单查询
// 获取直播结束中奖名单;
@Test
(
description
=
"获取直播结束中奖名单"
,
priority
=
7
)
public
void
获取直播结束中奖名单
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_RewardAgentList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_RewardAgentList
,
"获取直播结束中奖名单失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
a7ddb004
...
...
@@ -3,7 +3,7 @@ package com.kjj.config;
public
class
BasicConfig
{
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
// 代理人的openid(固定)
...
...
@@ -134,6 +134,11 @@ public class BasicConfig {
public
static
final
String
MOBILE_TeamTeamCharts
=
MOBILE_HOST
+
"/kjy/live/team/teamCharts"
;
public
static
final
String
MOBILE_AgentPersonalTeamCharts
=
MOBILE_HOST
+
"/kjy/live/agent/personalTeamCharts"
;
public
static
final
String
MOBILE_AgentOwnCharts
=
MOBILE_HOST
+
"/kjy/live/agent/ownCharts"
;
public
static
final
String
MOBILE_ClueNum
=
MOBILE_HOST
+
"/kjy/live/agent/clue/clueNum"
;
public
static
final
String
MOBILE_ClueList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/list"
;
public
static
final
String
MOBILE_MyCustomerList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/myCustomerList"
;
public
static
final
String
MOBILE_RewardAgentList
=
MOBILE_HOST
+
"/kjy/live/reward/agent/list"
;
//查询资料列表//
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
...
...
@@ -151,8 +156,6 @@ public class BasicConfig {
public
static
final
String
MOBILE_ResourceTestParticipate
=
MOBILE_HOST
+
"/clue/resource/test/participate"
;
public
static
final
String
MOBILE_ResourceTestSubmit
=
MOBILE_HOST
+
"/clue/resource/test/submit"
;
public
static
final
String
MOBILE_GetAgentPosterInfo
=
MOBILE_HOST
+
"/kjy/live/share/getAgentPosterInfo"
;
public
static
final
String
MOBILE_ClueNum
=
MOBILE_HOST
+
"/kjy/live/agent/clue/clueNum"
;
public
static
final
String
MOBILE_ClueList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/list"
;
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
public
static
final
String
MOBILE_binding
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_Token
=
MOBILE_HOST
+
"/clue/invitation/token"
;
...
...
@@ -380,6 +383,13 @@ public class BasicConfig {
public
static
final
String
MANAGER_PROMOTIONCODELIST
=
MANAGER_HOST
+
"/kjy/manager/promotionCode/codeList"
;
public
static
final
String
MANAGER_PROMOTIONBATCHMODIFY
=
MANAGER_HOST
+
"/kjy/manager/promotionCode/batchModify"
;
public
static
final
String
MANAGER_PROMOTIONCODEBATCHDETAIL
=
MANAGER_HOST
+
"/kjy/manager/promotionCode/batchDetail"
;
public
static
final
String
MANAGER_CompanyVideoList
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/list"
;
public
static
final
String
MANAGER_SaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/saveOrUpdate"
;
public
static
final
String
MANAGER_CompanyVideoTop
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/top"
;
public
static
final
String
MANAGER_CompanyVideoCancelTopt
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/cancelTop"
;
public
static
final
String
MANAGER_CompanyVideoUp
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/up"
;
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"
;
}
src/test/liveTestNG.xml
View file @
a7ddb004
...
...
@@ -36,6 +36,11 @@
<classes>
<class
name=
"com.kjj.cases.live.lottery.DesignatedWinner"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播前-我的客户页"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.LiveBefore"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
...
...
@@ -73,5 +78,10 @@
<class
name=
"com.kjj.cases.live.anchor.CloseLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播结束-我的客户页"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.LiveLater"
/>
</classes>
</test>
</suite>
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