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
a8666b27
Commit
a8666b27
authored
Jul 20, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加客户系数及来源的测试用例
2.增加产品组的测试用例
parent
051c3a6b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
192 additions
and
37 deletions
+192
-37
Manager.java
src/test/java/com/oto/cases/otoseller/Manager.java
+58
-23
Phone.java
src/test/java/com/oto/cases/otoseller/Phone.java
+14
-7
Work.java
src/test/java/com/oto/cases/otoseller/Work.java
+114
-7
BasicConfig.java
src/test/java/com/oto/config/BasicConfig.java
+6
-0
No files found.
src/test/java/com/oto/cases/otoseller/Manager.java
View file @
a8666b27
package
com
.
oto
.
cases
.
otoseller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.oto.cases.admin.Authorization
;
import
com.oto.config.BasicConfig
;
import
com.oto.utils.IdMakeUtil
;
...
...
@@ -39,7 +40,7 @@ public class Manager implements Authorization {
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
int
size
=
0
;
int
i
=
1
;
while
(
size
<
1
){
while
(
size
<
1
&&
i
<
10
){
params
.
put
(
"pageIndex"
,
i
);
params
.
put
(
"pageSize"
,
"20"
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
);
...
...
@@ -77,11 +78,12 @@ public class Manager implements Authorization {
params
.
put
(
"roleType"
,
1
);
params
.
put
(
"callPermission"
,
0
);
params
.
put
(
"sellerStatus"
,
0
);
params
.
put
(
"companyId
"
,
1
);
params
.
put
(
"companyName
"
,
"勿动-自动化测试公司"
);
params
.
put
(
"companyId
s"
,
new
int
[]{
5
}
);
params
.
put
(
"companyName
s"
,
new
String
[]{
"勿动-自动化测试公司"
}
);
params
.
put
(
"sellerLevel"
,
2
);
params
.
put
(
"workStatus"
,
1
);
params
.
put
(
"parentId"
,
28
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
params
));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updateSeller
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_updateSeller
,
"修改客户失败"
,
response
.
body
().
asString
()));
...
...
@@ -99,7 +101,8 @@ public class Manager implements Authorization {
//还原
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"companyId"
,
5
);
params
.
put
(
"companyIds"
,
new
int
[]{
5
});
params
.
put
(
"companyNames"
,
new
String
[]{
"勿动-自动化测试公司"
});
params
.
put
(
"sellerLevel"
,
1
);
params
.
put
(
"parentId"
,
LEADER_ID
);
params
.
put
(
"sellerName"
,
"勿动-自动化测试销售"
);
...
...
@@ -123,7 +126,7 @@ public class Manager implements Authorization {
params
.
put
(
"roleType"
,
1
);
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"companyId"
,
1
);
params
.
put
(
"companyId"
,
new
int
[]{
5
}
);
params
.
put
(
"sellerLevel"
,
1
);
params
.
put
(
"workStatus"
,
1
);
params
.
put
(
"assignNewCustPermission"
,
1
);
...
...
@@ -137,40 +140,56 @@ public class Manager implements Authorization {
public
void
不可新增同名公司
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyName"
,
"勿动-自动化测试公司"
);
params
.
put
(
"areaCodes"
,
new
String
[]{
"330000"
,
"330100"
});
params
.
put
(
"productIds"
,
new
int
[]{
60
,
59
,
64
});
params
.
put
(
"sellerArea"
,
"浙江省-杭州市"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_saveCompany
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_saveCompany
,
"新增同名公司成功"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改
公司名称
"
,
priority
=
8
)
public
void
修改
公司名称
(){
@Test
(
description
=
"修改
产品组信息
"
,
priority
=
8
)
public
void
修改
产品组信息
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
5
);
params
.
put
(
"areaCodes"
,
new
String
[]{
"330000"
,
"330100"
});
params
.
put
(
"productIds"
,
new
int
[]{
60
,
59
,
64
});
params
.
put
(
"companyName"
,
"勿动-自动化测试公司更新"
);
params
.
put
(
"sellerArea"
,
"浙江省-杭州市"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updateCompany
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_updateCompany
,
"修改客户失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"分页查看
公司
列表"
,
priority
=
9
)
public
void
分页查看
公司
列表
(){
@Test
(
description
=
"分页查看
产品组
列表"
,
priority
=
9
)
public
void
分页查看
产品组
列表
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_oto_listCompany
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.findAll{it.companyName == \""
+
"勿动-自动化测试公司更新"
+
"\"}.size()"
);
int
size
=
0
;
int
i
=
1
;
Response
response
=
null
;
while
(
size
<
1
&&
i
<
10
){
params
.
put
(
"pageIndex"
,
i
);
params
.
put
(
"pageSize"
,
"20"
);
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_oto_listCompany
);
size
=
response
.
jsonPath
().
getInt
(
"data.list.findAll{it.companyId == 5}.size()"
);
i
++;
}
size
=
response
.
jsonPath
().
getInt
(
"data.list.findAll{it.companyName == \""
+
"勿动-自动化测试公司更新"
+
"\"}.size()"
);
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_listCompany
,
"查询更新的公司名称失败"
,
response
.
body
().
asString
()));
//还原
params
.
clear
();
params
.
put
(
"id"
,
5
);
params
.
put
(
"companyName"
,
"勿动-自动化测试公司"
);
params
.
put
(
"areaCodes"
,
new
String
[]{
"330000"
,
"330100"
});
params
.
put
(
"productIds"
,
new
int
[]{
60
,
59
,
19
});
params
.
put
(
"sellerArea"
,
"浙江省-杭州市"
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updateCompany
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_updateCompany
,
"修改客户失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看所有
公司
列表"
,
priority
=
10
)
@Test
(
description
=
"查看所有
产品组
列表"
,
priority
=
10
)
public
void
查看所有公司列表
(){
Response
response
=
network
.
getResponse
(
BasicConfig
.
MANAGER_oto_listAllCompany
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
...
...
@@ -230,14 +249,19 @@ public class Manager implements Authorization {
@Test
(
description
=
"查看产品列表"
,
priority
=
15
)
public
void
查看产品列表
(){
Response
response
=
null
;
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
int
size
=
0
;
int
i
=
1
;
while
(
size
<
1
&&
i
<
10
){
params
.
put
(
"pageIndex"
,
i
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"companyIds"
,
5
);
params
.
put
(
"prodStatus"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_oto_productList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productList
,
"查询公司产品为空"
,
response
.
body
().
asString
()));
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_oto_productList
);
size
=
response
.
jsonPath
().
getInt
(
"data.list.findAll{it.id == 19}.size()"
);
i
++;
}
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productList
,
"未找到相应产品"
,
response
.
body
().
asString
()));
int
costOptionsSize
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == 19}.costOptions.size()"
);
String
prodName
=
response
.
jsonPath
().
getString
(
"data.list.find{it.id == 19}.prodName"
);
Assert
.
assertEquals
(
costOptionsSize
,
3
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productList
,
"产品的缴费期未更新"
,
response
.
body
().
asString
()));
...
...
@@ -502,7 +526,7 @@ public class Manager implements Authorization {
params
.
put
(
"id"
,
20
);
params
.
put
(
"accountId"
,
"20220107CESHI_1"
);
params
.
put
(
"accountName"
,
"勿动_自动化测试专用账号"
);
params
.
put
(
"companyId
"
,
5
);
params
.
put
(
"companyId
s"
,
new
int
[]{
5
}
);
params
.
put
(
"pubChannel"
,
6
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_account_saveOrUpdate
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
@@ -528,7 +552,7 @@ public class Manager implements Authorization {
params
.
put
(
"id"
,
20
);
params
.
put
(
"accountId"
,
"20220107CESHI_01"
);
params
.
put
(
"accountName"
,
"勿动_自动化测试账号"
);
params
.
put
(
"companyId
"
,
5
);
params
.
put
(
"companyId
s"
,
new
int
[]{
5
}
);
params
.
put
(
"pubChannel"
,
5
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_account_saveOrUpdate
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
@@ -639,4 +663,15 @@ public class Manager implements Authorization {
Assert
.
assertEquals
(
accessSource
,
linkId
,
network
.
message
(
params
,
BasicConfig
.
live_mapping_getTrueLinkInfo
,
"查询的投放账户列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
liveId
,
IdMakeUtil
.
encodingId
(
8203L
),
network
.
message
(
params
,
BasicConfig
.
live_mapping_getTrueLinkInfo
,
"模糊查询结果错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取客户来源对应关系列表"
,
priority
=
44
)
public
void
获取客户来源对应关系列表
(){
Response
response
=
network
.
getResponse
(
BasicConfig
.
MANAGER_custFromSourceList
);
String
custFromSource
=
response
.
jsonPath
().
getString
(
"data[0].custFromSource"
);
String
desc
=
response
.
jsonPath
().
getString
(
"data[0].desc"
);
Assert
.
assertEquals
(
custFromSource
,
"01_01-01"
,
network
.
message
(
BasicConfig
.
MANAGER_custFromSourceList
,
"修改投放账户失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
desc
,
"投放客户-自建落地页-表单"
,
network
.
message
(
BasicConfig
.
MANAGER_custFromSourceList
,
"修改投放账户失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/oto/cases/otoseller/Phone.java
View file @
a8666b27
...
...
@@ -54,7 +54,7 @@ public class Phone implements Authorization {
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custName"
,
"自动化缘故客户"
);
params
.
put
(
"custPhoneNum"
,
"13410000001"
);
params
.
put
(
"cust
Source"
,
1
);
params
.
put
(
"cust
ActionType"
,
"04"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_customerSave
);
myselfCustomer_id
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
myselfCustomer_id
,
network
.
message
(
params
,
BasicConfig
.
PHONE_customerSave
,
"创建缘故客户失败"
,
response
.
body
().
asString
()));
...
...
@@ -66,7 +66,7 @@ public class Phone implements Authorization {
params
.
put
(
"custName"
,
"自动化转介绍客户"
);
params
.
put
(
"custPhoneNum"
,
"13410000002"
);
params
.
put
(
"introducerId"
,
myselfCustomer_id
);
params
.
put
(
"cust
Source"
,
2
);
params
.
put
(
"cust
ActionType"
,
"05"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_customerSave
);
introduceCustomer_id
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
introduceCustomer_id
,
network
.
message
(
params
,
BasicConfig
.
PHONE_customerSave
,
"创建转介绍客户失败"
,
response
.
body
().
asString
()));
...
...
@@ -520,7 +520,9 @@ public class Phone implements Authorization {
@Test
(
description
=
"查看公司产品列表"
,
priority
=
38
)
public
void
查看公司产品列表
()
{
Response
response
=
network
.
getResponse
(
BasicConfig
.
PHONE_listBysellComp
);
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
cust_id
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_listBysellComp
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertEquals
(
size
,
2
,
network
.
message
(
BasicConfig
.
PHONE_listBysellComp
,
"产品列表未包含已上架产品"
,
response
.
body
().
asString
()));
}
...
...
@@ -539,14 +541,18 @@ public class Phone implements Authorization {
public
void
产品下架后公司产品列表不显示
()
{
otoSellerTku
();
Response
response
=
network
.
getResponse
(
BasicConfig
.
PHONE_listBysellComp
);
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
cust_id
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_listBysellComp
);
int
size
=
response
.
jsonPath
().
getJsonObject
(
"data.size()"
);
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
BasicConfig
.
PHONE_listBysellComp
,
"产品列表未包含已上架产品"
,
response
.
body
().
asString
()));
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>
();
params
.
clear
();
params
.
put
(
"id"
,
productId
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_productUpdateStatus
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_productUpdateStatus
,
"上架公司产品失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"上传2进4面访并提示满足流转4阶段"
,
priority
=
41
)
...
...
@@ -678,8 +684,8 @@ public class Phone implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_delCust
,
"删除见面场景失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看我的
预
日报为未提交"
,
priority
=
48
)
public
void
查看我的
预
日报为未提交
(){
@Test
(
description
=
"查看我的日报为未提交"
,
priority
=
48
)
public
void
查看我的日报为未提交
(){
otoSellerTku
();
Response
response
=
network
.
getResponse
(
BasicConfig
.
PHONE_paper_getReportFlag
);
int
reportFlag
=
response
.
jsonPath
().
getInt
(
"data.reportFlag"
);
...
...
@@ -745,6 +751,7 @@ public class Phone implements Authorization {
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_delCust
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_delCust
,
"删除客户失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除客户填写的表单记录"
,
priority
=
80
)
...
...
src/test/java/com/oto/cases/otoseller/Work.java
View file @
a8666b27
...
...
@@ -8,6 +8,7 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
static
com
.
oto
.
config
.
BasicConfig
.*;
...
...
@@ -22,12 +23,14 @@ public class Work implements Authorization {
public
int
followTimes
;
//跟进次数
public
static
Map
<
String
,
Integer
>
header
;
public
static
Map
<
String
,
Integer
>
chart
;
public
Map
<
String
,
Double
>
coefficient
;
public
static
long
sceneId
;
@BeforeTest
public
void
setUp
(){
header
=
new
HashMap
<>();
chart
=
new
HashMap
<>();
coefficient
=
new
HashMap
<>();
otoSellerLogin
();
otoLeaderLogin
();
otoManagerLogin
();
...
...
@@ -109,7 +112,9 @@ public class Work implements Authorization {
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
Assert
.
assertTrue
(
totalCount
==
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_customerList
,
"未查找到该客户"
,
response
.
body
().
asString
()));
String
custName
=
response
.
jsonPath
().
getString
(
"data.list[0].custName"
);
Assert
.
assertEquals
(
custName
,
"自动化测试用户"
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_customerList
,
"未查找到该客户"
,
response
.
body
().
asString
()));
int
companySize
=
response
.
jsonPath
().
getInt
(
"data.list[0].companyIds.size()"
);
Assert
.
assertEquals
(
custName
,
"自动化测试用户"
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_customerList
,
"客户姓名与填单时错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
companySize
,
3
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_customerList
,
"客户的产品组错误"
,
response
.
body
().
asString
()));
custId
=
response
.
jsonPath
().
getInt
(
"data.list[0].id"
);
}
...
...
@@ -119,10 +124,15 @@ public class Work implements Authorization {
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
String
str
=
String
.
valueOf
(
System
.
currentTimeMillis
());
params
.
put
(
"customerId"
,
custId
);
params
.
put
(
"sellerId"
,
SELLER_ID
);
params
.
put
(
"sellerId"
,
3
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
,
"销售不同产品组分配客户成功"
,
response
.
body
().
asString
()));
params
.
put
(
"sellerId"
,
SELLER_ID
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
,
"分配客户失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
,
"
销售相同产品组
分配客户失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"工作台_销售信息"
,
priority
=
7
)
...
...
@@ -279,8 +289,68 @@ public class Work implements Authorization {
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_getCustPhase
);
int
custFlow
=
response
.
jsonPath
().
getInt
(
"data.custFlow"
);
int
commitPlanFlag
=
response
.
jsonPath
().
getInt
(
"data.commitPlanFlag"
);
Assert
.
assertEquals
(
custFlow
,
1
,
network
.
message
(
params
,
BasicConfig
.
WORK_callLog
,
"新客户的客户阶段不为1:具备机构养老理念"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
commitPlanFlag
,
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_callLog
,
"是否提交计划书不为否"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custFlow
,
1
,
network
.
message
(
params
,
BasicConfig
.
PHONE_getCustPhase
,
"新客户的客户阶段不为1:具备机构养老理念"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
commitPlanFlag
,
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_getCustPhase
,
"是否提交计划书不为否"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看销售的总系数"
,
priority
=
21
)
public
void
查看销售的总系数
(){
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_coefficient_detail
);
Double
totalCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.totalCoefficient"
);
Double
coefficientLimit
=
response
.
jsonPath
().
getDouble
(
"data.coefficientLimit"
);
Assert
.
assertTrue
(
totalCoefficient
>
0
,
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"销售总系数≤0"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
coefficientLimit
>
0
,
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"总系数上限≤0"
,
response
.
body
().
asString
()));
coefficient
.
put
(
"totalCoefficient"
,
totalCoefficient
);
coefficient
.
put
(
"formCoefficient"
,
response
.
jsonPath
().
getDouble
(
"data.formCoefficient"
));
coefficient
.
put
(
"outRegionCoefficient"
,
response
.
jsonPath
().
getDouble
(
"data.outRegionCoefficient"
));
coefficient
.
put
(
"outAgreeCoefficient"
,
response
.
jsonPath
().
getDouble
(
"data.outAgreeCoefficient"
));
}
@Test
(
description
=
"查询客户的地区及系数"
,
priority
=
22
)
public
void
查询客户的地区及系数
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_customer_detail
);
boolean
showConfirmFlag
=
response
.
jsonPath
().
getBoolean
(
"data.showConfirmFlag"
);
int
remainDays
=
response
.
jsonPath
().
getInt
(
"data.remainDays"
);
String
custActionType
=
response
.
jsonPath
().
getString
(
"data.custActionType"
);
Assert
.
assertTrue
(
showConfirmFlag
,
network
.
message
(
params
,
BasicConfig
.
WORK_customer_detail
,
"外地客户未展示确认认领按钮"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
remainDays
>
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_customer_detail
,
"自动认领天数≤0"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custActionType
,
"01"
,
network
.
message
(
params
,
BasicConfig
.
WORK_customer_detail
,
"外地客户的客户来源为空"
,
response
.
body
().
asString
()));
coefficient
.
put
(
"custCoefficient"
,
response
.
jsonPath
().
getDouble
(
"data.custCoefficient"
));
coefficient
.
put
(
"claimCustCoefficient"
,
response
.
jsonPath
().
getDouble
(
"data.claimCustCoefficient"
));
}
@Test
(
description
=
"认领外地客户后销售系数更新"
,
priority
=
23
)
public
void
认领外地客户后销售系数更新
(){
//认领外地客户
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_customer_claim
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_customer_claim
,
"认领外地客户失败"
,
response
.
body
().
asString
()));
//查询销售总系数
response
=
network
.
getResponse
(
BasicConfig
.
WORK_coefficient_detail
);
Double
totalCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.totalCoefficient"
);
Double
formCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.formCoefficient"
);
Double
outRegionCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.outRegionCoefficient"
);
Double
outAgreeCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.outAgreeCoefficient"
);
//认领后总系数=认领前总系数+客户认领后系数-客户认领前系数
BigDecimal
bg
=
new
BigDecimal
(
coefficient
.
get
(
"totalCoefficient"
)
+
coefficient
.
get
(
"claimCustCoefficient"
)
-
coefficient
.
get
(
"custCoefficient"
));
Double
sum1
=
bg
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
bg
=
new
BigDecimal
(
coefficient
.
get
(
"outRegionCoefficient"
)-
coefficient
.
get
(
"custCoefficient"
));
Double
sum2
=
bg
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
bg
=
new
BigDecimal
(
coefficient
.
get
(
"outAgreeCoefficient"
)+
coefficient
.
get
(
"claimCustCoefficient"
));
Double
sum3
=
bg
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
Assert
.
assertEquals
(
totalCoefficient
,
sum1
,
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"销售总系数增加错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
formCoefficient
,
coefficient
.
get
(
"formCoefficient"
),
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"填单系数发生变化"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
outRegionCoefficient
,
sum2
,
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"外地客户总系数减少错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
outAgreeCoefficient
,
sum3
,
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"外地确认客户总系数增加错误"
,
response
.
body
().
asString
()));
coefficient
.
put
(
"totalCoefficient"
,
totalCoefficient
);
}
@Test
(
description
=
"修改客户跟进权重"
,
priority
=
24
)
...
...
@@ -524,6 +594,18 @@ public class Work implements Authorization {
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_abandonCust
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_abandonCust
,
"放弃客户失败"
,
response
.
body
().
asString
()));
sleep
(
1000
);
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
totalNum
=
response
.
jsonPath
().
getInt
(
"data.totalNum"
);
int
num
=
header
.
get
(
"totalNum"
);
Assert
.
assertEquals
(
totalNum
,
num
-
1
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"客户总数未更新"
,
response
.
body
().
asString
()));
//查询销售总系数
response
=
network
.
getResponse
(
BasicConfig
.
WORK_coefficient_detail
);
Double
totalCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.totalCoefficient"
);
Assert
.
assertEquals
(
totalCoefficient
,
coefficient
.
get
(
"totalCoefficient"
),
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"放弃客户销售总系数变化"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询投放池刷新配置"
,
priority
=
49
)
...
...
@@ -563,10 +645,15 @@ public class Work implements Authorization {
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_claim
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_claim
,
"删除客户失败"
,
response
.
body
().
asString
()));
//查询销售总系数
response
=
network
.
getResponse
(
BasicConfig
.
WORK_coefficient_detail
);
Double
totalCoefficient
=
response
.
jsonPath
().
getDouble
(
"data.totalCoefficient"
);
Assert
.
assertEquals
(
totalCoefficient
,
coefficient
.
get
(
"totalCoefficient"
),
network
.
message
(
BasicConfig
.
WORK_coefficient_detail
,
"放弃客户销售总系数变化"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"客户总数更新"
,
priority
=
53
)
public
void
客户总数更新
(){
@Test
(
description
=
"
认领回收池
客户总数更新"
,
priority
=
53
)
public
void
认领回收池
客户总数更新
(){
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
totalNum
=
response
.
jsonPath
().
getInt
(
"data.totalNum"
);
...
...
@@ -881,4 +968,24 @@ public class Work implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
PHONE_updateStatus
,
"关闭见面场景失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改客户的产品组"
,
priority
=
75
)
public
void
修改客户产品组
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
params
.
put
(
"companyIds"
,
new
int
[]{
5
,
6
});
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_customer_update
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_customer_update
,
"修改客户的产品组失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询所有产品列表"
,
priority
=
76
)
public
void
查询所有产品列表
(){
Response
response
=
network
.
getResponse
(
BasicConfig
.
MANAGER_product_listAll
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
BasicConfig
.
MANAGER_product_listAll
,
"查看预约列表不为空"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/oto/config/BasicConfig.java
View file @
a8666b27
...
...
@@ -110,6 +110,9 @@ public class BasicConfig {
public
static
final
String
MANAGER_link_fakeUpdate
=
MANAGER_HOST
+
"/kjy/manager/oto/link/mapping/fakeUpdate"
;
public
static
final
String
MANAGER_account_fuzzyByAccountName
=
MANAGER_HOST
+
"/kjy/manager/oto/account/fuzzyByAccountName"
;
public
static
final
String
live_mapping_getTrueLinkInfo
=
MOBILE_HOST
+
"/kjy/live/oto/link/mapping/getTrueLinkInfo"
;
public
static
final
String
MANAGER_custFromSourceList
=
MANAGER_HOST
+
"/kjy/manager/oto/common/custFromSourceList"
;
public
static
final
String
MANAGER_customer_update
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/update"
;
public
static
final
String
MANAGER_product_listAll
=
MANAGER_HOST
+
"/kjy/manager/oto/product/listAll"
;
//*************** OTO销售工作台 ***************
public
static
final
String
WORK_getCaptcha
=
WORK_HOST
+
"/kjy/oto/manager/auth/captcha"
;
...
...
@@ -157,6 +160,9 @@ public class BasicConfig {
public
static
final
String
WORK_modifyTaskConf
=
WORK_HOST
+
"/kjy/oto/manager/sellerTask/modifyTaskConf"
;
public
static
final
String
WORK_statisticHeader
=
WORK_HOST
+
"/kjy/oto/manager/sellerTask/statistic/header"
;
public
static
final
String
WORK_taskDetailsList
=
WORK_HOST
+
"/kjy/oto/manager/sellerTask/taskDetailsList"
;
public
static
final
String
WORK_coefficient_detail
=
WORK_HOST
+
"/kjy/oto/manager/customer/coefficient/detail"
;
public
static
final
String
WORK_customer_detail
=
WORK_HOST
+
"/kjy/oto/manager/customer/claimDetail"
;
public
static
final
String
WORK_customer_claim
=
WORK_HOST
+
"/kjy/oto/manager/customer/claim"
;
//***********************销售工作台手机端**********************
public
static
final
String
PHONE_custConfSave
=
WORK_HOST
+
"/kjy/oto/manager/custconf/save"
;
...
...
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