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
dc7b8e48
Commit
dc7b8e48
authored
Jul 10, 2020
by
Su-Yi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改管理后台部分
parent
9f66fedd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
21 deletions
+29
-21
BasicConfig.java
src/test/java/com/kjj/qa/config/BasicConfig.java
+2
-0
ManagerUtil.java
src/test/java/com/kjj/qa/utils/ManagerUtil.java
+27
-21
No files found.
src/test/java/com/kjj/qa/config/BasicConfig.java
View file @
dc7b8e48
...
...
@@ -223,4 +223,6 @@ public class BasicConfig {
public
static
final
String
MANAGER_CHANGECOMPANY
=
"/kjy/manager/seller/changeCompany"
;
public
static
final
String
MANAGER_UPDATETYPEORDATE
=
"/kjy/manager/seller/updateTypeOrDate"
;
public
static
final
String
MANAGER_SETINTERALSELLER
=
"/kjy/manager/seller/setInternalSeller"
;
}
src/test/java/com/kjj/qa/utils/ManagerUtil.java
View file @
dc7b8e48
...
...
@@ -17,7 +17,7 @@ import static io.restassured.RestAssured.given;
public
class
ManagerUtil
{
private
static
final
NetworkUtil
network
=
NetworkUtil
.
getInstance
();
//
管理后台登录
//
登录管理后台
public
static
void
ssologin
(){
network
.
host
=
SSO_HOST
;
//1.先进入SSO登录框 登入管理后台
...
...
@@ -40,18 +40,26 @@ public class ManagerUtil {
network
.
agentHeaders
.
put
(
"X-Csrf-Token"
,
ssoCookies
.
get
(
"csrf_token"
));
}
// 拿到sellerId
public
static
String
getSellerId
(){
network
.
host
=
HOST
;
Response
response
=
network
.
getResponse
(
USER_INFO
);
return
response
.
jsonPath
().
getString
(
"data.sellerId"
);
}
// 切换vip
public
static
void
switchvip
(
String
sellerId
){
public
static
void
switchvip
(
String
sellerId
)
{
network
.
host
=
MANAGER_HOST
;
//
2
.切换公司为客集集
Map
<
String
,
Object
>
switchCompany
Params
=
new
HashMap
<
String
,
Object
>();
switchCompany
Params
.
put
(
"id"
,
sellerId
);
switchCompany
Params
.
put
(
"companyId"
,
6
);
Response
response
=
network
.
getResponse
(
switchCompany
Params
,
MANAGER_CHANGECOMPANY
);
//
1
.切换公司为客集集
Map
<
String
,
Object
>
change
Params
=
new
HashMap
<
String
,
Object
>();
change
Params
.
put
(
"id"
,
sellerId
);
change
Params
.
put
(
"companyId"
,
6
);
Response
response
=
network
.
getResponse
(
change
Params
,
MANAGER_CHANGECOMPANY
);
response
.
body
().
prettyPrint
();
//
3
.切换为保险版vip
//
2
.切换为保险版vip
Map
<
String
,
Object
>
switchVipParams
=
new
HashMap
<
String
,
Object
>();
switchVipParams
.
put
(
"reason"
,
"1"
);
switchVipParams
.
put
(
"sellerId"
,
sellerId
);
...
...
@@ -62,33 +70,31 @@ public class ManagerUtil {
response
=
network
.
postResponse
(
switchVipParams
,
MANAGER_UPDATETYPEORDATE
);
response
.
body
().
prettyPrint
();
//
4
.切换公司为空
switchCompany
Params
.
remove
(
"companyId"
,
6
);
//去掉公司
response
=
network
.
getResponse
(
switchCompany
Params
,
MANAGER_CHANGECOMPANY
);
//
3
.切换公司为空
change
Params
.
remove
(
"companyId"
,
6
);
//去掉公司
response
=
network
.
getResponse
(
change
Params
,
MANAGER_CHANGECOMPANY
);
response
.
body
().
prettyPrint
();
network
.
host
=
HOST
;
}
// 切换为内部人员
public
static
void
switchInsider
(
String
sellerId
)
{
// https://kjj-mng.duibatest.com.cn/kjy/manager/seller/setInternalSeller?id=2163&internalSeller=1
public
static
void
switchInsider
(
String
sellerId
){
network
.
host
=
MANAGER_HOST
;
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
sellerId
);
params
.
put
(
"internalSeller"
,
1
);
params
.
put
(
"internalSeller"
,
1
);
//1 内部 0 非内部
Response
response
=
network
.
getResponse
(
params
,
MANAGER_SETINTERALSELLER
);
response
.
body
().
prettyPrint
();
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
// 1.拿到sellerId
Response
response
=
network
.
getResponse
(
USER_INFO
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
String
sellerId
=
getSellerId
();
ssologin
();
switchvip
(
sellerId
);
switchInsider
(
sellerId
);
}
}
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