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
4ff158ed
Commit
4ff158ed
authored
Apr 15, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20220415-gxh' into 'master'
Feature/20220415 gxh See merge request test-group/kejiji!245
parents
aaf7f86d
6936e28a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
223 additions
and
259 deletions
+223
-259
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+6
-2
Phone.java
src/test/java/com/kjj/cases/otoseller/Phone.java
+117
-9
Work.java
src/test/java/com/kjj/cases/otoseller/Work.java
+8
-161
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+26
-21
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+66
-66
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
4ff158ed
...
@@ -34,15 +34,19 @@ public interface Authorization {
...
@@ -34,15 +34,19 @@ public interface Authorization {
network
.
agentCookies
.
put
(
officeCookieKey
,
officeCookieValue
);
network
.
agentCookies
.
put
(
officeCookieKey
,
officeCookieValue
);
}
}
//oto
后台
销售
//oto
销售工作台-
销售
default
void
otosellerAuth
()
{
default
void
otosellerAuth
()
{
network
.
agentCookies
.
put
(
otoSellerCookieKey
,
otoSellerCookieValue
);
network
.
agentCookies
.
put
(
otoSellerCookieKey
,
otoSellerCookieValue
);
}
}
//oto
后台
总监
//oto
销售工作台-
总监
default
void
otoLeaderAuth
()
{
default
void
otoLeaderAuth
()
{
network
.
agentCookies
.
put
(
otoLeaderCookieKey
,
otoLeaderCookieValue
);
network
.
agentCookies
.
put
(
otoLeaderCookieKey
,
otoLeaderCookieValue
);
}
}
//oto销售工作台-总监
default
void
otoSellerTku
()
{
network
.
agentCookies
.
put
(
"tku"
,
OTO_TKU
);
}
/**
/**
...
...
src/test/java/com/kjj/cases/otoseller/Phone.java
View file @
4ff158ed
...
@@ -8,6 +8,7 @@ import org.testng.Assert;
...
@@ -8,6 +8,7 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
...
@@ -16,9 +17,14 @@ import static com.kjj.utils.BaseUtils.ssoLogin;
...
@@ -16,9 +17,14 @@ import static com.kjj.utils.BaseUtils.ssoLogin;
public
class
Phone
implements
Authorization
{
public
class
Phone
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
String
cust_id
;
private
String
cust_id
;
private
String
custName
;
private
String
introduceCustomer_id
;
private
String
myselfCustomer_id
;
private
String
interviewId
;
@BeforeTest
@BeforeTest
public
void
setUp
(){
public
void
setUp
(){
//登录销售工作台手机端
//登录销售工作台手机端
otoSellerTku
();
}
}
@Test
(
description
=
"查看我的客户"
,
priority
=
1
)
@Test
(
description
=
"查看我的客户"
,
priority
=
1
)
...
@@ -26,28 +32,130 @@ public class Phone implements Authorization {
...
@@ -26,28 +32,130 @@ public class Phone implements Authorization {
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageSize"
,
"20"
);
params
.
put
(
"pageSize"
,
"20"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_customerList
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_customerList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.
list
.size()"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.
myCustomerVos
.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_customerList
,
"客户列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_customerList
,
"客户列表为空"
,
response
.
body
().
asString
()));
cust_id
=
response
.
jsonPath
().
getString
(
"data.list[0].id"
);
cust_id
=
response
.
jsonPath
().
getString
(
"data.myCustomerVos[0].id"
);
custName
=
response
.
jsonPath
().
getString
(
"data.myCustomerVos[0].custName"
);
}
}
@Test
(
description
=
"查看我的面访"
,
priority
=
1
)
@Test
(
description
=
"查看我的面访"
,
priority
=
2
)
public
void
查看我的面访
(){
public
void
查看我的面访
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageSize"
,
"20"
);
params
.
put
(
"pageSize"
,
"20"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_interviewList
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_interviewList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.
list
.size()"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.
customerInterviewVos
.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewList
,
"面访列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewList
,
"面访列表为空"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"不可创建重复手机号的客户"
,
priority
=
1
)
@Test
(
description
=
"不可创建重复手机号的客户"
,
priority
=
3
)
public
void
不可创建重复手机号的客户
(){
public
void
不可创建重复手机号的客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageSize"
,
"20"
);
params
.
put
(
"custName"
,
"重复客户"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_interviewList
);
params
.
put
(
"custPhoneNum"
,
"13425256464"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
params
.
put
(
"custSource"
,
1
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewList
,
"面访列表为空"
,
response
.
body
().
asString
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_customerSave
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
PHONE_customerSave
,
"手机号重复创建客户成功"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"创建缘故客户"
,
priority
=
4
)
public
void
创建缘故客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custName"
,
"自动化缘故客户"
);
params
.
put
(
"custPhoneNum"
,
"13410000001"
);
params
.
put
(
"custSource"
,
1
);
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
()));
}
@Test
(
description
=
"创建转介绍客户"
,
priority
=
5
)
public
void
创建转介绍客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custName"
,
"自动化转介绍客户"
);
params
.
put
(
"custPhoneNum"
,
"13410000002"
);
params
.
put
(
"introducerId"
,
myselfCustomer_id
);
params
.
put
(
"custSource"
,
2
);
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
()));
}
@Test
(
description
=
"姓名搜索客户"
,
priority
=
6
)
public
void
姓名搜索客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custName"
,
"自动化"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_fuzzyList
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.myCustomerVos.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
PHONE_fuzzyList
,
"创建缘故客户失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"创建普通面访并关联转介绍和缘故客户"
,
priority
=
7
)
public
void
创建普通面访并关联转介绍和缘故客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
ArrayList
ids
=
new
ArrayList
();
params
.
put
(
"custIds"
,
cust_id
+
","
+
myselfCustomer_id
+
","
+
introduceCustomer_id
);
params
.
put
(
"interviewType"
,
1
);
params
.
put
(
"appointmentTime"
,
System
.
currentTimeMillis
()+
3600000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_interviewSave
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"创建普通面访失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"创建普通面访失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"已存在未结束的普通面访后创建普通面访失败"
,
priority
=
1
)
public
void
已存在未结束的普通面访后创建普通面访失败
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custIds"
,
cust_id
+
","
+
myselfCustomer_id
+
","
+
introduceCustomer_id
);
params
.
put
(
"interviewType"
,
1
);
params
.
put
(
"appointmentTime"
,
System
.
currentTimeMillis
()+
3600000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_interviewSave
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"存在未结束普通面访时创建普通面访成功"
,
response
.
body
().
asString
()));
int
size
=
response
.
jsonPath
().
getJsonObject
(
"data.size()"
);
Assert
.
assertEquals
(
size
,
3
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"返回的失败客户ids错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"创建社区面访并关联转介绍和缘故客户"
,
priority
=
1
)
public
void
创建社区面访并关联转介绍和缘故客户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custIds"
,
cust_id
+
","
+
myselfCustomer_id
+
","
+
introduceCustomer_id
);
params
.
put
(
"interviewType"
,
2
);
params
.
put
(
"appointmentTime"
,
System
.
currentTimeMillis
()+
3600000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
PHONE_interviewSave
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"创建社区面访失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
3
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"创建社区面访失败"
,
response
.
body
().
asString
()));
interviewId
=
response
.
jsonPath
().
getString
(
"data[0]"
);
}
@Test
(
description
=
"查询面访详情"
,
priority
=
1
)
public
void
查询面访详情
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custIds"
,
cust_id
);
params
.
put
(
"interviewType"
,
2
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_interviewSave
);
String
customerName
=
response
.
jsonPath
().
getString
(
"data.custName"
);
String
appointmentTime
=
response
.
jsonPath
().
getString
(
"data.appointmentTime"
);
Assert
.
assertEquals
(
customerName
,
custName
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"创建社区面访失败"
,
response
.
body
().
asString
()));
interviewId
=
response
.
jsonPath
().
getString
(
"data[0]"
);
}
@Test
(
description
=
"修改面访时间"
,
priority
=
1
)
public
void
修改面访时间
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
interviewId
);
params
.
put
(
"appointmentTime"
,
System
.
currentTimeMillis
()+
7200000
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
PHONE_interviewSave
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
PHONE_interviewSave
,
"修改社区时间失败"
,
response
.
body
().
asString
()));
interviewId
=
response
.
jsonPath
().
getString
(
"data[0]"
);
}
}
...
...
src/test/java/com/kjj/cases/otoseller/Work.java
View file @
4ff158ed
...
@@ -286,44 +286,6 @@ public class Work implements Authorization {
...
@@ -286,44 +286,6 @@ public class Work implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"标记星标客户失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"标记星标客户失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询星标客户更新"
,
priority
=
21
)
public
void
查询星标客户更新
(){
sleep
(
2000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
starNum
=
response
.
jsonPath
().
getInt
(
"data.starNum"
);
Assert
.
assertEquals
(
unContactNum
,
header
.
get
(
"unContactNum"
)-
1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"需要联系客户数量未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
starNum
,
header
.
get
(
"starNum"
)+
1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"星标客户数量未加2"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"取消星标用户"
,
priority
=
22
)
public
void
取消星标用户
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_star
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"取消客户星标失败"
,
response
.
body
().
asString
()));
sleep
(
2000
);
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
starNum
=
response
.
jsonPath
().
getInt
(
"data.starNum"
);
int
num1
=
header
.
get
(
"unContactNum"
);
int
num2
=
header
.
get
(
"starNum"
);
Assert
.
assertEquals
(
starNum
,
num2
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"星标客户数量未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
unContactNum
,
num1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"需要联系客户数量未加1"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改客户价值"
,
priority
=
23
)
public
void
修改客户价值
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
params
.
put
(
"custValue"
,
200
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_assess
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_assess
,
"修改客户价值失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改客户跟进权重"
,
priority
=
24
)
@Test
(
description
=
"修改客户跟进权重"
,
priority
=
24
)
public
void
修改客户跟进权重
(){
public
void
修改客户跟进权重
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -353,8 +315,6 @@ public class Work implements Authorization {
...
@@ -353,8 +315,6 @@ public class Work implements Authorization {
Assert
.
assertEquals
(
tagSize
,
1
,
network
.
message
(
params
,
BasicConfig
.
WORK_detail
,
"标签数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
tagSize
,
1
,
network
.
message
(
params
,
BasicConfig
.
WORK_detail
,
"标签数量错误"
,
response
.
body
().
asString
()));
int
tId
=
response
.
jsonPath
().
getInt
(
"data.custInfo.tagIds[0]"
);
int
tId
=
response
.
jsonPath
().
getInt
(
"data.custInfo.tagIds[0]"
);
Assert
.
assertEquals
(
tId
,
tagId
,
network
.
message
(
params
,
BasicConfig
.
WORK_detail
,
"标签Id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
tId
,
tagId
,
network
.
message
(
params
,
BasicConfig
.
WORK_detail
,
"标签Id错误"
,
response
.
body
().
asString
()));
int
custValue
=
response
.
jsonPath
().
getInt
(
"data.custInfo.custValue"
);
Assert
.
assertEquals
(
custValue
,
200
,
network
.
message
(
params
,
BasicConfig
.
WORK_detail
,
"客户价值错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"修改标签状态为关闭"
,
priority
=
26
)
@Test
(
description
=
"修改标签状态为关闭"
,
priority
=
26
)
...
@@ -422,105 +382,6 @@ public class Work implements Authorization {
...
@@ -422,105 +382,6 @@ public class Work implements Authorization {
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
BasicConfig
.
WORK_tagList
,
"跟进表格数量为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
BasicConfig
.
WORK_tagList
,
"跟进表格数量为空"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"完成今日见面"
,
priority
=
30
)
public
void
完成今日见面
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
params
.
put
(
"commitPlanFlag"
,
0
);
params
.
put
(
"custValue"
,
102
);
params
.
put
(
"followWeight"
,
2
);
params
.
put
(
"meetRemark"
,
"今日见面的备注"
+
new
Date
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_meet
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_meet
,
"完成今日见面失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"客户状态见面为待计划"
,
priority
=
31
)
public
void
客户状态见面为待计划
(){
sleep
(
2000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
unMeetNum
=
response
.
jsonPath
().
getInt
(
"data.unMeetNum"
);
int
num
=
header
.
get
(
"unMeetNum"
);
Assert
.
assertEquals
(
unContactNum
,
header
.
get
(
"unContactNum"
)-
1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"需要联系客户数量未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
unMeetNum
,
num
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"需要约见客户数量变化"
,
response
.
body
().
asString
()));
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticChart
);
int
needContact
=
response
.
jsonPath
().
getInt
(
"data[0].custNum"
);
int
needMeet
=
response
.
jsonPath
().
getInt
(
"data[1].custNum"
);
int
commitPlan
=
response
.
jsonPath
().
getInt
(
"data[2].custNum"
);
num
=
chart
.
get
(
"needMeet"
);
Assert
.
assertEquals
(
needContact
,
chart
.
get
(
"needContact"
)-
1
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"需要联系客户未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
needMeet
,
num
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"需要约见客户数量变化"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
commitPlan
,
chart
.
get
(
"commitPlan"
)+
1
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"要发计划书客户未加1"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"预约参观"
,
priority
=
32
)
public
void
预约参观
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
params
.
put
(
"coreMaker"
,
1
);
params
.
put
(
"ideaAgree"
,
1
);
params
.
put
(
"insApplicant"
,
4
);
params
.
put
(
"insByApplicant"
,
4
);
params
.
put
(
"insMoney"
,
500
);
params
.
put
(
"insPeriod"
,
20
);
params
.
put
(
"orderVisitTime"
,
System
.
currentTimeMillis
()-
86400000
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_order
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_order
,
"完成今日见面失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"见面并预约后更新客户见面情况"
,
priority
=
33
)
public
void
见面并预约后更新客户见面情况
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_info
);
boolean
todayMeetFlag
=
response
.
jsonPath
().
getBoolean
(
"data.todayMeetFlag"
);
boolean
orderVisitFlag
=
response
.
jsonPath
().
getBoolean
(
"data.orderVisitFlag"
);
Object
orderVisitDate
=
response
.
jsonPath
().
getJsonObject
(
"data.todayMeetFlag"
);
Assert
.
assertTrue
(
todayMeetFlag
,
network
.
message
(
params
,
BasicConfig
.
WORK_info
,
"今日见面状态错误:为未见面"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
orderVisitFlag
,
network
.
message
(
params
,
BasicConfig
.
WORK_info
,
"预约参观状态错误:为未预约"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
orderVisitDate
,
network
.
message
(
params
,
BasicConfig
.
WORK_info
,
"预约时间为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"上传参观详情"
,
priority
=
34
)
public
void
上传参观详情
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
params
.
put
(
"commitPlanFlag"
,
1
);
params
.
put
(
"commitCustStatus"
,
1
);
params
.
put
(
"custValue"
,
201
);
params
.
put
(
"followWeight"
,
2
);
params
.
put
(
"visitRemark"
,
"今日参观的备注"
+
new
Date
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_feedback
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_feedback
,
"上传参观详情失败失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"上传参观详情后更新客户见面情况"
,
priority
=
35
)
public
void
上传参观详情后更新客户见面情况
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
custId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_info
);
boolean
todayMeetFlag
=
response
.
jsonPath
().
getBoolean
(
"data.todayMeetFlag"
);
boolean
orderVisitFlag
=
response
.
jsonPath
().
getBoolean
(
"data.orderVisitFlag"
);
Object
orderVisitDate
=
response
.
jsonPath
().
getJsonObject
(
"data.orderVisitDate"
);
Assert
.
assertTrue
(
todayMeetFlag
,
network
.
message
(
params
,
BasicConfig
.
WORK_info
,
"今日见面状态错误:为未见面"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
orderVisitFlag
,
network
.
message
(
params
,
BasicConfig
.
WORK_info
,
"预约参观状态错误:为已预约"
,
response
.
body
().
asString
()));
Assert
.
assertNull
(
orderVisitDate
,
network
.
message
(
params
,
BasicConfig
.
WORK_info
,
"预约时间不为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"客户状态见面为待促成"
,
priority
=
36
)
public
void
客户状态见面为待促成
(){
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticChart
);
int
commitPlan
=
response
.
jsonPath
().
getInt
(
"data[2].custNum"
);
int
toFacilitate
=
response
.
jsonPath
().
getInt
(
"data[3].custNum"
);
int
num
=
chart
.
get
(
"commitPlan"
);
Assert
.
assertEquals
(
commitPlan
,
num
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"要发计划书客户未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
toFacilitate
,
chart
.
get
(
"toFacilitate"
)+
1
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"待促成客户未加1"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改客户基础信息"
,
priority
=
37
)
@Test
(
description
=
"修改客户基础信息"
,
priority
=
37
)
public
void
修改客户基础信息
(){
public
void
修改客户基础信息
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -549,17 +410,6 @@ public class Work implements Authorization {
...
@@ -549,17 +410,6 @@ public class Work implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_edit
,
"修改客户基础信息失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_edit
,
"修改客户基础信息失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"客户状态见面为已成单"
,
priority
=
38
)
public
void
客户状态见面为已成单
(){
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticChart
);
int
toFacilitate
=
response
.
jsonPath
().
getInt
(
"data[3].custNum"
);
int
completedOrder
=
response
.
jsonPath
().
getInt
(
"data[4].custNum"
);
int
num
=
chart
.
get
(
"toFacilitate"
);
Assert
.
assertEquals
(
toFacilitate
,
num
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"待促成客户未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
completedOrder
,
chart
.
get
(
"completedOrder"
)+
1
,
network
.
message
(
BasicConfig
.
WORK_staticChart
,
"已成单客户未加1"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看客户动态"
,
priority
=
39
)
@Test
(
description
=
"查看客户动态"
,
priority
=
39
)
public
void
查看客户动态
(){
public
void
查看客户动态
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -567,7 +417,7 @@ public class Work implements Authorization {
...
@@ -567,7 +417,7 @@ public class Work implements Authorization {
params
.
put
(
"logDays"
,
1
);
params
.
put
(
"logDays"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_operation
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_operation
);
int
logSize
=
response
.
jsonPath
().
getInt
(
"data.list[0].dayLog.size()"
);
int
logSize
=
response
.
jsonPath
().
getInt
(
"data.list[0].dayLog.size()"
);
Assert
.
assert
Equals
(
logSize
,
13
,
network
.
message
(
params
,
BasicConfig
.
WORK_operation
,
"客户动态条数错误"
,
response
.
body
().
asString
()));
Assert
.
assert
True
(
logSize
>
0
,
network
.
message
(
params
,
BasicConfig
.
WORK_operation
,
"客户动态条数错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"姓名模糊查找客户"
,
priority
=
40
)
@Test
(
description
=
"姓名模糊查找客户"
,
priority
=
40
)
...
@@ -669,19 +519,15 @@ public class Work implements Authorization {
...
@@ -669,19 +519,15 @@ public class Work implements Authorization {
Assert
.
assertTrue
(
answer
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_customerPhone
,
"问题详情为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
answer
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_customerPhone
,
"问题详情为空"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"
回收2C星标客户
"
,
priority
=
48
)
@Test
(
description
=
"
放弃客户进入回收池
"
,
priority
=
48
)
public
void
回收
2
C
客户
(){
public
void
放弃客户进入回收池
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
collectCustId
);
params
.
put
(
"custId"
,
collectCustId
);
params
.
put
(
"commitPlanFlag"
,
0
);
params
.
put
(
"abandonReasonType"
,
3
);
params
.
put
(
"custValue"
,
202
);
params
.
put
(
"abandonRemark"
,
"放弃原因"
+
new
Date
());
params
.
put
(
"followWeight"
,
3
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_abandonCust
);
params
.
put
(
"giveUpReason"
,
2
);
params
.
put
(
"giveUpRemark"
,
"因自己原因我不想跟了"
);
params
.
put
(
"meetRemark"
,
"今日见面的备注"
+
new
Date
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_meet
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_
meet
,
"完成今日见面
失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_
abandonCust
,
"放弃客户
失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询投放池刷新配置"
,
priority
=
49
)
@Test
(
description
=
"查询投放池刷新配置"
,
priority
=
49
)
...
@@ -715,6 +561,7 @@ public class Work implements Authorization {
...
@@ -715,6 +561,7 @@ public class Work implements Authorization {
@Test
(
description
=
"认领回收池客户"
,
priority
=
52
)
@Test
(
description
=
"认领回收池客户"
,
priority
=
52
)
public
void
认领回收池客户
(){
public
void
认领回收池客户
(){
sleep
(
2000
);
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"custId"
,
collectCustId
);
params
.
put
(
"custId"
,
collectCustId
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_claim
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_claim
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
4ff158ed
...
@@ -113,6 +113,9 @@ public class BasicConfig {
...
@@ -113,6 +113,9 @@ public class BasicConfig {
public
static
final
String
openId2
=
"osi5w5pEY4SxORlLJEE4FkyxQ9E4"
;
public
static
final
String
openId2
=
"osi5w5pEY4SxORlLJEE4FkyxQ9E4"
;
/*******OTO销售工作台*********/
public
static
final
String
OTO_TKU
=
"2RA3RVc1LEF7SnuZg7qu8kr9mx4BEQcUy3ZmGw6EcESNTGXj1XP9rtChjMmfcnvfeQzPijhA2sbAWvYHchwK9o9b1GtjMLwvmUpJ1PdC57Y1yGJLynbr3FZ3YLURN35f9CE7sFhm3CrqT5FTo4tjpxD"
;
// *************** 客集集域名 ***************
// *************** 客集集域名 ***************
public
static
final
String
HOST
=
"https://kjj.m.duibatest.com.cn"
;
public
static
final
String
HOST
=
"https://kjj.m.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST
=
"https://kjj-activity.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST
=
"https://kjj-activity.duibatest.com.cn"
;
...
@@ -123,6 +126,7 @@ public class BasicConfig {
...
@@ -123,6 +126,7 @@ public class BasicConfig {
public
static
final
String
CORP_HOST
=
"https://kjj-corp.duibatest.com.cn"
;
public
static
final
String
CORP_HOST
=
"https://kjj-corp.duibatest.com.cn"
;
public
static
final
String
WORK_HOST
=
"https://kjj-work.duibatest.com.cn"
;
public
static
final
String
WORK_HOST
=
"https://kjj-work.duibatest.com.cn"
;
public
static
final
String
FORM_HOST
=
"https://kjj-static.duibatest.com.cn"
;
public
static
final
String
FORM_HOST
=
"https://kjj-static.duibatest.com.cn"
;
public
static
final
String
PHONE_HOST
=
"https://kjj-auth.duibatest.com.cn"
;
// *************** 开启&结束直播 ***************
// *************** 开启&结束直播 ***************
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
...
@@ -1364,27 +1368,28 @@ public class BasicConfig {
...
@@ -1364,27 +1368,28 @@ public class BasicConfig {
public
static
final
String
WORK_switchWorkStatus
=
WORK_HOST
+
"/kjy/oto/manager/attendance/switchWorkStatus"
;
public
static
final
String
WORK_switchWorkStatus
=
WORK_HOST
+
"/kjy/oto/manager/attendance/switchWorkStatus"
;
public
static
final
String
WORK_saveOrModifySchedule
=
WORK_HOST
+
"/kjy/oto/manager/sellerNotify/saveOrModifySchedule"
;
public
static
final
String
WORK_saveOrModifySchedule
=
WORK_HOST
+
"/kjy/oto/manager/sellerNotify/saveOrModifySchedule"
;
public
static
final
String
WORK_cancelSchedule
=
WORK_HOST
+
"/kjy/oto/manager/sellerNotify/cancelSchedule"
;
public
static
final
String
WORK_cancelSchedule
=
WORK_HOST
+
"/kjy/oto/manager/sellerNotify/cancelSchedule"
;
public
static
final
String
WORK_abandonCust
=
WORK_HOST
+
"/kjy/oto/manager/customer/abandonCust"
;
public
static
final
String
PHONE_customerList
=
MOBILE_HOST
+
"kjy/oto/customer/list"
;
public
static
final
String
PHONE_customerSave
=
MOBILE_HOST
+
"kjy/oto/customer/introduce/save"
;
public
static
final
String
PHONE_customerList
=
PHONE_HOST
+
"/kjy/oto/manager/customer/list"
;
public
static
final
String
PHONE_appointmentDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/appointment/detail"
;
public
static
final
String
PHONE_customerSave
=
PHONE_HOST
+
"/kjy/oto/customer/introduce/save"
;
public
static
final
String
PHONE_fuzzyList
=
MOBILE_HOST
+
"/kjy/oto/cust/fuzzy/list"
;
public
static
final
String
PHONE_appointmentDetail
=
PHONE_HOST
+
"/kjy/oto/interview/appointment/detail"
;
public
static
final
String
PHONE_interviewSave
=
MOBILE_HOST
+
"/kjy/oto/interview/save"
;
public
static
final
String
PHONE_fuzzyList
=
PHONE_HOST
+
"/kjy/oto/cust/fuzzy/list"
;
public
static
final
String
PHONE_interviewUpdate
=
MOBILE_HOST
+
"/kjy/oto/interview/appointment/update"
;
public
static
final
String
PHONE_interviewSave
=
PHONE_HOST
+
"/kjy/oto/interview/save"
;
public
static
final
String
PHONE_interviewList
=
MOBILE_HOST
+
"/kjy/oto/interview/list"
;
public
static
final
String
PHONE_interviewUpdate
=
PHONE_HOST
+
"/kjy/oto/interview/appointment/update"
;
public
static
final
String
PHONE_interviewCancel
=
MOBILE_HOST
+
"/kjy/oto/interview/cancel"
;
public
static
final
String
PHONE_interviewList
=
PHONE_HOST
+
"/kjy/oto/interview/list"
;
public
static
final
String
PHONE_interviewCode
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/code"
;
public
static
final
String
PHONE_interviewCancel
=
PHONE_HOST
+
"/kjy/oto/interview/cancel"
;
public
static
final
String
PHONE_interviewStatus
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/status"
;
public
static
final
String
PHONE_interviewCode
=
PHONE_HOST
+
"/kjy/oto/h5/interview/code"
;
public
static
final
String
PHONE_interviewPhone
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/phone"
;
public
static
final
String
PHONE_interviewStatus
=
PHONE_HOST
+
"/kjy/oto/h5/interview/status"
;
public
static
final
String
PHONE_interviewBind
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/bind"
;
public
static
final
String
PHONE_interviewPhone
=
PHONE_HOST
+
"/kjy/oto/h5/interview/phone"
;
public
static
final
String
PHONE_bindCancel
=
MOBILE_HOST
+
"/kjy/oto/h5/interview/cancel"
;
public
static
final
String
PHONE_interviewBind
=
PHONE_HOST
+
"/kjy/oto/h5/interview/bind"
;
public
static
final
String
PHONE_feedbackDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/feedback/detail"
;
public
static
final
String
PHONE_bindCancel
=
PHONE_HOST
+
"/kjy/oto/h5/interview/cancel"
;
public
static
final
String
PHONE_custExtDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/custExtDetail"
;
public
static
final
String
PHONE_feedbackDetail
=
PHONE_HOST
+
"/kjy/oto/interview/feedback/detail"
;
public
static
final
String
PHONE_interviewFeedback
=
MOBILE_HOST
+
"/kjy/oto/interview/feedback"
;
public
static
final
String
PHONE_custExtDetail
=
PHONE_HOST
+
"/kjy/oto/interview/custExtDetail"
;
public
static
final
String
PHONE_interviewDetail
=
MOBILE_HOST
+
"/kjy/oto/interview/edit/detail"
;
public
static
final
String
PHONE_interviewFeedback
=
PHONE_HOST
+
"/kjy/oto/interview/feedback"
;
public
static
final
String
PHONE_authPhone
=
MOBILE_HOST
+
"/auth/oto/authPhone"
;
public
static
final
String
PHONE_interviewDetail
=
PHONE_HOST
+
"/kjy/oto/interview/edit/detail"
;
public
static
final
String
PHONE_getAuthPhone
=
MOBILE_HOST
+
"/auth/oto/getAuthPhone"
;
public
static
final
String
PHONE_authPhone
=
PHONE_HOST
+
"/auth/oto/authPhone"
;
public
static
final
String
PHONE_submitEvaluate
=
MOBILE_HOST
+
"/kjy/oto/interview/submitEvaluate"
;
public
static
final
String
PHONE_getAuthPhone
=
PHONE_HOST
+
"/auth/oto/getAuthPhone"
;
public
static
final
String
PHONE_submitEvaluate
=
PHONE_HOST
+
"/kjy/oto/interview/submitEvaluate"
;
public
static
final
String
WORK_verifyCode
=
WORK_HOST
+
"/kjy/oto/auto/test/verifyCode"
;
public
static
final
String
WORK_verifyCode
=
WORK_HOST
+
"/kjy/oto/auto/test/verifyCode"
;
public
static
final
String
WORK_delCust
=
WORK_HOST
+
"/kjy/oto/auto/test/delCust"
;
public
static
final
String
WORK_delCust
=
WORK_HOST
+
"/kjy/oto/auto/test/delCust"
;
...
...
src/test/java/com/kjj/utils/BaseUtils.java
View file @
4ff158ed
...
@@ -397,39 +397,39 @@ public class BaseUtils {
...
@@ -397,39 +397,39 @@ public class BaseUtils {
* 普通销售员登录销售工作台
* 普通销售员登录销售工作台
*/
*/
public
static
void
otoSellerLogin
(){
public
static
void
otoSellerLogin
(){
ThreadSleepUtils
.
sleep
(
2000
);
//
ThreadSleepUtils.sleep(2000);
// 调用登录接口
//
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//
Map<String, Object> params = new HashMap<String, Object>();
params
.
put
(
"phoneNumber"
,
"18248405155"
);
//
params.put("phoneNumber","18248405155");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_getCaptcha
);
//
Response response = network.getResponse(params,BasicConfig.WORK_getCaptcha);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
//
boolean data = response.jsonPath().getBoolean("data");
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_getCaptcha,"获取验证码失败",response.body().asString()));
//
//专用于自动化获取验证码
//
//专用于自动化获取验证码
params
.
clear
();
//
params.clear();
params
.
put
(
"phoneNumber"
,
"18248405155"
);
//
params.put("phoneNumber","18248405155");
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCode
);
//
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCode);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
//
String captcha = autoTestRes.jsonPath().getString("data");
System
.
out
.
println
(
captcha
);
//
System.out.println(captcha);
//
//登录接口
//
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
//
ThreadSleepUtils.sleep(2000);
params
.
clear
();
//
params.clear();
params
.
put
(
"phoneNumber"
,
"18248405155"
);
//
params.put("phoneNumber","18248405155");
params
.
put
(
"captcha"
,
captcha
);
//
params.put("captcha",captcha);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_login
);
//
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
//
boolean success = loginRes.jsonPath().getBoolean("success");
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_login
,
"登录失败"
,
loginRes
.
body
().
asString
()));
//
Assert.assertTrue(success, network.message(params,BasicConfig.WORK_login,"登录失败",loginRes.body().asString()));
//
//获取cookie
//
//获取cookie
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
//
String header = loginRes.getHeader("Set-Cookie");
String
cookieStr
=
header
.
split
(
";"
)[
0
];
//
String cookieStr = header.split(";")[0];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
//
String[] cookieKeyValue = cookieStr.split("=");
otoSellerCookieKey
=
cookieKeyValue
[
0
];
//
otoSellerCookieKey = cookieKeyValue[0];
otoSellerCookieValue
=
cookieKeyValue
[
1
];
//
otoSellerCookieValue = cookieKeyValue[1];
//
otoSellerCookieKey = "otoToken";
otoSellerCookieKey
=
"otoToken"
;
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1H6zBcWkw5JtD5N2YjRB7RFmU6uG7ziBmmBWwsRz2uLkFruaQMtPTc4XJVhTmCWQmdZCYvYzyru4GEVxxw
";
otoSellerCookieValue
=
"64e83LYGbaXYX9EkHumCho2UoH8aSt1iNbLHnmfaSV2jr8ETfxRuoJDrf1BZPbbs1Yk6aVV72S79rq975KDpb89MCUYK84cdTpu7j2k2tT9
"
;
network
.
agentCookies
.
put
(
otoSellerCookieKey
,
otoSellerCookieValue
);
//存入cookies
network
.
agentCookies
.
put
(
otoSellerCookieKey
,
otoSellerCookieValue
);
//存入cookies
System
.
out
.
println
(
"销售Cookie中key:"
+
otoSellerCookieKey
+
" ,values:"
+
otoSellerCookieValue
);
System
.
out
.
println
(
"销售Cookie中key:"
+
otoSellerCookieKey
+
" ,values:"
+
otoSellerCookieValue
);
...
@@ -439,39 +439,39 @@ public class BaseUtils {
...
@@ -439,39 +439,39 @@ public class BaseUtils {
* 总监登录销售工作台
* 总监登录销售工作台
*/
*/
public
static
void
otoLeaderLogin
(){
public
static
void
otoLeaderLogin
(){
ThreadSleepUtils
.
sleep
(
2000
);
//
ThreadSleepUtils.sleep(2000);
// 调用登录接口
//
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//
Map<String, Object> params = new HashMap<String, Object>();
params
.
put
(
"phoneNumber"
,
"13454131091"
);
//
params.put("phoneNumber","13454131091");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_getCaptcha
);
//
Response response = network.getResponse(params,BasicConfig.WORK_getCaptcha);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
//
boolean data = response.jsonPath().getBoolean("data");
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_getCaptcha,"获取验证码失败",response.body().asString()));
//
//专用于自动化获取验证码
//
//专用于自动化获取验证码
params
.
clear
();
//
params.clear();
params
.
put
(
"phoneNumber"
,
"13454131091"
);
//
params.put("phoneNumber","13454131091");
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCode
);
//
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCode);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
//
String captcha = autoTestRes.jsonPath().getString("data");
System
.
out
.
println
(
captcha
);
//
System.out.println(captcha);
//
//登录接口
//
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
//
ThreadSleepUtils.sleep(2000);
params
.
clear
();
//
params.clear();
params
.
put
(
"phoneNumber"
,
"13454131091"
);
//
params.put("phoneNumber","13454131091");
params
.
put
(
"captcha"
,
captcha
);
//
params.put("captcha",captcha);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_login
);
//
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
//
boolean success = loginRes.jsonPath().getBoolean("success");
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_login
,
"登录失败"
,
loginRes
.
body
().
asString
()));
//
Assert.assertTrue(success, network.message(params,BasicConfig.WORK_login,"登录失败",loginRes.body().asString()));
//
//获取cookie
//
//获取cookie
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
//
String header = loginRes.getHeader("Set-Cookie");
String
cookieStr
=
header
.
split
(
";"
)[
0
];
//
String cookieStr = header.split(";")[0];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
//
String[] cookieKeyValue = cookieStr.split("=");
otoLeaderCookieKey
=
cookieKeyValue
[
0
];
//
otoLeaderCookieKey = cookieKeyValue[0];
otoLeaderCookieValue
=
cookieKeyValue
[
1
];
//
otoLeaderCookieValue = cookieKeyValue[1];
//
otoLeaderCookieKey = "otoToken";
otoLeaderCookieKey
=
"otoToken"
;
// otoLeaderCookieValue = "64e83LYGbaXYX9EkHumCho2Um1H6zBcWhBxmWqfu76gC91GAkfnauguistbDFNVTyYSWjjEpQURiMofMzYTYYbBWC2BA95ZJBjKDaspWvRE
";
otoLeaderCookieValue
=
"64e83LYGbaXYX9EkHumCho2UoH8aSt1h9XNrE7BVfevqad7zFZkGt5R98Bi4R5Ri6TjQisprFL8kUvtkrzcokSzMXukDGMSkcfr6UzHxPJU
"
;
network
.
agentCookies
.
put
(
otoLeaderCookieKey
,
otoLeaderCookieValue
);
//存入cookies
network
.
agentCookies
.
put
(
otoLeaderCookieKey
,
otoLeaderCookieValue
);
//存入cookies
System
.
out
.
println
(
"总监Cookie中key:"
+
otoLeaderCookieKey
+
" ,values:"
+
otoLeaderCookieValue
);
System
.
out
.
println
(
"总监Cookie中key:"
+
otoLeaderCookieKey
+
" ,values:"
+
otoLeaderCookieValue
);
...
...
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