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
dec2e803
Commit
dec2e803
authored
Mar 10, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换自动化角色手机号
parent
191b78a0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
35 deletions
+42
-35
Enterprise.java
...t/java/com/kjj/cases/assistant/enterprise/Enterprise.java
+1
-1
Manager.java
src/test/java/com/kjj/cases/otoseller/Manager.java
+10
-9
Work.java
src/test/java/com/kjj/cases/otoseller/Work.java
+9
-8
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+5
-0
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+17
-17
No files found.
src/test/java/com/kjj/cases/assistant/enterprise/Enterprise.java
View file @
dec2e803
...
@@ -43,7 +43,7 @@ public class Enterprise implements Authorization {
...
@@ -43,7 +43,7 @@ public class Enterprise implements Authorization {
Response
comListRes
=
network
.
getResponse
(
BasicConfig
.
CORP_listSimple
);
Response
comListRes
=
network
.
getResponse
(
BasicConfig
.
CORP_listSimple
);
Object
dataRes
=
comListRes
.
jsonPath
().
getJsonObject
(
"data.size()"
);
Object
dataRes
=
comListRes
.
jsonPath
().
getJsonObject
(
"data.size()"
);
Object
data
=
comListRes
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
comListRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertEquals
(
dataRes
,
2
,
network
.
message
(
BasicConfig
.
CORP_listSimple
,
"获取公司列表个数错误"
,
comListRes
.
body
().
asString
()));
Assert
.
assertEquals
(
dataRes
,
1
,
network
.
message
(
BasicConfig
.
CORP_listSimple
,
"获取公司列表个数错误"
,
comListRes
.
body
().
asString
()));
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
}
}
...
...
src/test/java/com/kjj/cases/otoseller/Manager.java
View file @
dec2e803
...
@@ -8,13 +8,14 @@ import org.testng.annotations.BeforeTest;
...
@@ -8,13 +8,14 @@ import org.testng.annotations.BeforeTest;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
LEADER_ID
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
public
class
Manager
{
public
class
Manager
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
int
sellerId
;
private
int
sellerId
;
//销售ID
@BeforeTest
@BeforeTest
public
void
setUp
(){
public
void
setUp
(){
ssoLogin
();
ssoLogin
();
...
@@ -29,7 +30,7 @@ public class Manager {
...
@@ -29,7 +30,7 @@ public class Manager {
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
,
"销售列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_sellerList
,
"销售列表为空"
,
response
.
body
().
asString
()));
int
workStatus
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
4
0
+
"}.workStatus"
);
int
workStatus
=
response
.
jsonPath
().
getInt
(
"data.list.find{it.id == "
+
4
2
+
"}.workStatus"
);
Assert
.
assertEquals
(
workStatus
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"工作状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
workStatus
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_oto_searchSeller
,
"工作状态错误"
,
response
.
body
().
asString
()));
}
}
...
@@ -49,7 +50,7 @@ public class Manager {
...
@@ -49,7 +50,7 @@ public class Manager {
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
sellerId
);
params
.
put
(
"id"
,
sellerId
);
params
.
put
(
"sellerName"
,
"勿动-自动化更新销售"
);
params
.
put
(
"sellerName"
,
"勿动-自动化更新销售"
);
params
.
put
(
"phoneNumber"
,
"18
852895892
"
);
params
.
put
(
"phoneNumber"
,
"18
248405155
"
);
params
.
put
(
"roleType"
,
1
);
params
.
put
(
"roleType"
,
1
);
params
.
put
(
"callPermission"
,
0
);
params
.
put
(
"callPermission"
,
0
);
params
.
put
(
"sellerStatus"
,
0
);
params
.
put
(
"sellerStatus"
,
0
);
...
@@ -65,7 +66,7 @@ public class Manager {
...
@@ -65,7 +66,7 @@ public class Manager {
sleep
(
1000
);
sleep
(
1000
);
HashMap
<
String
,
Object
>
selectParam
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
selectParam
=
new
HashMap
<>();
selectParam
.
put
(
"sellerName"
,
"勿动-自动化更新销售"
);
selectParam
.
put
(
"sellerName"
,
"勿动-自动化更新销售"
);
selectParam
.
put
(
"phoneNumber"
,
"18
852895892
"
);
selectParam
.
put
(
"phoneNumber"
,
"18
248405155
"
);
selectParam
.
put
(
"pageIndex"
,
"1"
);
selectParam
.
put
(
"pageIndex"
,
"1"
);
selectParam
.
put
(
"pageSize"
,
"10"
);
selectParam
.
put
(
"pageSize"
,
"10"
);
response
=
network
.
getResponse
(
selectParam
,
BasicConfig
.
MANAGER_oto_sellerList
);
response
=
network
.
getResponse
(
selectParam
,
BasicConfig
.
MANAGER_oto_sellerList
);
...
@@ -77,7 +78,7 @@ public class Manager {
...
@@ -77,7 +78,7 @@ public class Manager {
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"companyId"
,
5
);
params
.
put
(
"companyId"
,
5
);
params
.
put
(
"sellerLevel"
,
1
);
params
.
put
(
"sellerLevel"
,
1
);
params
.
put
(
"parentId"
,
36
);
params
.
put
(
"parentId"
,
LEADER_ID
);
params
.
put
(
"sellerName"
,
"勿动-自动化测试销售"
);
params
.
put
(
"sellerName"
,
"勿动-自动化测试销售"
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updateSeller
);
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_updateSeller
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
@@ -94,8 +95,8 @@ public class Manager {
...
@@ -94,8 +95,8 @@ public class Manager {
@Test
(
description
=
"不可新增同一手机号销售"
,
priority
=
5
)
@Test
(
description
=
"不可新增同一手机号销售"
,
priority
=
5
)
public
void
不可新增同一手机号销售
(){
public
void
不可新增同一手机号销售
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerName"
,
"勿动-自动化
更新
销售"
);
params
.
put
(
"sellerName"
,
"勿动-自动化销售"
);
params
.
put
(
"phoneNumber"
,
"18
852895892
"
);
params
.
put
(
"phoneNumber"
,
"18
248405155
"
);
params
.
put
(
"roleType"
,
1
);
params
.
put
(
"roleType"
,
1
);
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"callPermission"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
params
.
put
(
"sellerStatus"
,
1
);
...
@@ -109,7 +110,7 @@ public class Manager {
...
@@ -109,7 +110,7 @@ public class Manager {
@Test
(
description
=
"不可修改总监为普通"
,
priority
=
6
)
@Test
(
description
=
"不可修改总监为普通"
,
priority
=
6
)
public
void
不可修改总监为普通
(){
public
void
不可修改总监为普通
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
40
);
params
.
put
(
"id"
,
LEADER_ID
);
params
.
put
(
"sellerName"
,
"勿动-自动化测试销售"
);
params
.
put
(
"sellerName"
,
"勿动-自动化测试销售"
);
params
.
put
(
"phoneNumber"
,
"18852895892"
);
params
.
put
(
"phoneNumber"
,
"18852895892"
);
params
.
put
(
"roleType"
,
3
);
params
.
put
(
"roleType"
,
3
);
...
@@ -176,7 +177,7 @@ public class Manager {
...
@@ -176,7 +177,7 @@ public class Manager {
@Test
(
description
=
"修改工作状态为请假中"
,
priority
=
12
)
@Test
(
description
=
"修改工作状态为请假中"
,
priority
=
12
)
public
void
修改工作状态为请假中
(){
public
void
修改工作状态为请假中
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerId"
,
36
);
params
.
put
(
"sellerId"
,
LEADER_ID
);
params
.
put
(
"workStatus"
,
0
);
params
.
put
(
"workStatus"
,
0
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchWorkStatus
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_oto_switchWorkStatus
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/cases/otoseller/Work.java
View file @
dec2e803
...
@@ -14,6 +14,7 @@ import java.util.Date;
...
@@ -14,6 +14,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLER_ID
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.*;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
...
@@ -126,7 +127,7 @@ public class Work implements Authorization {
...
@@ -126,7 +127,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"
,
40
);
params
.
put
(
"sellerId"
,
SELLER_ID
);
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
()));
...
@@ -147,8 +148,8 @@ public class Work implements Authorization {
...
@@ -147,8 +148,8 @@ public class Work implements Authorization {
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
BasicConfig
.
WORK_notifyList
,
"通知栏不为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
1
,
network
.
message
(
BasicConfig
.
WORK_notifyList
,
"通知栏不为空"
,
response
.
body
().
asString
()));
int
notifyType
=
response
.
jsonPath
().
getInt
(
"data[0].notifyType"
);
int
notifyType
=
response
.
jsonPath
().
getInt
(
"data[0].notifyType"
);
int
custCount
=
response
.
jsonPath
().
getInt
(
"data[0].custCount"
);
int
custCount
=
response
.
jsonPath
().
getInt
(
"data[0].custCount"
);
Assert
.
assertEquals
(
custCount
,
1
,
network
.
message
(
BasicConfig
.
WORK_notifyList
,
"
通知栏不为空
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custCount
,
1
,
network
.
message
(
BasicConfig
.
WORK_notifyList
,
"
客户数量错误
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
notifyType
,
2
,
network
.
message
(
BasicConfig
.
WORK_notifyList
,
"通知栏
不为空
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
notifyType
,
2
,
network
.
message
(
BasicConfig
.
WORK_notifyList
,
"通知栏
类型错误
"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"客户状态分类_数量总览"
,
priority
=
9
)
@Test
(
description
=
"客户状态分类_数量总览"
,
priority
=
9
)
...
@@ -596,7 +597,7 @@ public class Work implements Authorization {
...
@@ -596,7 +597,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"
,
40
);
params
.
put
(
"id"
,
SELLER_ID
);
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"
);
...
@@ -612,7 +613,7 @@ public class Work implements Authorization {
...
@@ -612,7 +613,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"
,
40
);
params
.
put
(
"id"
,
SELLER_ID
);
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"
);
...
@@ -622,7 +623,7 @@ public class Work implements Authorization {
...
@@ -622,7 +623,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"
,
40
);
params
.
put
(
"id"
,
SELLER_ID
);
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"
);
...
@@ -640,7 +641,7 @@ public class Work implements Authorization {
...
@@ -640,7 +641,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"
,
40
);
params
.
put
(
"id"
,
SELLER_ID
);
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"
);
...
@@ -754,7 +755,7 @@ public class Work implements Authorization {
...
@@ -754,7 +755,7 @@ public class Work implements Authorization {
@Test
(
description
=
"总监修改名下销售工作状态"
,
priority
=
56
)
@Test
(
description
=
"总监修改名下销售工作状态"
,
priority
=
56
)
public
void
总监修改名下销售工作状态
(){
public
void
总监修改名下销售工作状态
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerId"
,
40
);
params
.
put
(
"sellerId"
,
SELLER_ID
);
params
.
put
(
"workStatus"
,
0
);
params
.
put
(
"workStatus"
,
0
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_switchWorkStatus
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_switchWorkStatus
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
dec2e803
...
@@ -7,6 +7,11 @@ public class BasicConfig {
...
@@ -7,6 +7,11 @@ public class BasicConfig {
public
static
final
String
WECHAT_NAME
=
"吉吉"
;
public
static
final
String
WECHAT_NAME
=
"吉吉"
;
public
static
final
String
TKU_COOKIE_NAME
=
"tku"
;
public
static
final
String
TKU_COOKIE_NAME
=
"tku"
;
// 销售工作台销售ID
public
static
final
int
SELLER_ID
=
42
;
// 销售工作台总监ID
public
static
final
int
LEADER_ID
=
43
;
/**
/**
* 直播账号授权key
* 直播账号授权key
*/
*/
...
...
src/test/java/com/kjj/utils/BaseUtils.java
View file @
dec2e803
...
@@ -248,14 +248,14 @@ public class BaseUtils {
...
@@ -248,14 +248,14 @@ public class BaseUtils {
public
static
void
superUserLogin
(){
public
static
void
superUserLogin
(){
// 调用登录接口
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"1
5136361301
"
);
params
.
put
(
"phone"
,
"1
8248405155
"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
//专用于自动化获取验证码
params
.
clear
();
params
.
clear
();
params
.
put
(
"phone"
,
"1
5136361301
"
);
params
.
put
(
"phone"
,
"1
8248405155
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
System
.
out
.
println
(
captcha
);
...
@@ -263,7 +263,7 @@ public class BaseUtils {
...
@@ -263,7 +263,7 @@ public class BaseUtils {
//登录接口
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
clear
();
params
.
put
(
"phone"
,
"1
5136361301
"
);
params
.
put
(
"phone"
,
"1
8248405155
"
);
params
.
put
(
"captcha"
,
captcha
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
@@ -298,14 +298,14 @@ public class BaseUtils {
...
@@ -298,14 +298,14 @@ public class BaseUtils {
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
// 调用登录接口
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"13
758231257
"
);
params
.
put
(
"phone"
,
"13
454131091
"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
//专用于自动化获取验证码
params
.
clear
();
params
.
clear
();
params
.
put
(
"phone"
,
"13
758231257
"
);
params
.
put
(
"phone"
,
"13
454131091
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
System
.
out
.
println
(
captcha
);
...
@@ -313,7 +313,7 @@ public class BaseUtils {
...
@@ -313,7 +313,7 @@ public class BaseUtils {
//登录接口
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
clear
();
params
.
put
(
"phone"
,
"13
758231257
"
);
params
.
put
(
"phone"
,
"13
454131091
"
);
params
.
put
(
"captcha"
,
captcha
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
@@ -349,14 +349,14 @@ public class BaseUtils {
...
@@ -349,14 +349,14 @@ public class BaseUtils {
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
// 调用登录接口
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"1
3600546247
"
);
params
.
put
(
"phone"
,
"1
8248405149
"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
//专用于自动化获取验证码
params
.
clear
();
params
.
clear
();
params
.
put
(
"phone"
,
"1
3600546247
"
);
params
.
put
(
"phone"
,
"1
8248405149
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
System
.
out
.
println
(
captcha
);
...
@@ -364,7 +364,7 @@ public class BaseUtils {
...
@@ -364,7 +364,7 @@ public class BaseUtils {
//登录接口
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
clear
();
params
.
put
(
"phone"
,
"1
3600546247
"
);
params
.
put
(
"phone"
,
"1
8248405149
"
);
params
.
put
(
"captcha"
,
captcha
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
@@ -400,14 +400,14 @@ public class BaseUtils {
...
@@ -400,14 +400,14 @@ public class BaseUtils {
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"
,
"18
852895892
"
);
params
.
put
(
"phoneNumber"
,
"18
248405155
"
);
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"
,
"18
852895892
"
);
params
.
put
(
"phoneNumber"
,
"18
248405155
"
);
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
);
...
@@ -415,7 +415,7 @@ public class BaseUtils {
...
@@ -415,7 +415,7 @@ public class BaseUtils {
//登录接口
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"18
852895892
"
);
params
.
put
(
"phoneNumber"
,
"18
248405155
"
);
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"
);
...
@@ -429,7 +429,7 @@ public class BaseUtils {
...
@@ -429,7 +429,7 @@ public class BaseUtils {
otoSellerCookieValue
=
cookieKeyValue
[
1
];
otoSellerCookieValue
=
cookieKeyValue
[
1
];
// otoSellerCookieKey = "otoToken";
// otoSellerCookieKey = "otoToken";
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1
GyikzWhYrmAfaxDJLTKWo3R3ftLtTdVx1ZCaihHqi9qG45dqQ8CdEya9eWEXSiEW9LjCXQoFeJWJvNcVQ
";
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1
H6zBcWkw5JtD5N2YjRB7RFmU6uG7ziBmmBWwsRz2uLkFruaQMtPTc4XJVhTmCWQmdZCYvYzyru4GEVxxw
";
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
);
...
@@ -442,14 +442,14 @@ public class BaseUtils {
...
@@ -442,14 +442,14 @@ public class BaseUtils {
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"
,
"13
600546247
"
);
params
.
put
(
"phoneNumber"
,
"13
454131091
"
);
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"
,
"13
600546247
"
);
params
.
put
(
"phoneNumber"
,
"13
454131091
"
);
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
);
...
@@ -457,7 +457,7 @@ public class BaseUtils {
...
@@ -457,7 +457,7 @@ public class BaseUtils {
//登录接口
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
clear
();
params
.
put
(
"phoneNumber"
,
"13
600546247
"
);
params
.
put
(
"phoneNumber"
,
"13
454131091
"
);
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"
);
...
@@ -471,7 +471,7 @@ public class BaseUtils {
...
@@ -471,7 +471,7 @@ public class BaseUtils {
otoLeaderCookieValue
=
cookieKeyValue
[
1
];
otoLeaderCookieValue
=
cookieKeyValue
[
1
];
// otoLeaderCookieKey = "otoToken";
// otoLeaderCookieKey = "otoToken";
// otoLeaderCookieValue = "64e83LYGbaXYX9EkHumCho2Um1
GyikzWh7fhCVMnZpMvdoMsVm4TxDVoLbzCHGf4BqHzR5nXdrjL6VeJLdpEPHJpVDDg2A3TRyCz7yhttRB
";
// otoLeaderCookieValue = "64e83LYGbaXYX9EkHumCho2Um1
H6zBcWhBxmWqfu76gC91GAkfnauguistbDFNVTyYSWjjEpQURiMofMzYTYYbBWC2BA95ZJBjKDaspWvRE
";
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