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
f3a8c6bc
Commit
f3a8c6bc
authored
Mar 03, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更换OTO自动化销售手机号
parent
d8d3a7f0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
31 deletions
+69
-31
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+1
-1
Work.java
src/test/java/com/kjj/cases/otoseller/Work.java
+14
-18
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+54
-12
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
f3a8c6bc
...
@@ -36,7 +36,7 @@ public interface Authorization {
...
@@ -36,7 +36,7 @@ public interface Authorization {
//oto后台销售
//oto后台销售
default
void
otosellerAuth
()
{
default
void
otosellerAuth
()
{
network
.
agentCookies
.
put
(
oto
CookieKey
,
oto
CookieValue
);
network
.
agentCookies
.
put
(
oto
SellerCookieKey
,
otoSeller
CookieValue
);
}
}
...
...
src/test/java/com/kjj/cases/otoseller/Work.java
View file @
f3a8c6bc
...
@@ -21,7 +21,7 @@ public class Work implements Authorization {
...
@@ -21,7 +21,7 @@ public class Work implements Authorization {
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
int
tagId
;
//标签ID
public
int
tagId
;
//标签ID
public
int
custId
;
//客户ID
public
int
custId
;
//客户ID
public
int
collectCustId
=
2
011
;
//客户ID
public
int
collectCustId
=
2
129
;
//客户ID
public
String
name
;
//客户手机号
public
String
name
;
//客户手机号
public
String
phone
;
//客户手机号
public
String
phone
;
//客户手机号
public
int
followTimes
;
//跟进次数
public
int
followTimes
;
//跟进次数
...
@@ -125,7 +125,7 @@ public class Work implements Authorization {
...
@@ -125,7 +125,7 @@ public class Work implements Authorization {
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
String
str
=
String
.
valueOf
(
System
.
currentTimeMillis
());
String
str
=
String
.
valueOf
(
System
.
currentTimeMillis
());
params
.
put
(
"customerId"
,
custId
);
params
.
put
(
"customerId"
,
custId
);
params
.
put
(
"sellerId"
,
23
);
params
.
put
(
"sellerId"
,
35
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_assignSeller
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
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
()));
...
@@ -280,21 +280,16 @@ public class Work implements Authorization {
...
@@ -280,21 +280,16 @@ public class Work implements Authorization {
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_star
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_star
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"标记星标客户失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"标记星标客户失败"
,
response
.
body
().
asString
()));
params
.
put
(
"custId"
,
collectCustId
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_star
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"标记星标客户失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询星标客户更新"
,
priority
=
21
)
@Test
(
description
=
"查询星标客户更新"
,
priority
=
21
)
public
void
查询星标客户更新
(){
public
void
查询星标客户更新
(){
sleep
(
1
000
);
sleep
(
2
000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
starNum
=
response
.
jsonPath
().
getInt
(
"data.starNum"
);
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
(
unContactNum
,
header
.
get
(
"unContactNum"
)-
1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"需要联系客户数量未减1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
starNum
,
header
.
get
(
"starNum"
)+
2
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"星标客户数量未加2"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
starNum
,
header
.
get
(
"starNum"
)+
1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"星标客户数量未加2"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"取消星标用户"
,
priority
=
22
)
@Test
(
description
=
"取消星标用户"
,
priority
=
22
)
...
@@ -305,13 +300,14 @@ public class Work implements Authorization {
...
@@ -305,13 +300,14 @@ public class Work implements Authorization {
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"取消客户星标失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_star
,
"取消客户星标失败"
,
response
.
body
().
asString
()));
sleep
(
1
000
);
sleep
(
2
000
);
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
starNum
=
response
.
jsonPath
().
getInt
(
"data.starNum"
);
int
starNum
=
response
.
jsonPath
().
getInt
(
"data.starNum"
);
int
num
=
header
.
get
(
"unContactNum"
);
int
num1
=
header
.
get
(
"unContactNum"
);
Assert
.
assertEquals
(
starNum
,
header
.
get
(
"starNum"
)+
1
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"星标客户数量未减1"
,
response
.
body
().
asString
()));
int
num2
=
header
.
get
(
"starNum"
);
Assert
.
assertEquals
(
unContactNum
,
num
,
network
.
message
(
BasicConfig
.
WORK_staticHeader
,
"需要联系客户数量未加1"
,
response
.
body
().
asString
()));
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
)
@Test
(
description
=
"修改客户价值"
,
priority
=
23
)
...
@@ -437,7 +433,7 @@ public class Work implements Authorization {
...
@@ -437,7 +433,7 @@ public class Work implements Authorization {
@Test
(
description
=
"客户状态见面为待计划"
,
priority
=
31
)
@Test
(
description
=
"客户状态见面为待计划"
,
priority
=
31
)
public
void
客户状态见面为待计划
(){
public
void
客户状态见面为待计划
(){
sleep
(
1
000
);
sleep
(
2
000
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
Response
response
=
network
.
getResponse
(
BasicConfig
.
WORK_staticHeader
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
unContactNum
=
response
.
jsonPath
().
getInt
(
"data.unContactNum"
);
int
unMeetNum
=
response
.
jsonPath
().
getInt
(
"data.unMeetNum"
);
int
unMeetNum
=
response
.
jsonPath
().
getInt
(
"data.unMeetNum"
);
...
@@ -598,7 +594,7 @@ public class Work implements Authorization {
...
@@ -598,7 +594,7 @@ public class Work implements Authorization {
@Test
(
description
=
"公域引流_关闭销售呼叫权限"
,
priority
=
42
)
@Test
(
description
=
"公域引流_关闭销售呼叫权限"
,
priority
=
42
)
public
void
公域引流
_
关闭销售呼叫权限
(){
public
void
公域引流
_
关闭销售呼叫权限
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
23
);
params
.
put
(
"id"
,
35
);
params
.
put
(
"callPermission"
,
0
);
params
.
put
(
"callPermission"
,
0
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchCallPermissio
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchCallPermissio
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -614,7 +610,7 @@ public class Work implements Authorization {
...
@@ -614,7 +610,7 @@ public class Work implements Authorization {
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_call
,
"关闭呼叫权限后呼叫成功"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_call
,
"关闭呼叫权限后呼叫成功"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
clear
();
params
.
put
(
"id"
,
23
);
params
.
put
(
"id"
,
35
);
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"callPermission"
,
1
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchCallPermissio
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchCallPermissio
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -624,7 +620,7 @@ public class Work implements Authorization {
...
@@ -624,7 +620,7 @@ public class Work implements Authorization {
@Test
(
description
=
"公域引流_禁用销售账号"
,
priority
=
44
)
@Test
(
description
=
"公域引流_禁用销售账号"
,
priority
=
44
)
public
void
公域引流
_
禁用销售账号
(){
public
void
公域引流
_
禁用销售账号
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
23
);
params
.
put
(
"id"
,
35
);
params
.
put
(
"sellerStatus"
,
0
);
params
.
put
(
"sellerStatus"
,
0
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchSellerStatus
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchSellerStatus
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -642,7 +638,7 @@ public class Work implements Authorization {
...
@@ -642,7 +638,7 @@ public class Work implements Authorization {
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_customerList
,
"关闭销售权限后访问成功"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_customerList
,
"关闭销售权限后访问成功"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
clear
();
params
.
put
(
"id"
,
23
);
params
.
put
(
"id"
,
35
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchSellerStatus
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchSellerStatus
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/utils/BaseUtils.java
View file @
f3a8c6bc
...
@@ -25,8 +25,10 @@ public class BaseUtils {
...
@@ -25,8 +25,10 @@ public class BaseUtils {
public
static
String
companyCookieValue
;
public
static
String
companyCookieValue
;
public
static
String
officeCookieKey
;
public
static
String
officeCookieKey
;
public
static
String
officeCookieValue
;
public
static
String
officeCookieValue
;
public
static
String
otoCookieKey
;
public
static
String
otoSellerCookieKey
;
public
static
String
otoCookieValue
;
public
static
String
otoSellerCookieValue
;
public
static
String
otoLeaderCookieKey
;
public
static
String
otoLeaderCookieValue
;
/**
/**
...
@@ -392,20 +394,20 @@ public class BaseUtils {
...
@@ -392,20 +394,20 @@ 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"
,
"1
5136361301
"
);
params
.
put
(
"phoneNumber"
,
"1
8852895892
"
);
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"
,
"1
5136361301
"
);
params
.
put
(
"phoneNumber"
,
"1
8852895892
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCodet
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCodet
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
System
.
out
.
println
(
captcha
);
...
@@ -413,7 +415,7 @@ public class BaseUtils {
...
@@ -413,7 +415,7 @@ public class BaseUtils {
//登录接口
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"1
5136361301
"
);
params
.
put
(
"phoneNumber"
,
"1
8852895892
"
);
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"
);
...
@@ -423,13 +425,53 @@ public class BaseUtils {
...
@@ -423,13 +425,53 @@ public class BaseUtils {
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
(
"="
);
otoCookieKey
=
cookieKeyValue
[
0
];
oto
Seller
CookieKey
=
cookieKeyValue
[
0
];
otoCookieValue
=
cookieKeyValue
[
1
];
oto
Seller
CookieValue
=
cookieKeyValue
[
1
];
// otoCookieKey = "otoToken";
// otoCookieValue = "64e83LYGbaXYX9EkHumCho2Um1GgEB1fbKaZdh8QYa2vxD8xezqsMmAyVvbChD8h3z3q8Gm3UAwoBaXcXRnhmhtg9s4szxELntHRrdut4W9";
network
.
agentCookies
.
put
(
otoCookieKey
,
otoCookieValue
);
//存入cookies
// otoSellerCookieKey = "otoToken";
System
.
out
.
println
(
"销售Cookie中key:"
+
otoCookieKey
+
" ,values:"
+
otoCookieValue
);
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1Gg9q8bFzwARTRumNzN6Rhk6daEZTsjNPH2GeKiTAnfV1uzt6EdwxQw2bkStkifNAc5B5yPWNzS4kEQBCP";
network
.
agentCookies
.
put
(
otoSellerCookieKey
,
otoSellerCookieValue
);
//存入cookies
System
.
out
.
println
(
"销售Cookie中key:"
+
otoSellerCookieKey
+
" ,values:"
+
otoSellerCookieValue
);
}
/**
* 总监登录销售工作台
*/
public
static
void
otoLeaderLogin
(){
ThreadSleepUtils
.
sleep
(
2000
);
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phoneNumber"
,
"13600546247"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
WORK_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"13600546247"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
WORK_verifyCodet
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"13600546247"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
WORK_login
,
"登录失败"
,
loginRes
.
body
().
asString
()));
//获取cookie
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
String
cookieStr
=
header
.
split
(
";"
)[
0
];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
otoLeaderCookieKey
=
cookieKeyValue
[
0
];
otoLeaderCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
otoLeaderCookieKey
,
otoLeaderCookieValue
);
//存入cookies
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