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
d4b3b76f
Commit
d4b3b76f
authored
Jul 25, 2020
by
张震
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boss看板优化调整
parent
748ae0e3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
28 deletions
+31
-28
Boss.java
src/test/java/com/kjj/qa/cases/Boss.java
+25
-21
BasicConfig.java
src/test/java/com/kjj/qa/config/BasicConfig.java
+1
-2
testNG.xml
src/test/testNG.xml
+5
-5
Boss.class
target/test-classes/com/kjj/qa/cases/Boss.class
+0
-0
BasicConfig.class
target/test-classes/com/kjj/qa/config/BasicConfig.class
+0
-0
No files found.
src/test/java/com/kjj/qa/cases/Boss.java
View file @
d4b3b76f
...
@@ -20,11 +20,12 @@ public class Boss {
...
@@ -20,11 +20,12 @@ public class Boss {
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
sellerId
;
public
String
sellerId
;
public
String
uselle
rId
;
public
String
visto
rId
;
public
String
sids
;
public
String
sids
;
public
String
visitorame
;
public
String
visitorName
;
public
String
sellername
;
public
String
sellerName
;
public
String
superiorname
;
public
String
superiorName
;
public
String
vipValid
;
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
...
@@ -32,23 +33,26 @@ public class Boss {
...
@@ -32,23 +33,26 @@ public class Boss {
}
}
//BOSS看板正式版
//BOSS看板正式版
//判断代理人的会员及版本
//判断代理人的会员及版本
@Test
(
description
=
"
会员及
版本判断"
,
priority
=
1
)
@Test
(
description
=
"
代理人
版本判断"
,
priority
=
1
)
public
void
会员及
版本判断
()
throws
IOException
{
public
void
代理人
版本判断
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
BOSS_VERSIONINFO
);
Response
response
=
network
.
getResponse
(
BOSS_VERSIONINFO
);
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data.find {it.openType == 1}.userVersion"
);
//判断是否为保险版:1是通用版 2是保险版
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data.find {it.openType == 1}.userVersion"
);
//判断是否为保险版:1是通用版 2是保险版
Assert
.
assertEquals
(
userVersion
,
2
,
network
.
message
(
BOSS_VERSIONINFO
,
"获取版本有误 此版本为非保险版"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userVersion
,
2
,
network
.
message
(
BOSS_VERSIONINFO
,
"获取版本有误 此版本为非保险版"
,
response
.
body
().
asString
()));
boolean
isVip
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.openType == 1}.vip"
);
//判断是否为会员
//
boolean isVip = response.jsonPath().getBoolean("data.find {it.openType == 1}.vip"); //判断是否为会员
Assert
.
assertTrue
(
isVip
,
network
.
message
(
BOSS_VERSIONINFO
,
"会员判断错误 为非会员"
,
response
.
body
().
asString
()));
//
Assert.assertTrue(isVip,network.message(BOSS_VERSIONINFO,"会员判断错误 为非会员",response.body().asString()));
}
}
//获取info接口的代理人id
//获取info接口的代理人id
@Test
(
description
=
"获取代理人id"
,
priority
=
2
)
@Test
(
description
=
"获取代理人id"
,
priority
=
2
)
public
void
获取代理人
id
()
throws
IOException
{
public
void
获取代理人
id
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
BOSS_USERINFO
);
Response
response
=
network
.
getResponse
(
BOSS_USERINFO
);
vipValid
=
response
.
jsonPath
().
getString
(
"data.vipValid"
);
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
sellername
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertNotNull
(
vipValid
,
network
.
message
(
BOSS_USERINFO
,
"会员判断错误,为非会员"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
sellerId
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerid失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
sellerId
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerid失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
sellername
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerName失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
sellerName
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerName失败"
,
response
.
body
().
asString
()));
}
}
//代理人有无上下级判断;
//代理人有无上下级判断;
...
@@ -81,7 +85,7 @@ public class Boss {
...
@@ -81,7 +85,7 @@ public class Boss {
//tku 切换为访客的
//tku 切换为访客的
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
uselle
rId
);
params
.
put
(
"sellerId"
,
visto
rId
);
Response
response
=
network
.
getResponse
(
params
,
BOSS_IDENTITY
);
Response
response
=
network
.
getResponse
(
params
,
BOSS_IDENTITY
);
int
identity
=
response
.
jsonPath
().
getInt
(
"data.identity"
);
//1团长、2成员、3没有团队
int
identity
=
response
.
jsonPath
().
getInt
(
"data.identity"
);
//1团长、2成员、3没有团队
Assert
.
assertEquals
(
identity
,
3
,
network
.
message
(
params
,
BOSS_IDENTITY
,
"被邀请人已有团队或已绑定上级,不能再接受邀请"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
identity
,
3
,
network
.
message
(
params
,
BOSS_IDENTITY
,
"被邀请人已有团队或已绑定上级,不能再接受邀请"
,
response
.
body
().
asString
()));
...
@@ -91,10 +95,10 @@ public class Boss {
...
@@ -91,10 +95,10 @@ public class Boss {
@Test
(
description
=
"获取访客id"
,
priority
=
6
)
@Test
(
description
=
"获取访客id"
,
priority
=
6
)
public
void
获取访客
id
()
throws
IOException
{
public
void
获取访客
id
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
BOSS_USERINFO
);
Response
response
=
network
.
getResponse
(
BOSS_USERINFO
);
uselle
rId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
visto
rId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
visitorame
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
visitor
N
ame
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertNotNull
(
usellerId
,
network
.
message
(
BOSS_USERINFO
,
"获取uselleri
d失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
vistorId
,
network
.
message
(
BOSS_USERINFO
,
"获取vistorI
d失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
visitorame
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerName失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
visitor
N
ame
,
network
.
message
(
BOSS_USERINFO
,
"获取sellerName失败"
,
response
.
body
().
asString
()));
}
}
//邀请结果判断
//邀请结果判断
...
@@ -109,10 +113,10 @@ public class Boss {
...
@@ -109,10 +113,10 @@ public class Boss {
//获取被邀请人上级昵称
//获取被邀请人上级昵称
Map
<
String
,
Object
>
inviteparams
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
inviteparams
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
uselle
rId
);
params
.
put
(
"sellerId"
,
visto
rId
);
Response
responses
=
network
.
getResponse
(
inviteparams
,
BOSS_BOSS
);
Response
responses
=
network
.
getResponse
(
inviteparams
,
BOSS_BOSS
);
String
name
=
responses
.
jsonPath
().
getString
(
"data"
);
String
name
=
responses
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
name
,
visitorame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
name
,
visitor
N
ame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
,
response
.
body
().
asString
()));
}
}
//重新获取列表,代理人有无上下级判断;
//重新获取列表,代理人有无上下级判断;
...
@@ -138,8 +142,8 @@ public class Boss {
...
@@ -138,8 +142,8 @@ public class Boss {
params
.
put
(
"sellerId"
,
sellerId
);
params
.
put
(
"sellerId"
,
sellerId
);
Response
response
=
network
.
getResponse
(
params
,
BOSS_BOSS
);
Response
response
=
network
.
getResponse
(
params
,
BOSS_BOSS
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
superior
n
ame
=
response
.
jsonPath
().
getString
(
"data"
);
superior
N
ame
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
superior
n
ame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
superior
N
ame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
,
response
.
body
().
asString
()));
}
}
//获取代理人团队人数
//获取代理人团队人数
...
@@ -181,8 +185,8 @@ public class Boss {
...
@@ -181,8 +185,8 @@ public class Boss {
params
.
put
(
"sellerId"
,
sellerId
);
params
.
put
(
"sellerId"
,
sellerId
);
Response
response
=
network
.
getResponse
(
params
,
BOSS_BOSS
);
Response
response
=
network
.
getResponse
(
params
,
BOSS_BOSS
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
superior
n
ame
=
response
.
jsonPath
().
getString
(
"data"
);
superior
N
ame
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
superior
n
ame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
superior
N
ame
,
network
.
message
(
params
,
BOSS_BOSS
,
"昵称不匹配"
,
response
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/qa/config/BasicConfig.java
View file @
d4b3b76f
...
@@ -7,11 +7,10 @@ public class BasicConfig {
...
@@ -7,11 +7,10 @@ public class BasicConfig {
public
static
final
boolean
isPushReport
=
false
;
//true
public
static
final
boolean
isPushReport
=
false
;
//true
// 代理人 TKU
// 代理人 TKU
public
static
String
AGENT_TKU
=
null
;
public
static
String
AGENT_TKU
=
"6uGEBBs2Mfzsv8PRvs7kZy65XFL9Nejw9xDQK8d29MDKzw1GsRWH3QrWeLgMoGPiprS3AmUFSAHGhD2aE"
;
// 访客 TKU
// 访客 TKU
public
static
final
String
VISITOR_TKU
=
"T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3kN2xUC7kBMVyjghwaMUaBkXBb34TrZkSBtySoUs"
;
public
static
final
String
VISITOR_TKU
=
"T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3kN2xUC7kBMVyjghwaMUaBkXBb34TrZkSBtySoUs"
;
// 代理人微信昵称
// 代理人微信昵称
public
static
final
String
WECHAT_NAME
=
"客集集-梦晨"
;
//true
public
static
final
String
WECHAT_NAME
=
"客集集-梦晨"
;
//true
...
...
src/test/testNG.xml
View file @
d4b3b76f
...
@@ -6,16 +6,16 @@
...
@@ -6,16 +6,16 @@
<!-- <class name="com.kjj.qa.cases.Home"/>-->
<!-- <class name="com.kjj.qa.cases.Home"/>-->
<!-- </classes>-->
<!-- </classes>-->
<!-- </test>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="支付">-->
<!-- <classes>-->
<!-- <class name="com.kjj.qa.cases.Pay"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="新手任务">-->
<!-- <test preserve-order="true" name="新手任务">-->
<!-- <classes>-->
<!-- <classes>-->
<!-- <class name="com.kjj.qa.cases.Novice"/>-->
<!-- <class name="com.kjj.qa.cases.Novice"/>-->
<!-- </classes>-->
<!-- </classes>-->
<!-- </test>-->
<!-- </test>-->
<test
preserve-order=
"true"
name=
"支付"
>
<classes>
<class
name=
"com.kjj.qa.cases.Pay"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"名片"
>
<test
preserve-order=
"true"
name=
"名片"
>
<classes>
<classes>
<class
name=
"com.kjj.qa.cases.SellerCard"
/>
<class
name=
"com.kjj.qa.cases.SellerCard"
/>
...
...
target/test-classes/com/kjj/qa/cases/Boss.class
View file @
d4b3b76f
No preview for this file type
target/test-classes/com/kjj/qa/config/BasicConfig.class
View file @
d4b3b76f
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