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
f248b006
Commit
f248b006
authored
Jul 10, 2020
by
Su-Yi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改boss看板
parent
c05e9e55
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
28 deletions
+29
-28
Boss.java
src/test/java/com/kjj/qa/cases/Boss.java
+0
-6
ManagerUtil.java
src/test/java/com/kjj/qa/utils/ManagerUtil.java
+24
-17
testNG.xml
src/test/testNG.xml
+5
-5
Boss.class
target/test-classes/com/kjj/qa/cases/Boss.class
+0
-0
ManagerUtil.class
target/test-classes/com/kjj/qa/utils/ManagerUtil.class
+0
-0
No files found.
src/test/java/com/kjj/qa/cases/Boss.java
View file @
f248b006
...
@@ -88,7 +88,6 @@ public class Boss {
...
@@ -88,7 +88,6 @@ public class Boss {
Assert
.
assertEquals
(
identity
,
3
,
network
.
message
(
params
,
BOSS_IDENTITY
,
"被邀请人已有团队或已绑定上级,不能再接受邀请"
));
Assert
.
assertEquals
(
identity
,
3
,
network
.
message
(
params
,
BOSS_IDENTITY
,
"被邀请人已有团队或已绑定上级,不能再接受邀请"
));
}
}
//获取info接口的代理人id
//获取info接口的代理人id
@Test
(
description
=
"获取访客id"
,
priority
=
6
)
@Test
(
description
=
"获取访客id"
,
priority
=
6
)
public
void
获取访客
id
()
throws
IOException
{
public
void
获取访客
id
()
throws
IOException
{
...
@@ -97,10 +96,8 @@ public class Boss {
...
@@ -97,10 +96,8 @@ public class Boss {
visitorame
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
visitorame
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertNotNull
(
usellerId
,
network
.
message
(
BOSS_USERINFO
,
"获取usellerid失败"
));
Assert
.
assertNotNull
(
usellerId
,
network
.
message
(
BOSS_USERINFO
,
"获取usellerid失败"
));
Assert
.
assertNotNull
(
visitorame
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerName失败"
));
Assert
.
assertNotNull
(
visitorame
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerName失败"
));
}
}
//邀请结果判断
//邀请结果判断
@Test
(
description
=
"邀请结果"
,
priority
=
7
)
@Test
(
description
=
"邀请结果"
,
priority
=
7
)
public
void
邀请结果
()
throws
IOException
{
public
void
邀请结果
()
throws
IOException
{
...
@@ -119,7 +116,6 @@ public class Boss {
...
@@ -119,7 +116,6 @@ public class Boss {
Assert
.
assertEquals
(
name
,
visitorame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
));
Assert
.
assertEquals
(
name
,
visitorame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
));
}
}
//重新获取列表,代理人有无上下级判断;
//重新获取列表,代理人有无上下级判断;
@Test
(
description
=
"当前代理人角色二次判断"
,
priority
=
8
)
@Test
(
description
=
"当前代理人角色二次判断"
,
priority
=
8
)
public
void
当前代理人角色二次判断
()
throws
IOException
{
public
void
当前代理人角色二次判断
()
throws
IOException
{
...
@@ -135,8 +131,6 @@ public class Boss {
...
@@ -135,8 +131,6 @@ public class Boss {
}
}
//团队长数据看板
//团队长数据看板
//代理人已存在下级直接进入团队长数据看板;获取上级团队昵称
//代理人已存在下级直接进入团队长数据看板;获取上级团队昵称
@Test
(
description
=
"获取上级团队昵称"
,
priority
=
9
)
@Test
(
description
=
"获取上级团队昵称"
,
priority
=
9
)
...
...
src/test/java/com/kjj/qa/utils/ManagerUtil.java
View file @
f248b006
...
@@ -17,6 +17,7 @@ import static io.restassured.RestAssured.given;
...
@@ -17,6 +17,7 @@ import static io.restassured.RestAssured.given;
public
class
ManagerUtil
{
public
class
ManagerUtil
{
private
static
final
NetworkUtil
network
=
NetworkUtil
.
getInstance
();
private
static
final
NetworkUtil
network
=
NetworkUtil
.
getInstance
();
// 管理后台登录
public
static
void
ssologin
(){
public
static
void
ssologin
(){
network
.
host
=
SSO_HOST
;
network
.
host
=
SSO_HOST
;
//1.先进入SSO登录框 登入管理后台
//1.先进入SSO登录框 登入管理后台
...
@@ -39,23 +40,15 @@ public class ManagerUtil {
...
@@ -39,23 +40,15 @@ public class ManagerUtil {
network
.
agentHeaders
.
put
(
"X-Csrf-Token"
,
ssoCookies
.
get
(
"csrf_token"
));
network
.
agentHeaders
.
put
(
"X-Csrf-Token"
,
ssoCookies
.
get
(
"csrf_token"
));
}
}
// 切换vip
//切换vip
public
static
void
switchvip
(
String
sellerId
){
public
static
void
switchvip
()
{
network
.
host
=
HOST
;
// 1.拿到sellerId
Response
response
=
network
.
getResponse
(
USER_INFO
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
System
.
out
.
println
(
network
.
agentCookies
);
network
.
host
=
MANAGER_HOST
;
network
.
host
=
MANAGER_HOST
;
// 2.切换公司为客集集
// 2.切换公司为客集集
Map
<
String
,
Object
>
change
Params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
switchCompany
Params
=
new
HashMap
<
String
,
Object
>();
change
Params
.
put
(
"id"
,
sellerId
);
switchCompany
Params
.
put
(
"id"
,
sellerId
);
change
Params
.
put
(
"companyId"
,
6
);
switchCompany
Params
.
put
(
"companyId"
,
6
);
response
=
network
.
getResponse
(
change
Params
,
MANAGER_CHANGECOMPANY
);
Response
response
=
network
.
getResponse
(
switchCompany
Params
,
MANAGER_CHANGECOMPANY
);
response
.
body
().
prettyPrint
();
response
.
body
().
prettyPrint
();
// 3.切换为保险版vip
// 3.切换为保险版vip
...
@@ -70,18 +63,32 @@ public class ManagerUtil {
...
@@ -70,18 +63,32 @@ public class ManagerUtil {
response
.
body
().
prettyPrint
();
response
.
body
().
prettyPrint
();
// 4.切换公司为空
// 4.切换公司为空
change
Params
.
remove
(
"companyId"
,
6
);
//去掉公司
switchCompany
Params
.
remove
(
"companyId"
,
6
);
//去掉公司
response
=
network
.
getResponse
(
change
Params
,
MANAGER_CHANGECOMPANY
);
response
=
network
.
getResponse
(
switchCompany
Params
,
MANAGER_CHANGECOMPANY
);
response
.
body
().
prettyPrint
();
response
.
body
().
prettyPrint
();
network
.
host
=
HOST
;
network
.
host
=
HOST
;
}
}
// 切换为内部人员
public
static
void
switchInsider
(
String
sellerId
)
{
// https://kjj-mng.duibatest.com.cn/kjy/manager/seller/setInternalSeller?id=2163&internalSeller=1
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
sellerId
);
params
.
put
(
"internalSeller"
,
1
);
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
// 1.拿到sellerId
Response
response
=
network
.
getResponse
(
USER_INFO
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
ssologin
();
ssologin
();
switchvip
();
switchvip
(
sellerId
);
}
}
}
}
src/test/testNG.xml
View file @
f248b006
...
@@ -36,11 +36,11 @@
...
@@ -36,11 +36,11 @@
<class
name=
"com.kjj.qa.cases.CircleFriends"
/>
<class
name=
"com.kjj.qa.cases.CircleFriends"
/>
</classes>
</classes>
</test>
</test>
<!-- <test preserve-order="true" name="boss看板">--
>
<test
preserve-order=
"true"
name=
"boss看板"
>
<!-- <classes>--
>
<classes
>
<!-- <class name="com.kjj.qa.cases.Boss"/>--
>
<class
name=
"com.kjj.qa.cases.Boss"
/
>
<!-- </classes>--
>
</classes
>
<!-- </test>--
>
</test
>
<!-- 监听器-->
<!-- 监听器-->
<listeners>
<listeners>
<listener
class-name=
"com.kjj.qa.config.ExtentTestNGIReporterListener"
/>
<listener
class-name=
"com.kjj.qa.config.ExtentTestNGIReporterListener"
/>
...
...
target/test-classes/com/kjj/qa/cases/Boss.class
View file @
f248b006
No preview for this file type
target/test-classes/com/kjj/qa/utils/ManagerUtil.class
View file @
f248b006
No preview for this file type
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