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
889a80d8
Commit
889a80d8
authored
Jan 12, 2022
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化公司专区代码
parent
85678d97
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
300 additions
and
300 deletions
+300
-300
HomePage.java
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
+15
-14
PersonalCenter.java
...est/java/com/kjj/cases/assistant/menu/PersonalCenter.java
+1
-1
Cashback.java
src/test/java/com/kjj/cases/assistant/pay/Cashback.java
+283
-283
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+1
-1
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+0
-1
No files found.
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
889a80d8
...
...
@@ -48,7 +48,7 @@ public class HomePage implements Authorization {
public
long
adviceId1
;
//用户话术ID
public
long
adviceId2
;
//代理人话术ID
public
long
listSimpleId
;
//赠险列表id
public
String
companyContentId
;
//公司专区文章Id
public
String
companyContentId
=
"Kj21NzUxOTE"
;
;
//公司专区文章Id
public
String
companyScId
;
//公司专区scid
private
long
forwardTime
;
//转发时间
private
String
clueId
;
//线索ID
...
...
@@ -409,8 +409,8 @@ public class HomePage implements Authorization {
//管理后台新增公司专区内容
@Test
(
description
=
"
管理后台_新增内容
"
,
priority
=
23
)
public
void
新增内容
(){
@Test
(
description
=
"
公司专区新增文章
"
,
priority
=
23
)
public
void
公司专区新增文章
(){
//根据文章内容id匹配
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
9398
);
...
...
@@ -474,7 +474,7 @@ public class HomePage implements Authorization {
params
.
put
(
"pageNo"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
listRes
=
network
.
getResponse
(
params
,
MANAGER_exclusiveItemPage
);
Object
id
=
listRes
.
jsonPath
().
getJsonObject
(
"data.list.get(2)
.id"
);
String
id
=
listRes
.
jsonPath
().
getString
(
"data.list.find {it.itemId == '9398'}
.id"
);
System
.
out
.
println
(
id
);
String
desc
=
listRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
MANAGER_exclusiveItemPage
,
"获取id失败"
,
listRes
.
body
().
asString
()));
...
...
@@ -574,8 +574,6 @@ public class HomePage implements Authorization {
params
.
put
(
"source"
,
1
);
Response
listRes
=
network
.
getResponse
(
params
,
HOME_companyGetContentList
);
companyCount
=
listRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
companyContentId
=
listRes
.
jsonPath
().
getString
(
"data.list[1].contentId"
);
System
.
out
.
println
(
companyContentId
);
Assert
.
assertTrue
(
companyCount
>
0
,
network
.
message
(
params
,
HOME_companyGetContentList
,
"获取公司专区内容列表数据错误"
,
listRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取文章配置的公司专区互动方案"
,
priority
=
31
)
...
...
@@ -738,15 +736,19 @@ public class HomePage implements Authorization {
@Test
(
description
=
"管理后台_删除公司专区内容"
,
priority
=
42
)
public
void
管理后台
_
删除公司专区内容
(){
ThreadSleepUtils
.
sleep
(
2000
);
Response
response
=
network
.
getResponse
(
Daily_getTagList
);
Object
tagId
=
response
.
jsonPath
().
getJsonObject
(
"data.get(1).id"
);
//获取删除的内容的id
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"exclusiveAreaId"
,
21
);
params
.
put
(
"title"
,
""
);
params
.
put
(
"state"
,
0
);
params
.
put
(
"firstTagId"
,
tagId
);
params
.
put
(
"pageNo"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
listRes
=
network
.
getResponse
(
params
,
MANAGER_exclusiveItemPage
);
Object
id
=
listRes
.
jsonPath
().
getJsonObject
(
"data.list.
get(3)
.id"
);
Object
id
=
listRes
.
jsonPath
().
getJsonObject
(
"data.list.
find {it.itemId == '9398'}
.id"
);
String
desc
=
listRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
MANAGER_exclusiveItemPage
,
"获取id失败"
,
listRes
.
body
().
asString
()));
companyCount
=
listRes
.
jsonPath
().
getInt
(
"data.list.size()"
);
...
...
@@ -761,8 +763,6 @@ public class HomePage implements Authorization {
sleep
(
5000
);
//验证删除是否成功
Response
response
=
network
.
getResponse
(
Daily_getTagList
);
Object
tagId
=
response
.
jsonPath
().
getJsonObject
(
"data.get(1).id"
);
Map
<
String
,
Object
>
paramsList
=
new
HashMap
<>();
paramsList
.
put
(
"firstTagId"
,
tagId
);
paramsList
.
put
(
"pageSize"
,
20
);
...
...
@@ -770,7 +770,7 @@ public class HomePage implements Authorization {
paramsList
.
put
(
"source"
,
1
);
Response
dataRes
=
network
.
getResponse
(
paramsList
,
HOME_companyGetContentList
);
int
totalCount
=
dataRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
int
totalCountNew
=
companyCount
-
3
;
//因为其中还包含2个视频,一个删除的文章,所以减去3
int
totalCountNew
=
companyCount
-
1
;
//
Assert
.
assertEquals
(
totalCount
,
totalCountNew
,
network
.
message
(
paramsList
,
HOME_companyGetContentList
,
"获取公司专区内容列表数据错误"
,
dataRes
.
body
().
asString
()));
}
...
...
@@ -778,14 +778,17 @@ public class HomePage implements Authorization {
@Test
(
description
=
"管理后台_删除公司专区视频"
,
priority
=
43
)
public
void
管理后台
_
删除公司专区视频
(){
//获取删除的视频的id
Response
response
=
network
.
getResponse
(
Daily_getTagList
);
Object
tagId
=
response
.
jsonPath
().
getJsonObject
(
"data.get(0).id"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"exclusiveAreaId"
,
21
);
params
.
put
(
"title"
,
""
);
params
.
put
(
"state"
,
0
);
params
.
put
(
"firstTagId"
,
tagId
);
params
.
put
(
"pageNo"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
listRes
=
network
.
getResponse
(
params
,
MANAGER_exclusiveItemPage
);
Object
id
=
listRes
.
jsonPath
().
getJsonObject
(
"data.list.
get(0)
.id"
);
Object
id
=
listRes
.
jsonPath
().
getJsonObject
(
"data.list.
find {it.itemId == '248119'}
.id"
);
String
desc
=
listRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
MANAGER_exclusiveItemPage
,
"获取id失败"
,
listRes
.
body
().
asString
()));
companyCount
=
listRes
.
jsonPath
().
getInt
(
"data.list.size()"
);
...
...
@@ -799,8 +802,6 @@ public class HomePage implements Authorization {
sleep
(
5000
);
//验证删除是否成功
Response
response
=
network
.
getResponse
(
Daily_getTagList
);
Object
tagId
=
response
.
jsonPath
().
getJsonObject
(
"data.get(0).id"
);
Map
<
String
,
Object
>
paramsList
=
new
HashMap
<>();
paramsList
.
put
(
"firstTagId"
,
tagId
);
paramsList
.
put
(
"pageSize"
,
20
);
...
...
@@ -808,7 +809,7 @@ public class HomePage implements Authorization {
paramsList
.
put
(
"source"
,
1
);
Response
dataRes
=
network
.
getResponse
(
paramsList
,
HOME_companyGetContentList
);
int
totalCountNew
=
dataRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
Assert
.
assertEquals
(
totalCountNew
,
companyCount
-
2
,
network
.
message
(
paramsList
,
HOME_companyGetContentList
,
"获取公司专区内容列表数据错误"
,
dataRes
.
body
().
asString
()));
Assert
.
assertEquals
(
totalCountNew
,
companyCount
-
1
,
network
.
message
(
paramsList
,
HOME_companyGetContentList
,
"获取公司专区内容列表数据错误"
,
dataRes
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/assistant/menu/PersonalCenter.java
View file @
889a80d8
...
...
@@ -434,7 +434,7 @@ public class PersonalCenter implements Authorization{
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_getIncreaseStaffConfig
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
result
,
network
.
message
(
params
,
SELLERCARD_getIncreaseStaffConfig
,
"配置列表为空"
,
response
.
body
().
asString
()));
size
=
response
.
jsonPath
().
getInt
(
"data.find {it.val == true}.size()"
);
size
=
response
.
jsonPath
().
getInt
(
"data.find
All
{it.val == true}.size()"
);
Assert
.
assertTrue
(
size
==
3
,
network
.
message
(
SELLERCARD_getIncreaseStaffConfig
,
"关闭后再开启失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/assistant/pay/Cashback.java
View file @
889a80d8
...
...
@@ -49,297 +49,297 @@ public class Cashback implements Authorization {
@Test
(
description
=
"一级用户绑定分享合伙人关系"
,
priority
=
1
)
public
void
一级用户绑定分享合伙人关系
()
{
newUser1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
sellerId
);
params
.
put
(
"inviterSid"
,
2991
);
params
.
put
(
"openId"
,
openId1
);
params
.
put
(
"userId"
,
userId
);
params
.
put
(
"oaId"
,
1
);
params
.
put
(
"scene"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
PAY_bind
);
boolean
bindResult
=
response
.
jsonPath
().
getBoolean
(
"data.bindResult"
);
Assert
.
assertTrue
(
bindResult
,
network
.
message
(
PAY_bind
,
"用户绑定失败"
,
response
.
body
().
asString
()));
//
Map<String, Object> params = new HashMap<String, Object>();
//
params.put("sellerId",sellerId);
//
params.put("inviterSid",2991);
//
params.put("openId",openId1);
//
params.put("userId",userId);
//
params.put("oaId",1);
//
params.put("scene",1);
//
Response response = network.postResponse(params,PAY_bind);
//
boolean bindResult=response.jsonPath().getBoolean("data.bindResult");
//
Assert.assertTrue(bindResult,network.message(PAY_bind,"用户绑定失败",response.body().asString()));
}
//
@Test
(
description
=
"默认付费_一级用户邀请付费页"
,
priority
=
2
)
//priority 方法执行优先级
public
void
默认付费
_
一级用户邀请付费页
()
{
//代理人续费状态
Map
<
String
,
Object
>
payParams
=
new
HashMap
<
String
,
Object
>();
// @Test (description = "默认付费_一级用户邀请付费页",priority = 2) //priority 方法执行优先级
// public void 默认付费_一级用户邀请付费页() {
// //代理人续费状态
// Map<String, Object> payParams = new HashMap<String, Object>();
//// payParams.put("entryDiscountType",1); //入口折扣类型,1-普通,3-邀请,4-优惠码
//// Response response = network.getResponse(PAY_info);
//// int discountType = response.jsonPath().getInt("data.discountType");
//// String superiorName = response.jsonPath().getString("data.invitation.superiorName");
//// int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
//// Assert.assertEquals(discountType,3,network.message(PAY_info,"非邀请付费逻辑",response.body().asString()));
//// Assert.assertEquals(superiorName,"吉吉",network.message(PAY_info,"上级不是吉吉",response.body().asString()));
//// Assert.assertEquals(preferentialPrice,3,network.message(PAY_info,"邀请价格非0.03",response.body().asString()));
// }
//
// @Test(description = "邀请的待支付好友列表",priority = 3)
// public void 邀请的待支付好友列表() {
// agentTku();
// Map<String, Object> Params = new HashMap<String, Object>();
// Params.put("distributionListType",1);
// Params.put("pageIndex",1);
// Params.put("pageSize",10);
// Response response = network.getResponse(Params,PAY_distributionList);
// Object list=response.jsonPath().getJsonObject("data.list");
// String nickname=response.jsonPath().getString("data.list.get(0).nickname");
// Assert.assertNotNull(list,network.message(PAY_distributionList,"待付款好友列表为null",response.body().asString()));
//// Assert.assertEquals(nickname,"小葡萄",network.message(PAY_distributionList,"待付款微信昵称错误",response.body().asString()));
// }
//
// @Test (description = "返现用户付费_一级用户下单并支付成功",priority = 4)
// public void 返现用户付费_一级用户下单并支付成功() {
// newUser1();
// //创建支付
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("entryDiscountType",1);
// params.put("discountType",3); //实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
// params.put("paySource","2");
// Response response = network.postResponse(params,PAY_create);
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(params, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
//
// params.clear();
// int data = 2;
// int i = 0;
// try {
// // 轮训下单接口
// while (data == 2){
// sleep(2000);
//
// params.put("tradeNo",tradeNo);
// response = network.getResponse(params,PAY_result);
// data = response.jsonPath().getInt("data");//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
// i++;
// if (i == 10){
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "轮训支付结果超过10次", response.body().asString()));
// break;
// }
// }
// }catch (Exception e){
// e.printStackTrace();
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "获取数据失败", response.body().asString()));
// }
// Assert.assertEquals(data,3,network.message(USER_INFO,"支付失败",response.body().asString()));
// // 检查会员开通结果
// response = network.getResponse(USER_INFO);
// boolean isVip = response.jsonPath().getBoolean("data.vipValid");
// Assert.assertTrue(isVip,network.message(USER_INFO,"微信支付成功,但是接口返回还是非会员状态",response.body().asString()));
//
// }
//
//
// @Test (description = "默认付费_续费页",priority = 5) //priority 方法执行优先级
// public void 默认付费_续费页() {
// sleep(2000);
// //代理人续费状态
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.put("entryDiscountType",1); //入口折扣类型,1-普通,3-邀请,4-优惠码
// Response response = network.getResponse(PAY_info);
// int discountType = response.jsonPath().getInt("data.discountType");
// int validity = response.jsonPath().getInt("data.validity");
// int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
// Assert.assertEquals(discountType,2,network.message(PAY_info,"非续费逻辑",response.body().asString()));
// Assert.assertEquals(validity,12,network.message(PAY_info,"增加会员时长非12个月",response.body().asString()));
// Assert.assertEquals(preferentialPrice,2,network.message(PAY_info,"续费价格非0.02",response.body().asString()));
//
// //会员类型版本判断
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("t",System.currentTimeMillis());
// response = network.getResponse(params, version_info);
// int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1为通用版 2为保险版
// Assert.assertEquals(userVersion,2,network.message(params, version_info,"会员类型版本判断:判断错误,此版本为通用版",response.body().asString()));
// }
//
// @Test (description = "返现用户付费_一级用户续费并支付成功",priority = 6)
// public void 返现用户付费_一级用户续费并支付成功() {
// //创建支付
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("entryDiscountType",1);
// params.put("discountType",2); //实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
// params.put("paySource","2");
// Response response = network.postResponse(params,PAY_create);
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(params, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
//
// params.clear();
// int data = 2;
// int i = 0;
// try {
// // 轮训下单接口
// while (data == 2){
// sleep(2000);
//
// params.put("tradeNo",tradeNo);
// response = network.getResponse(params,PAY_result);
// data = response.jsonPath().getInt("data");//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
// i++;
// if (i == 10){
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "轮训支付结果超过10次", response.body().asString()));
// break;
// }
// }
// }catch (Exception e){
// e.printStackTrace();
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "获取数据失败", response.body().asString()));
// }
// Assert.assertEquals(data,3,network.message(USER_INFO,"支付失败",response.body().asString()));
// }
//
// @Test(description = "二级用户绑定分享合伙人关系",priority = 7)
// public void 二级用户绑定分享合伙人关系() {
// newUser2();
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("sellerId",sellerId2);
// params.put("inviterSid",sellerId);
// params.put("openId",openId2);
// params.put("userId",userId2);
// params.put("oaId",1);
// params.put("scene",1);
// Response response = network.postResponse(params,PAY_bind);
// boolean bindResult=response.jsonPath().getBoolean("data.bindResult");
// Assert.assertTrue(bindResult,network.message(PAY_bind,"用户绑定失败",response.body().asString()));
// }
//
// @Test (description = "默认付费_二级用户邀请付费页",priority = 8) //priority 方法执行优先级
// public void 默认付费_二级用户邀请付费页() {
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.put("entryDiscountType",1); //入口折扣类型,1-普通,3-邀请,4-优惠码
// Response response = network.getResponse(PAY_info);
// int discountType = response.jsonPath().getInt("data.discountType");
// String superiorName = response.jsonPath().getString("data.invitation.superiorName");
// int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
// Assert.assertEquals(discountType,3,network.message(PAY_info,"非邀请付费逻辑",response.body().asString()));
//
Assert.assertEquals(superiorName,"吉吉",network.message(PAY_info,"上级不是吉吉
",response.body().asString()));
//
// Assert.assertEquals(superiorName,"小葡萄",network.message(PAY_info,"上级邀请人错误
",response.body().asString()));
// Assert.assertEquals(preferentialPrice,3,network.message(PAY_info,"邀请价格非0.03",response.body().asString()));
}
@Test
(
description
=
"邀请的待支付好友列表"
,
priority
=
3
)
public
void
邀请的待支付好友列表
()
{
agentTku
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<
String
,
Object
>();
Params
.
put
(
"distributionListType"
,
1
);
Params
.
put
(
"pageIndex"
,
1
);
Params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
Params
,
PAY_distributionList
);
Object
list
=
response
.
jsonPath
().
getJsonObject
(
"data.list"
);
String
nickname
=
response
.
jsonPath
().
getString
(
"data.list.get(0).nickname"
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
PAY_distributionList
,
"待付款好友列表为null"
,
response
.
body
().
asString
()));
// Assert.assertEquals(nickname,"小葡萄",network.message(PAY_distributionList,"待付款微信昵称错误",response.body().asString()));
}
@Test
(
description
=
"返现用户付费_一级用户下单并支付成功"
,
priority
=
4
)
public
void
返现用户付费
_
一级用户下单并支付成功
()
{
newUser1
();
//创建支付
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"entryDiscountType"
,
1
);
params
.
put
(
"discountType"
,
3
);
//实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
params
.
put
(
"paySource"
,
"2"
);
Response
response
=
network
.
postResponse
(
params
,
PAY_create
);
tradeNo
=
response
.
jsonPath
().
getString
(
"data.tradeNo"
);
Assert
.
assertNotNull
(
tradeNo
,
network
.
message
(
params
,
PAY_create
,
"拉起支付:拉起微信支付失败"
,
response
.
body
().
asString
()));
//判断订单号是否为空
params
.
clear
();
int
data
=
2
;
int
i
=
0
;
try
{
// 轮训下单接口
while
(
data
==
2
){
sleep
(
2000
);
params
.
put
(
"tradeNo"
,
tradeNo
);
response
=
network
.
getResponse
(
params
,
PAY_result
);
data
=
response
.
jsonPath
().
getInt
(
"data"
);
//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
i
++;
if
(
i
==
10
){
Assert
.
fail
(
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"轮训支付结果超过10次"
,
response
.
body
().
asString
()));
break
;
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
response
.
body
().
asString
()));
}
Assert
.
assertEquals
(
data
,
3
,
network
.
message
(
USER_INFO
,
"支付失败"
,
response
.
body
().
asString
()));
// 检查会员开通结果
response
=
network
.
getResponse
(
USER_INFO
);
boolean
isVip
=
response
.
jsonPath
().
getBoolean
(
"data.vipValid"
);
Assert
.
assertTrue
(
isVip
,
network
.
message
(
USER_INFO
,
"微信支付成功,但是接口返回还是非会员状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"默认付费_续费页"
,
priority
=
5
)
//priority 方法执行优先级
public
void
默认付费
_
续费页
()
{
sleep
(
2000
);
//代理人续费状态
Map
<
String
,
Object
>
payParams
=
new
HashMap
<
String
,
Object
>();
payParams
.
put
(
"entryDiscountType"
,
1
);
//入口折扣类型,1-普通,3-邀请,4-优惠码
Response
response
=
network
.
getResponse
(
PAY_info
);
int
discountType
=
response
.
jsonPath
().
getInt
(
"data.discountType"
);
int
validity
=
response
.
jsonPath
().
getInt
(
"data.validity"
);
int
preferentialPrice
=
response
.
jsonPath
().
getInt
(
"data.preferentialPrice"
);
Assert
.
assertEquals
(
discountType
,
2
,
network
.
message
(
PAY_info
,
"非续费逻辑"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
validity
,
12
,
network
.
message
(
PAY_info
,
"增加会员时长非12个月"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
preferentialPrice
,
2
,
network
.
message
(
PAY_info
,
"续费价格非0.02"
,
response
.
body
().
asString
()));
//会员类型版本判断
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"t"
,
System
.
currentTimeMillis
());
response
=
network
.
getResponse
(
params
,
version_info
);
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data.find {it.openType == 1}.userVersion"
);
// 找出开启状态的版本类型 1为通用版 2为保险版
Assert
.
assertEquals
(
userVersion
,
2
,
network
.
message
(
params
,
version_info
,
"会员类型版本判断:判断错误,此版本为通用版"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"返现用户付费_一级用户续费并支付成功"
,
priority
=
6
)
public
void
返现用户付费
_
一级用户续费并支付成功
()
{
//创建支付
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"entryDiscountType"
,
1
);
params
.
put
(
"discountType"
,
2
);
//实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
params
.
put
(
"paySource"
,
"2"
);
Response
response
=
network
.
postResponse
(
params
,
PAY_create
);
tradeNo
=
response
.
jsonPath
().
getString
(
"data.tradeNo"
);
Assert
.
assertNotNull
(
tradeNo
,
network
.
message
(
params
,
PAY_create
,
"拉起支付:拉起微信支付失败"
,
response
.
body
().
asString
()));
//判断订单号是否为空
params
.
clear
();
int
data
=
2
;
int
i
=
0
;
try
{
// 轮训下单接口
while
(
data
==
2
){
sleep
(
2000
);
params
.
put
(
"tradeNo"
,
tradeNo
);
response
=
network
.
getResponse
(
params
,
PAY_result
);
data
=
response
.
jsonPath
().
getInt
(
"data"
);
//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
i
++;
if
(
i
==
10
){
Assert
.
fail
(
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"轮训支付结果超过10次"
,
response
.
body
().
asString
()));
break
;
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
response
.
body
().
asString
()));
}
Assert
.
assertEquals
(
data
,
3
,
network
.
message
(
USER_INFO
,
"支付失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二级用户绑定分享合伙人关系"
,
priority
=
7
)
public
void
二级用户绑定分享合伙人关系
()
{
newUser2
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sellerId"
,
sellerId2
);
params
.
put
(
"inviterSid"
,
sellerId
);
params
.
put
(
"openId"
,
openId2
);
params
.
put
(
"userId"
,
userId2
);
params
.
put
(
"oaId"
,
1
);
params
.
put
(
"scene"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
PAY_bind
);
boolean
bindResult
=
response
.
jsonPath
().
getBoolean
(
"data.bindResult"
);
Assert
.
assertTrue
(
bindResult
,
network
.
message
(
PAY_bind
,
"用户绑定失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"默认付费_二级用户邀请付费页"
,
priority
=
8
)
//priority 方法执行优先级
public
void
默认付费
_
二级用户邀请付费页
()
{
Map
<
String
,
Object
>
payParams
=
new
HashMap
<
String
,
Object
>();
payParams
.
put
(
"entryDiscountType"
,
1
);
//入口折扣类型,1-普通,3-邀请,4-优惠码
Response
response
=
network
.
getResponse
(
PAY_info
);
int
discountType
=
response
.
jsonPath
().
getInt
(
"data.discountType"
);
String
superiorName
=
response
.
jsonPath
().
getString
(
"data.invitation.superiorName"
);
int
preferentialPrice
=
response
.
jsonPath
().
getInt
(
"data.preferentialPrice"
);
Assert
.
assertEquals
(
discountType
,
3
,
network
.
message
(
PAY_info
,
"非邀请付费逻辑"
,
response
.
body
().
asString
()));
// Assert.assertEquals(superiorName,"小葡萄",network.message(PAY_info,"上级邀请人错误",response.body().asString()));
Assert
.
assertEquals
(
preferentialPrice
,
3
,
network
.
message
(
PAY_info
,
"邀请价格非0.03"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"返现用户付费_二级用户下单并支付成功"
,
priority
=
9
)
public
void
返现用户付费
_
二级用户下单并支付成功
()
{
//创建支付
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"entryDiscountType"
,
1
);
params
.
put
(
"discountType"
,
3
);
//实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
params
.
put
(
"paySource"
,
"2"
);
Response
response
=
network
.
postResponse
(
params
,
PAY_create
);
tradeNo
=
response
.
jsonPath
().
getString
(
"data.tradeNo"
);
Assert
.
assertNotNull
(
tradeNo
,
network
.
message
(
params
,
PAY_create
,
"拉起支付:拉起微信支付失败"
,
response
.
body
().
asString
()));
//判断订单号是否为空
params
.
clear
();
int
data
=
2
;
int
i
=
0
;
try
{
// 轮训下单接口
while
(
data
==
2
){
sleep
(
2000
);
params
.
put
(
"tradeNo"
,
tradeNo
);
response
=
network
.
getResponse
(
params
,
PAY_result
);
data
=
response
.
jsonPath
().
getInt
(
"data"
);
//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
i
++;
if
(
i
==
10
){
Assert
.
fail
(
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"轮训支付结果超过10次"
,
response
.
body
().
asString
()));
break
;
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
params
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
response
.
body
().
asString
()));
}
Assert
.
assertEquals
(
data
,
3
,
network
.
message
(
USER_INFO
,
"支付失败"
,
response
.
body
().
asString
()));
// 检查会员开通结果
response
=
network
.
getResponse
(
USER_INFO
);
boolean
isVip
=
response
.
jsonPath
().
getBoolean
(
"data.vipValid"
);
Assert
.
assertTrue
(
isVip
,
network
.
message
(
USER_INFO
,
"微信支付成功,但是接口返回还是非会员状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取用户版本信息"
,
priority
=
10
)
public
void
获取用户版本信息
()
{
agentTku
();
Response
response
=
network
.
getResponse
(
USER_INFO
);
boolean
isInsuranceVersion
=
response
.
jsonPath
().
getBoolean
(
"data.isInsuranceVersion"
);
Assert
.
assertTrue
(
isInsuranceVersion
,
network
.
message
(
USER_INFO
,
"不是保险版本"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"邀请的已支付好友列表"
,
priority
=
11
)
public
void
邀请的已支付好友列表
()
{
sleep
(
2000
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<
String
,
Object
>();
Params
.
put
(
"pageIndex"
,
1
);
Params
.
put
(
"pageSize"
,
10
);
Params
.
put
(
"distributionListType"
,
2
);
Response
response
=
network
.
getResponse
(
Params
,
PAY_distributionList
);
Object
list
=
response
.
jsonPath
().
getJsonObject
(
"data.list"
);
String
nickname
=
response
.
jsonPath
().
getString
(
"data.list.get(0).nickname"
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
PAY_distributionList
,
"已付款好友列表为null"
,
response
.
body
().
asString
()));
// Assert.assertEquals(nickname,"小葡萄",network.message(PAY_distributionList,"已付款微信昵称错误",response.body().asString()));
}
@Test
(
description
=
"代理人账户信息"
,
priority
=
12
)
public
void
代理人账户信息
()
{
Response
response
=
network
.
getResponse
(
PAY_accInfo
);
double
balance
=
Double
.
parseDouble
(
response
.
jsonPath
().
getString
(
"data.balance"
));
Assert
.
assertTrue
(
balance
>
0
,
network
.
message
(
PAY_accInfo
,
"当前余额为0"
,
response
.
body
().
asString
()));
double
totalPromotionEarnings
=
Double
.
parseDouble
(
response
.
jsonPath
().
getString
(
"data.totalPromotionEarnings"
));
Assert
.
assertTrue
(
totalPromotionEarnings
>
0
,
network
.
message
(
PAY_accInfo
,
"总收益为0"
,
response
.
body
().
asString
()));
double
settleMoney
=
Double
.
parseDouble
(
response
.
jsonPath
().
getString
(
"data.settleMoney"
));
Assert
.
assertTrue
(
settleMoney
>
0
,
network
.
message
(
PAY_accInfo
,
"待结算金额为0"
,
response
.
body
().
asString
()));
int
canWithdraw
=
response
.
jsonPath
().
getInt
(
"data.canWithdraw"
);
Assert
.
assertTrue
(
canWithdraw
==
1
,
network
.
message
(
PAY_accInfo
,
"不可以提现"
,
response
.
body
().
asString
()));
int
minWithdrawMoney
=
response
.
jsonPath
().
getInt
(
"data.minWithdrawMoney"
);
Assert
.
assertTrue
(
minWithdrawMoney
==
1
,
network
.
message
(
PAY_accInfo
,
"最小可提现金额不等于1"
,
response
.
body
().
asString
()));
int
maxWithdrawMoney
=
response
.
jsonPath
().
getInt
(
"data.maxWithdrawMoney"
);
Assert
.
assertTrue
(
maxWithdrawMoney
==
5000
,
network
.
message
(
PAY_accInfo
,
"最大可提现金额不等于5000"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"合伙人账户明细"
,
priority
=
13
)
public
void
合伙人账户明细
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"type"
,
1
);
Params
.
put
(
"pageNo"
,
1
);
Params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
Params
,
PAY_accDetail
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
PAY_accDetail
,
"提现记录为null"
,
response
.
body
().
asString
()));
Params
.
put
(
"type"
,
2
);
response
=
network
.
getResponse
(
Params
,
PAY_accDetail
);
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
PAY_accDetail
,
"提现记录为null"
,
response
.
body
().
asString
()));
float
changeMoney1
=
response
.
jsonPath
().
getFloat
(
"data[0].changeMoney"
);
Assert
.
assertTrue
(
changeMoney1
==
30.0
,
network
.
message
(
PAY_accDetail
,
"二级付费合伙人返现金额不为30"
,
response
.
body
().
asString
()));
float
changeMoney2
=
response
.
jsonPath
().
getFloat
(
"data[1].changeMoney"
);
Assert
.
assertTrue
(
changeMoney2
==
50.0
,
network
.
message
(
PAY_accDetail
,
"一级付费合伙人返现金额不为50"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人提现"
,
priority
=
14
)
public
void
代理人提现
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"withdrawMoney"
,
1
);
Response
response
=
network
.
getResponse
(
Params
,
PAY_withdraw
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
PAY_withdraw
,
"提现失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"普通代理人账户明细"
,
priority
=
15
)
public
void
普通代理人账户明细
()
{
newUser1
();
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"type"
,
2
);
Params
.
put
(
"pageNo"
,
1
);
Params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
Params
,
PAY_accDetail
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
PAY_accDetail
,
"提现记录为null"
,
response
.
body
().
asString
()));
float
changeMoney1
=
response
.
jsonPath
().
getFloat
(
"data[0].changeMoney"
);
Assert
.
assertTrue
(
changeMoney1
==
35.0
,
network
.
message
(
PAY_accDetail
,
"一级付费普通代理人返现金额不为35"
,
response
.
body
().
asString
()));
deleteTestUser
(
userId
);
deleteTestUser
(
userId2
);
}
// }
//
// @Test (description = "返现用户付费_二级用户下单并支付成功",priority = 9)
// public void 返现用户付费_二级用户下单并支付成功() {
// //创建支付
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("entryDiscountType",1);
// params.put("discountType",3); //实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
// params.put("paySource","2");
// Response response = network.postResponse(params,PAY_create);
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(params, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
//
// params.clear();
// int data = 2;
// int i = 0;
// try {
// // 轮训下单接口
// while (data == 2){
// sleep(2000);
//
// params.put("tradeNo",tradeNo);
// response = network.getResponse(params,PAY_result);
// data = response.jsonPath().getInt("data");//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
// i++;
// if (i == 10){
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "轮训支付结果超过10次", response.body().asString()));
// break;
// }
// }
// }catch (Exception e){
// e.printStackTrace();
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "获取数据失败", response.body().asString()));
// }
// Assert.assertEquals(data,3,network.message(USER_INFO,"支付失败",response.body().asString()));
// // 检查会员开通结果
// response = network.getResponse(USER_INFO);
// boolean isVip = response.jsonPath().getBoolean("data.vipValid");
// Assert.assertTrue(isVip,network.message(USER_INFO,"微信支付成功,但是接口返回还是非会员状态",response.body().asString()));
//
// }
//
// @Test(description = "获取用户版本信息",priority = 10)
// public void 获取用户版本信息() {
// agentTku();
// Response response = network.getResponse(USER_INFO);
// boolean isInsuranceVersion=response.jsonPath().getBoolean("data.isInsuranceVersion");
// Assert.assertTrue(isInsuranceVersion,network.message(USER_INFO,"不是保险版本",response.body().asString()));
//
// }
//
// @Test(description = "邀请的已支付好友列表",priority = 11)
// public void 邀请的已支付好友列表() {
// sleep(2000);
// Map<String, Object> Params = new HashMap<String, Object>();
// Params.put("pageIndex",1);
// Params.put("pageSize",10);
// Params.put("distributionListType",2);
// Response response = network.getResponse(Params,PAY_distributionList);
// Object list=response.jsonPath().getJsonObject("data.list");
// String nickname=response.jsonPath().getString("data.list.get(0).nickname");
// Assert.assertNotNull(list,network.message(PAY_distributionList,"已付款好友列表为null",response.body().asString()));
//// Assert.assertEquals(nickname,"小葡萄",network.message(PAY_distributionList,"已付款微信昵称错误",response.body().asString()));
// }
//
// @Test(description = "代理人账户信息",priority = 12)
// public void 代理人账户信息() {
// Response response = network.getResponse(PAY_accInfo);
// double balance=Double.parseDouble(response.jsonPath().getString("data.balance"));
// Assert.assertTrue(balance>0,network.message(PAY_accInfo,"当前余额为0",response.body().asString()));
// double totalPromotionEarnings=Double.parseDouble(response.jsonPath().getString("data.totalPromotionEarnings"));
// Assert.assertTrue(totalPromotionEarnings>0,network.message(PAY_accInfo,"总收益为0",response.body().asString()));
// double settleMoney=Double.parseDouble(response.jsonPath().getString("data.settleMoney"));
// Assert.assertTrue(settleMoney>0,network.message(PAY_accInfo,"待结算金额为0",response.body().asString()));
// int canWithdraw=response.jsonPath().getInt("data.canWithdraw");
// Assert.assertTrue(canWithdraw==1,network.message(PAY_accInfo,"不可以提现",response.body().asString()));
// int minWithdrawMoney=response.jsonPath().getInt("data.minWithdrawMoney");
// Assert.assertTrue(minWithdrawMoney==1,network.message(PAY_accInfo,"最小可提现金额不等于1",response.body().asString()));
// int maxWithdrawMoney=response.jsonPath().getInt("data.maxWithdrawMoney");
// Assert.assertTrue(maxWithdrawMoney==5000,network.message(PAY_accInfo,"最大可提现金额不等于5000",response.body().asString()));
// }
//
// @Test(description = "合伙人账户明细",priority = 13)
// public void 合伙人账户明细() {
// Map<String, Object> Params = new HashMap<>();
// Params.put("type", 1);
// Params.put("pageNo", 1);
// Params.put("pageSize", 20);
// Response response = network.getResponse(Params, PAY_accDetail);
// int size = response.jsonPath().getInt("data.size()");
// Assert.assertTrue(size >0, network.message(PAY_accDetail, "提现记录为null", response.body().asString()));
//
// Params.put("type", 2);
// response = network.getResponse(Params, PAY_accDetail);
// size = response.jsonPath().getInt("data.size()");
// Assert.assertTrue(size >0, network.message(PAY_accDetail, "提现记录为null", response.body().asString()));
// float changeMoney1 = response.jsonPath().getFloat("data[0].changeMoney");
// Assert.assertTrue(changeMoney1 ==30.0, network.message(PAY_accDetail, "二级付费合伙人返现金额不为30", response.body().asString()));
// float changeMoney2 = response.jsonPath().getFloat("data[1].changeMoney");
// Assert.assertTrue(changeMoney2 ==50.0, network.message(PAY_accDetail, "一级付费合伙人返现金额不为50", response.body().asString()));
// }
//
// @Test(description = "代理人提现",priority = 14)
// public void 代理人提现() {
// Map<String, Object> Params = new HashMap<>();
// Params.put("withdrawMoney", 1);
// Response response = network.getResponse(Params, PAY_withdraw);
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(PAY_withdraw, "提现失败", response.body().asString()));
// }
//
// @Test(description = "普通代理人账户明细",priority = 15)
// public void 普通代理人账户明细() {
// newUser1();
// Map<String, Object> Params = new HashMap<>();
// Params.put("type", 2);
// Params.put("pageNo", 1);
// Params.put("pageSize", 20);
// Response response = network.getResponse(Params, PAY_accDetail);
// int size = response.jsonPath().getInt("data.size()");
// Assert.assertTrue(size >0, network.message(PAY_accDetail, "提现记录为null", response.body().asString()));
// float changeMoney1 = response.jsonPath().getFloat("data[0].changeMoney");
// Assert.assertTrue(changeMoney1 ==35.0, network.message(PAY_accDetail, "一级付费普通代理人返现金额不为35", response.body().asString()));
//
// deleteTestUser(userId);
// deleteTestUser(userId2);
// }
}
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
889a80d8
...
...
@@ -136,7 +136,7 @@ public class ForwardAndRead implements Authorization {
// 获取新用户
@Test
(
description
=
"新用户访问"
,
priority
=
7
)
public
void
新用户访问
()
throws
IOException
{
sleep
(
5
000
);
sleep
(
2
000
);
newUser1
();
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
System
.
out
.
println
(
response
.
body
().
asString
());
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
889a80d8
...
...
@@ -109,7 +109,6 @@ public class BasicConfig {
// *************** 客集集域名 ***************
public
static
final
String
HOST
=
"https://kjj.m.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST
=
"https://kjj-activity.duibatest.com.cn"
;
public
static
final
String
ACTIVITY1_HOST
=
"https://kjj-activity-1.duibatest.com.cn"
;
public
static
final
String
SSO_HOST
=
"https://sso.duibatest.com.cn"
;
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
...
...
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