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
f12ce811
Commit
f12ce811
authored
Feb 08, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.更换企业后台的自动化管理员的手机号
2.增加公域引流中的接口自动化
parent
16148d6f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
574 additions
and
14 deletions
+574
-14
Manager.java
src/test/java/com/kjj/cases/otoseller/Manager.java
+535
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+19
-0
BaseUtils.java
src/test/java/com/kjj/utils/BaseUtils.java
+20
-14
No files found.
src/test/java/com/kjj/cases/otoseller/Manager.java
0 → 100644
View file @
f12ce811
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
f12ce811
...
...
@@ -1289,6 +1289,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_oto_saveTag
=
MANAGER_HOST
+
"/kjy/manager/oto/tag/save"
;
public
static
final
String
MANAGER_oto_updateTag
=
MANAGER_HOST
+
"/kjy/manager/oto/tag/update"
;
public
static
final
String
MANAGER_oto_tagList
=
MANAGER_HOST
+
"/kjy/manager/oto/tag/list"
;
public
static
final
String
MANAGER_oto_switchStatus
=
MANAGER_HOST
+
"/kjy/manager/oto/tag/switchStatus"
;
public
static
final
String
WORK_getCaptcha
=
WORK_HOST
+
"/kjy/oto/manager/auth/captcha"
;
public
static
final
String
WORK_login
=
WORK_HOST
+
"/kjy/oto/manager/auth/login"
;
public
static
final
String
WORK_userInfo
=
WORK_HOST
+
"/kjy/oto/manager/auth/userInfo"
;
...
...
@@ -1298,4 +1299,22 @@ public class BasicConfig {
public
static
final
String
WORK_notifyList
=
WORK_HOST
+
"/kjy/oto/manager/customer/notify/list"
;
public
static
final
String
MANAGER_oto_customerList
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/list/v2"
;
public
static
final
String
MANAGER_oto_assignSeller
=
MANAGER_HOST
+
"/kjy/manager/pub/form/customer/assignSeller"
;
public
static
final
String
WORK_tagList
=
WORK_HOST
+
"/kjy/oto/manager/tag/list"
;
public
static
final
String
WORK_customerList
=
WORK_HOST
+
"/kjy/oto/manager/customer/list"
;
public
static
final
String
WORK_phone
=
WORK_HOST
+
"/kjy/oto/manager/customer/phoneNum"
;
public
static
final
String
WORK_info
=
WORK_HOST
+
"kjy/oto/manager/customer/visit/info"
;
public
static
final
String
WORK_header
=
WORK_HOST
+
"/kjy/oto/manager/customer/header"
;
public
static
final
String
WORK_detail
=
WORK_HOST
+
"/kjy/oto/manager/customer/detail"
;
public
static
final
String
WORK_showFeedback
=
WORK_HOST
+
"/kjy/oto/manager/customer/call/showFeedback"
;
public
static
final
String
WORK_regionCity
=
WORK_HOST
+
"/kjy/oto/manager/customer/regionCity"
;
public
static
final
String
WORK_callLog
=
WORK_HOST
+
"/kjy/oto/manager/customer/log/call"
;
public
static
final
String
WORK_meet
=
WORK_HOST
+
"/kjy/oto/manager/customer/meet"
;
public
static
final
String
WORK_star
=
WORK_HOST
+
"/kjy/oto/manager/customer/star"
;
public
static
final
String
WORK_assess
=
WORK_HOST
+
"/kjy/oto/manager/customer/assess"
;
public
static
final
String
WORK_weight
=
WORK_HOST
+
"/kjy/oto/manager/customer/follow/weight"
;
public
static
final
String
WORK_tag
=
WORK_HOST
+
"/kjy/oto/manager/customer/tag"
;
public
static
final
String
WORK_order
=
WORK_HOST
+
"/kjy/oto/manager/customer/order"
;
public
static
final
String
WORK_feedback
=
WORK_HOST
+
"/kjy/oto/manager/customer/feedback"
;
public
static
final
String
WORK_edit
=
WORK_HOST
+
"/kjy/oto/manager/customer/edit"
;
public
static
final
String
WORK_operation
=
WORK_HOST
+
"/kjy/oto/manager/customer/log/operation"
;
}
src/test/java/com/kjj/utils/BaseUtils.java
View file @
f12ce811
...
...
@@ -25,6 +25,8 @@ public class BaseUtils {
public
static
String
companyCookieValue
;
public
static
String
officeCookieKey
;
public
static
String
officeCookieValue
;
public
static
String
otoCookieKey
;
public
static
String
otoCookieValue
;
/**
...
...
@@ -244,14 +246,14 @@ public class BaseUtils {
public
static
void
superUserLogin
(){
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"1513636130
8
"
);
params
.
put
(
"phone"
,
"1513636130
1
"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"1513636130
8
"
);
params
.
put
(
"phone"
,
"1513636130
1
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
...
...
@@ -259,7 +261,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
put
(
"phone"
,
"1513636130
8
"
);
params
.
put
(
"phone"
,
"1513636130
1
"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
...
@@ -284,6 +286,7 @@ public class BaseUtils {
superCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
System
.
out
.
println
(
"超级管理员Cookie中key:"
+
superCookieKey
+
" ,values:"
+
superCookieValue
);
}
/**
...
...
@@ -293,14 +296,14 @@ public class BaseUtils {
ThreadSleepUtils
.
sleep
(
2000
);
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"1
513636130
7"
);
params
.
put
(
"phone"
,
"1
375823125
7"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"1
513636130
7"
);
params
.
put
(
"phone"
,
"1
375823125
7"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
...
...
@@ -308,7 +311,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
put
(
"phone"
,
"1
513636130
7"
);
params
.
put
(
"phone"
,
"1
375823125
7"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
...
@@ -334,6 +337,7 @@ public class BaseUtils {
network
.
agentCookies
.
put
(
cookieKeyValue
[
0
],
cookieKeyValue
[
1
]);
//存入cookies
//put company Id
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
System
.
out
.
println
(
"公司管理员Cookie中key:"
+
companyCookieKey
+
" ,values:"
+
companyCookieValue
);
}
/**
...
...
@@ -343,14 +347,14 @@ public class BaseUtils {
ThreadSleepUtils
.
sleep
(
2000
);
// 调用登录接口
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"phone"
,
"1
5136361306
"
);
params
.
put
(
"phone"
,
"1
3600546247
"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptcha
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
CORP_getCaptcha
,
"获取验证码失败"
,
response
.
body
().
asString
()));
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"1
5136361306
"
);
params
.
put
(
"phone"
,
"1
3600546247
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
...
...
@@ -358,7 +362,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
put
(
"phone"
,
"1
5136361306
"
);
params
.
put
(
"phone"
,
"1
3600546247
"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
CORP_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
...
@@ -384,6 +388,7 @@ public class BaseUtils {
network
.
agentCookies
.
put
(
officeCookieKey
,
officeCookieValue
);
//存入cookies
//put company Id
network
.
agentCookies
.
put
(
"companyId"
,
"Kj20MjE1"
);
System
.
out
.
println
(
"营业部管理员Cookie中key:"
+
officeCookieKey
+
" ,values:"
+
officeCookieValue
);
}
/**
...
...
@@ -400,7 +405,7 @@ public class BaseUtils {
//专用于自动化获取验证码
params
.
clear
();
params
.
put
(
"phone"
,
"1513636130
8
"
);
params
.
put
(
"phone"
,
"1513636130
1
"
);
Response
autoTestRes
=
network
.
getResponse
(
params
,
BasicConfig
.
CORP_getCaptchaForAutoTest
);
String
captcha
=
autoTestRes
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
captcha
);
...
...
@@ -408,7 +413,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils
.
sleep
(
2000
);
params
.
clear
();
params
.
put
(
"phone"
,
"1513636130
8
"
);
params
.
put
(
"phone"
,
"1513636130
1
"
);
params
.
put
(
"captcha"
,
captcha
);
Response
loginRes
=
network
.
postResponse
(
params
,
BasicConfig
.
WORK_login
);
boolean
success
=
loginRes
.
jsonPath
().
getBoolean
(
"success"
);
...
...
@@ -418,8 +423,9 @@ public class BaseUtils {
String
header
=
loginRes
.
getHeader
(
"Set-Cookie"
);
String
cookieStr
=
header
.
split
(
";"
)[
0
];
String
[]
cookieKeyValue
=
cookieStr
.
split
(
"="
);
officeCookieKey
=
cookieKeyValue
[
0
];
officeCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
officeCookieKey
,
officeCookieValue
);
//存入cookies
otoCookieKey
=
cookieKeyValue
[
0
];
otoCookieValue
=
cookieKeyValue
[
1
];
network
.
agentCookies
.
put
(
otoCookieKey
,
otoCookieValue
);
//存入cookies
System
.
out
.
println
(
"销售Cookie中key:"
+
otoCookieKey
+
" ,values:"
+
otoCookieValue
);
}
}
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