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
bede75c3
Commit
bede75c3
authored
Jun 23, 2020
by
张震
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增boss看板
parent
bd89ae1d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
1 deletion
+133
-1
Boss.java
src/test/java/com/kjj/qa/cases/Boss.java
+133
-0
Upload.java
src/test/java/com/kjj/qa/cases/Upload.java
+0
-1
SellerCard.class
target/test-classes/com/kjj/qa/cases/SellerCard.class
+0
-0
Upload.class
target/test-classes/com/kjj/qa/cases/Upload.class
+0
-0
NetworkUtil.class
target/test-classes/com/kjj/qa/utils/NetworkUtil.class
+0
-0
No files found.
src/test/java/com/kjj/qa/cases/Boss.java
0 → 100644
View file @
bede75c3
package
com
.
kjj
.
qa
.
cases
;
import
com.kjj.qa.utils.NetworkUtil
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.IExpectedExceptionsAnnotation
;
import
org.testng.annotations.Test
;
import
org.testng.remote.strprotocol.IMessage
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Boss
{
NetworkUtil
network
=
NetworkUtil
.
getInstance
();
@BeforeClass
public
void
setUp
()
{
}
//判断代理人的会员及版本
@Test
(
description
=
"会员及版本判断"
,
priority
=
1
)
public
void
会员及版本判断
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/version/info"
);
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data.find {it.openType == 1}.userVersion"
);
//判断是否为保险版:1是通用版 2是保险版
boolean
isVip
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.openType == 1}.vip"
);
//判断是否为会员
Assert
.
assertEquals
(
userVersion
,
2
,
"获取版本有误 此版本为非保险版"
);
Assert
.
assertTrue
(
isVip
,
"会员判断错误 为非会员"
);
}
//被邀请人点击链接接受邀请
@Test
(
description
=
"获取代理人身份"
,
priority
=
3
)
public
void
获取代理人身份
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
1939
);
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/member/identity"
);
int
identity
=
response
.
jsonPath
().
getInt
(
"data.identity"
);
//1团长、2成员、3没有团队
Assert
.
assertEquals
(
identity
,
3
,
"代理人已有团队或已绑定上级,不能再接受邀请"
);
}
//邀请结果判断
@Test
(
description
=
"邀请结果"
,
priority
=
4
)
public
void
邀请结果
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/bound"
);
Boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
//1 true:邀请成功;2 false:邀请失败
Assert
.
assertTrue
(
data
,
"接受邀请失败"
);
}
//代理人有无上下级判断;
@Test
(
description
=
"当前代理人角色判断"
,
priority
=
2
)
public
void
当前代理人角色判断
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
1939
);
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/member/role"
);
boolean
hasSubordinate
=
response
.
jsonPath
().
getBoolean
(
"data.hasSubordinate"
);
//判断是否有下级
boolean
hasSuperior
=
response
.
jsonPath
().
getBoolean
(
"data.hasSuperior"
);
//判断是否有上级
Assert
.
assertTrue
(
hasSubordinate
,
"暂无下级"
);
Assert
.
assertTrue
(
hasSuperior
,
"暂无上级"
);
}
//代理人无下级直接进入个人数据看板页面;获取上级昵称
@Test
(
description
=
"获取上级昵称"
,
priority
=
5
)
public
void
获取上级昵称
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
1939
);
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/boss"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"喜洋洋保险"
);
}
//分享链接邀请下级加入
@Test
(
description
=
"邀请成员加入"
,
priority
=
6
)
public
void
邀请成员加入
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"inviteType"
,
2
);
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/invite/code"
);
boolean
hasSubordinate
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
true
,
"分享链接失败"
);
}
//团队长数据看板
//代理人已存在下级直接进入团队长数据看板;获取上级团队昵称
@Test
(
description
=
"获取上级团队昵称"
,
priority
=
7
)
public
void
获取上级团队昵称
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
1939
);
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/boss"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"喜洋洋保险"
);
}
//获取代理人团队人数
@Test
(
description
=
"获取当前团队人数"
,
priority
=
8
)
public
void
获取当前团队人数
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
1939
);
Response
response
=
network
.
getResponse
(
"/kjy/mp/seller/team/member/role"
);
boolean
teamNumber
=
response
.
jsonPath
().
getBoolean
(
"data.teamNumber"
);
//获取团队人数包含自己
Assert
.
assertNotNull
(
teamNumber
,
"获取团队人数失败"
);
}
//增加团队成员
//移除团队成员
@Test
(
description
=
"移除团队成员"
,
priority
=
9
)
public
void
移除团队成员
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sids"
,
"Kj21MTYxNDM"
);
Response
response
=
network
.
postResponse
(
params
,
"/kjy/mp/seller/team/member/remove"
);
System
.
out
.
println
(
response
.
getBody
().
prettyPrint
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
//true:删除成功;false:删除失败
Assert
.
assertEquals
(
data
,
true
,
"移除失败"
);
}
}
\ No newline at end of file
src/test/java/com/kjj/qa/cases/Upload.java
View file @
bede75c3
...
...
@@ -198,7 +198,6 @@ public class Upload {
Assert
.
assertEquals
(
length
,
0
,
network
.
message
(
params
,
UPLOAD_LIST
,
"获取我的上传-其他列表数量有误"
));
}
@AfterClass
public
static
void
tearDown
(){
apiCount
+=
13
;
...
...
target/test-classes/com/kjj/qa/cases/SellerCard.class
View file @
bede75c3
No preview for this file type
target/test-classes/com/kjj/qa/cases/Upload.class
View file @
bede75c3
No preview for this file type
target/test-classes/com/kjj/qa/utils/NetworkUtil.class
View file @
bede75c3
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