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
8a1fa776
Commit
8a1fa776
authored
Jul 20, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20220720-gxh' into 'master'
1.增加客户系数及来源的测试用例 2.增加产品组的测试用例 See merge request
!17
parents
051c3a6b
a8666b27
Changes
4
Expand all
Hide 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 @
8a1fa776
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
);
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
()));
int
size
=
0
;
int
i
=
1
;
while
(
size
<
1
&&
i
<
10
){
params
.
put
(
"pageIndex"
,
i
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"prodStatus"
,
1
);
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 @
8a1fa776
...
...
@@ -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 @
8a1fa776
This diff is collapsed.
Click to expand it.
src/test/java/com/oto/config/BasicConfig.java
View file @
8a1fa776
...
...
@@ -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