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
91e2ce3e
Commit
91e2ce3e
authored
Jul 29, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增我的客户
parent
e5dde0b5
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
181 deletions
+55
-181
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+0
-58
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+27
-78
MyForward.java
...test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
+0
-1
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+28
-44
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
91e2ce3e
...
...
@@ -60,64 +60,6 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
forwardResult
,
network
.
message
(
param
,
BasicConfig
.
FORWARD
,
"转发名片失败"
,
response
.
body
().
asString
()));
}
// @Test(description = "代理人转发抽奖", priority = 3)
// public void 转发抽奖() throws IOException{
// // 获取抽奖素材ID
// lottery_scId = getContentScId(BasicConfig.LOTTERY_CONTENTID);
//
// // 获取指定中奖客户信息
// Map<String, String> custInfos = new HashMap<>();
// custInfos.put("avatar", getUserInfo(BasicConfig.AGENT_TKU).get("avatar"));
// custInfos.put("visitorId", encodeId(decodeTku(BasicConfig.AGENT_TKU).get("userId")));
// custInfos.put("visitorNickname", getUserInfo(BasicConfig.AGENT_TKU).get("wxName"));
//
// // 指定客户中奖
// List<Object> winners = new ArrayList<>();
// winners.add(custInfos);
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("winners", winners);
// response = network.postResponse(param, BasicConfig.LOTTERRY_addWinnersEn);
// String winnerId = response.jsonPath().getString("data[0].winnerId");
// Assert.assertNotNull(winnerId, network.message(param, BasicConfig.LOTTERRY_addWinnersEn, "添加中奖客户失败", response.body().asString()));
//
// // 保存抽奖配置
// List<String> winnerIds = new ArrayList<>();
// winnerIds.add(winnerId);
// Map<String, Object> prizeDetails = new HashMap<>();
// prizeDetails.put("customPrizeRate", 100);
// prizeDetails.put("customPrizeType", 1);
// prizeDetails.put("prizeImg", "https://yun.duiba.com.cn/kjj-prize-nodeimages/redbag.png");
// prizeDetails.put("prizeName", "奖品红包");
// prizeDetails.put("totalStock", 1);
// prizeDetails.put("winnerIds", winnerIds);
//
// param = new HashMap<>();
// param.put("pageTitle", "暖心冬日好礼");
// param.put("prizeDetails", prizeDetails);
// param.put("scid", lottery_scId);
// response = network.postResponse(param, BasicConfig.LOTTERRY_saveOrUpdateConf);
// activityConfId = response.jsonPath().getString("data");
// Assert.assertNotNull(activityConfId, network.message(param, BasicConfig.LOTTERRY_saveOrUpdateConf, "抽奖配置保存失败,未生成活动ID", response.body().asString()));
//
// // 获取配置详情
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("activityConfId", activityConfId);
// response = network.getResponse(param, BasicConfig.LOTTERRY_getConf);
// activityCustomPrizeId = response.jsonPath().getString("data.prizeDetails[0].activityCustomPrizeId");
// Assert.assertEquals(response.jsonPath().getString("data.activityConfId"), activityConfId, network.message(param, BasicConfig.LOTTERRY_getConf, "获取配置与预期不对应", response.body().asString()));
// Assert.assertNotNull(activityCustomPrizeId, network.message(param, BasicConfig.LOTTERRY_getConf, "activityCustomPrizeId值为空", response.body().asString()));
//
// // 分享抽奖
// param = new HashMap<>();
// param.put("scId", lottery_scId);
// param.put("forwardType", 1);
// response = network.getResponse(param, BasicConfig.FORWARD);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD, "接口请求失败", response.body().asString()));
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.FORWARD, "分享抽奖活动失败", response.body().asString()));
// }
// 访客访问素材及产生线索
@Test
(
description
=
"访客阅读文章"
,
priority
=
3
)
public
void
访客阅读文章
()
throws
IOException
{
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
91e2ce3e
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
View file @
91e2ce3e
...
...
@@ -4,7 +4,6 @@ import com.kjj.cases.admin.Authorization;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
io.restassured.response.Response
;
import
org.apache.groovy.json.internal.IO
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
91e2ce3e
...
...
@@ -262,8 +262,8 @@ public class WhoSawMe implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"接口请求失败"
,
response
.
body
().
asString
()));
boolean
hasSubordinate
=
response
.
jsonPath
().
getBoolean
(
"data.hasSubordinate"
);
int
teamNumber
=
response
.
jsonPath
().
getInt
(
"data.teamNumber"
);
Assert
.
assertTrue
(
hasSubordinate
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"
用户
查询无下级"
,
response
.
body
().
asString
()));
Assert
.
assert
True
(
teamNumber
>=
2
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"代理人团队人数有误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasSubordinate
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"
代理人
查询无下级"
,
response
.
body
().
asString
()));
Assert
.
assert
Equals
(
teamNumber
,
2
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"代理人团队人数有误"
,
response
.
body
().
asString
()));
}
// 代理人团队成员数
...
...
@@ -274,48 +274,31 @@ public class WhoSawMe implements Authorization {
response
=
network
.
getResponse
(
param
,
BasicConfig
.
TEAMMEMBERNUM
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBERNUM
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
personalNum
=
response
.
jsonPath
().
getInt
(
"data.personalNum"
);
Assert
.
assertTrue
(
personalNum
>=
2
,
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBERNUM
,
"代理人团队人数有误"
,
response
.
body
().
asString
()));
}
// // 获取今日团队数据
// @Test(description = "获取今日团队数据", priority = 21)
// public void 获取今日团队数据() throws IOException{
// param = new HashMap<>();
// param.put("superiorId", xxxSellerId);
// param.put("sortType", 4);
// param.put("team", false);
// response = network.getResponse(param, BasicConfig.TEAMDATA);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMDATA, "接口请求失败", response.body().asString()));
// int forwardMaterialNum = response.jsonPath().getInt("data.forwardMaterialNum");
// int forwardCardNum = response.jsonPath().getInt("data.forwardCardNum");
// int gainSaleClueNum = response.jsonPath().getInt("data.gainSaleClueNum");
// Assert.assertEquals(forwardCardNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发卡片数量不为1", response.body().asString()));
// Assert.assertEquals(forwardMaterialNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发素材数量不为1", response.body().asString()));
// Assert.assertEquals(gainSaleClueNum, 8, network.message(param, BasicConfig.TEAMDATA, "获得线索数量不为2", response.body().asString()));
// }
// // 获取个人排行列表
// @Test(description = "获取个人排行列表", priority = 22)
// public void 获取个人排行列表() throws IOException{
// param= new HashMap<>();
// param.put("pageIndex", 1);
// param.put("pageSize", 20);
// param.put("sortType", 4);
// param.put("superiorId", xxxSellerId);
// param.put("listType", 4);
// param.put("team", false);
// response = network.getResponse(param, BasicConfig.TEAMRANKINGLIST);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMRANKINGLIST, "接口请求失败", response.body().asString()));
// List<RankingList> rankingLists = JsonUtil.parseResponseToPageBean(response, RankingList.class);
// List<String> memberSids = Lists.newArrayList();
// memberSids.add(far.encodeId(xxxSellerId));
// memberSids.add(far.encodeId(far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId")));
// Assert.assertTrue(rankingLists.size() >= 2, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜人员数有误", response.body().asString()));
// for (int i = 0; i < rankingLists.size(); i++){
// boolean isExist = memberSids.contains(rankingLists.get(i).getSellerId());
// Assert.assertTrue(isExist, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜内成员sid有误", response.body().asString()));
// }
// }
Assert
.
assertEquals
(
personalNum
,
2
,
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBERNUM
,
"代理人团队人数有误"
,
response
.
body
().
asString
()));
}
// 获取个人排行列表
@Test
(
description
=
"获取个人排行列表"
,
priority
=
22
)
public
void
获取个人排行列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"superiorId"
,
xxxSellerId
);
param
.
put
(
"listType"
,
4
);
param
.
put
(
"team"
,
false
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
TEAMRANKINGLIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TEAMRANKINGLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
RankingList
>
rankingLists
=
JsonUtil
.
parseResponseToPageBean
(
response
,
RankingList
.
class
);
List
<
String
>
memberSids
=
Lists
.
newArrayList
();
memberSids
.
add
(
far
.
encodeId
(
xxxSellerId
));
memberSids
.
add
(
far
.
encodeId
(
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
)));
Assert
.
assertTrue
(
rankingLists
.
size
()
>=
2
,
network
.
message
(
param
,
BasicConfig
.
TEAMRANKINGLIST
,
"排行榜人员数有误"
,
response
.
body
().
asString
()));
for
(
int
i
=
0
;
i
<
rankingLists
.
size
();
i
++){
boolean
isExist
=
memberSids
.
contains
(
rankingLists
.
get
(
i
).
getSellerId
());
Assert
.
assertTrue
(
isExist
,
network
.
message
(
param
,
BasicConfig
.
TEAMRANKINGLIST
,
"排行榜内成员sid有误"
,
response
.
body
().
asString
()));
}
}
// 团队任务
...
...
@@ -399,6 +382,7 @@ public class WhoSawMe implements Authorization {
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_TEAMTASKLIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_TEAMTASKLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
}
// 查看今日转发素材列表
@Test
(
description
=
"查看今日转发素材列表"
,
priority
=
29
)
public
void
查看转发素材列表
()
throws
IOException
{
...
...
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