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
505afdc6
Commit
505afdc6
authored
Nov 17, 2021
by
郭姣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集客助手公司专区增加视频类型,秒杀进度优化接口庸碌
parent
f295dbca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
52 deletions
+151
-52
AnchorGetSKList.java
src/test/java/com/kjj/bean/secondKill/AnchorGetSKList.java
+2
-0
HomePage.java
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
+99
-32
SecondKill.java
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
+48
-20
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-0
No files found.
src/test/java/com/kjj/bean/secondKill/AnchorGetSKList.java
View file @
505afdc6
...
...
@@ -7,5 +7,7 @@ public class AnchorGetSKList {
private
int
interactStatus
;
private
String
id
;
private
int
surplusNum
;
private
int
paidNum
;
private
int
unpaidNum
;
private
String
goodsId
;
}
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
505afdc6
...
...
@@ -332,17 +332,10 @@ public class HomePage implements Authorization {
String
infoDesc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
infoDesc
,
"OK"
,
network
.
message
(
params
,
MANAGER_simpleInfo
,
"匹配内容失败"
,
response
.
body
().
asString
()));
//获取生效的公司专区素材id
params
.
clear
();
response
=
network
.
getResponse
(
params
,
MANAGER_manage
);
int
index
=
response
.
jsonPath
().
getInt
(
"data.list[2].parentTagList.size()"
)-
1
;
int
tag
=
response
.
jsonPath
().
getJsonObject
(
"data.list[2].parentTagList.get("
+
index
+
").id"
);
Assert
.
assertNotNull
(
tag
,
network
.
message
(
params
,
MANAGER_simpleInfo
,
"匹配内容失败"
,
response
.
body
().
asString
()));
//新增公司专区内容
Map
<
String
,
Object
>
addParams
=
new
HashMap
<>();
List
list
=
new
ArrayList
();
list
.
add
(
tag
);
list
.
add
(
728
);
//该id来自于管理后台—标签管理—标签版本配置—公司专区
List
tagList
=
new
ArrayList
();
tagList
.
add
(
list
);
addParams
.
put
(
"contentTag"
,
""
);
...
...
@@ -361,16 +354,51 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
addParams
,
MANAGER_itemAddOrUpdate
,
"新增公司专区内容失败"
,
addRes
.
body
().
asString
()));
}
//管理后台新增公司专区视频
@Test
(
description
=
"管理后台_公司专区新增视频"
,
priority
=
19
)
public
void
公司专区新增视频
(){
//根据文章内容id匹配
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
248119
);
params
.
put
(
"contentType"
,
"video"
);
Response
response
=
network
.
getResponse
(
params
,
MANAGER_simpleInfo
);
String
mainImgUrl
=
response
.
jsonPath
().
getString
(
"data.mainImgUrl"
);
String
title
=
response
.
jsonPath
().
getString
(
"data.title"
);
String
infoDesc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
infoDesc
,
"OK"
,
network
.
message
(
params
,
MANAGER_simpleInfo
,
"匹配内容失败"
,
response
.
body
().
asString
()));
//新增公司专区内容
Map
<
String
,
Object
>
addParams
=
new
HashMap
<>();
List
list
=
new
ArrayList
();
list
.
add
(
588
);
//该id来自于管理后台—标签管理—标签版本配置—公司专区
List
tagList
=
new
ArrayList
();
tagList
.
add
(
list
);
addParams
.
put
(
"contentTag"
,
""
);
addParams
.
put
(
"customUrl"
,
""
);
addParams
.
put
(
"id"
,
""
);
addParams
.
put
(
"exclusiveAreaId"
,
21
);
addParams
.
put
(
"itemId"
,
248119
);
addParams
.
put
(
"itemType"
,
"video"
);
addParams
.
put
(
"mainImgUrl"
,
mainImgUrl
);
addParams
.
put
(
"sort"
,
1
);
addParams
.
put
(
"tagList"
,
tagList
);
addParams
.
put
(
"title"
,
title
);
System
.
out
.
println
(
addParams
);
Response
addRes
=
network
.
postResponse
(
addParams
,
MANAGER_itemAddOrUpdate
);
String
desc
=
addRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
addParams
,
MANAGER_itemAddOrUpdate
,
"新增公司专区视频失败"
,
addRes
.
body
().
asString
()));
}
//获取首页公司专区
@Test
(
description
=
"首页_公司专区"
,
priority
=
19
)
@Test
(
description
=
"首页_公司专区"
,
priority
=
20
)
public
void
首页
_
公司专区
(){
Response
response
=
network
.
getResponse
(
HOME_getExclusiveArea
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
HOME_getExclusiveArea
,
"获取公司专区失败"
,
response
.
body
().
asString
()));
}
//获取公司首页公司专区列表
HOME_companyGetContentList
@Test
(
description
=
"首页_公司专区列表"
,
priority
=
2
0
)
//获取公司首页公司专区列表
@Test
(
description
=
"首页_公司专区列表"
,
priority
=
2
1
)
public
void
首页
_
公司专区列表
(){
//获取公司专区标签id
Response
response
=
network
.
getResponse
(
Daily_getTagList
);
...
...
@@ -391,7 +419,7 @@ public class HomePage implements Authorization {
}
//管理后台删除文章
@Test
(
description
=
"管理后台_删除公司专区内容"
,
priority
=
2
1
)
@Test
(
description
=
"管理后台_删除公司专区内容"
,
priority
=
2
2
)
public
void
管理后台
_
删除公司专区内容
(){
//获取删除的内容的id
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -401,6 +429,45 @@ 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(1).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()"
);
System
.
out
.
println
(
companyCount
);
//删除公司专区内容
Map
<
String
,
Object
>
delParams
=
new
HashMap
<>();
delParams
.
put
(
"id"
,
id
);
Response
delRes
=
network
.
getResponse
(
delParams
,
MANAGER_exclusiveItemDel
);
String
delDesc
=
delRes
.
jsonPath
().
getJsonObject
(
"desc"
);
Assert
.
assertEquals
(
delDesc
,
"OK"
,
network
.
message
(
delParams
,
MANAGER_exclusiveItemDel
,
"删除公司专区内容失败"
,
delRes
.
body
().
asString
()));
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
);
paramsList
.
put
(
"pageIndex"
,
1
);
paramsList
.
put
(
"source"
,
1
);
Response
dataRes
=
network
.
getResponse
(
paramsList
,
HOME_companyGetContentList
);
int
totalCount
=
dataRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
int
totalCountNew
=
companyCount
-
2
;
//因为其中还包含一个视频,一个删除的文章,所以减去2
Assert
.
assertEquals
(
totalCount
,
totalCountNew
,
network
.
message
(
paramsList
,
HOME_companyGetContentList
,
"获取公司专区内容列表数据错误"
,
dataRes
.
body
().
asString
()));
}
//管理后台删除文章
@Test
(
description
=
"管理后台_删除公司专区视频"
,
priority
=
23
)
public
void
管理后台
_
删除公司专区视频
(){
//获取删除的视频的id
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"exclusiveAreaId"
,
21
);
params
.
put
(
"title"
,
""
);
params
.
put
(
"state"
,
0
);
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"
);
String
desc
=
listRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
MANAGER_exclusiveItemPage
,
"获取id失败"
,
listRes
.
body
().
asString
()));
...
...
@@ -429,7 +496,7 @@ public class HomePage implements Authorization {
}
//管理后台新增成功案例
@Test
(
description
=
"管理后台_新增成功案例"
,
priority
=
2
2
)
@Test
(
description
=
"管理后台_新增成功案例"
,
priority
=
2
4
)
public
void
新增成功案例
(){
//根据内容ID匹配内容标题
...
...
@@ -457,7 +524,7 @@ public class HomePage implements Authorization {
Assert
.
assertTrue
(
addSuccess
,
network
.
message
(
addParams
,
MANAGER_addOrUpdateCases
,
"新增成功案例失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_获取成功案例列表"
,
priority
=
2
3
)
@Test
(
description
=
"管理后台_获取成功案例列表"
,
priority
=
2
5
)
public
void
获取成功案例列表
(){
Response
response
=
network
.
getResponse
(
MANAGER_caseList
);
Object
list
=
response
.
jsonPath
().
getJsonObject
(
"data.list"
);
...
...
@@ -465,7 +532,7 @@ public class HomePage implements Authorization {
Assert
.
assertNotNull
(
list
,
network
.
message
(
MANAGER_caseList
,
"获取成功案例列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_获取案例详情"
,
priority
=
2
4
)
@Test
(
description
=
"管理后台_获取案例详情"
,
priority
=
2
6
)
public
void
获取案例详情
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
caseId
);
...
...
@@ -474,7 +541,7 @@ public class HomePage implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_successCaseDetail
,
"获取案例详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_编辑案例"
,
priority
=
2
5
)
@Test
(
description
=
"管理后台_编辑案例"
,
priority
=
2
7
)
public
void
编辑案例
(){
//编辑成功案例
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -493,7 +560,7 @@ public class HomePage implements Authorization {
Assert
.
assertTrue
(
addSuccess
,
network
.
message
(
params
,
MANAGER_addOrUpdateCases
,
"编辑成功案例失败"
,
addRes
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_上架/下架成功案例"
,
priority
=
2
6
)
@Test
(
description
=
"管理后台_上架/下架成功案例"
,
priority
=
2
8
)
public
void
上架成功案例
(){
//上架成功案例 status = 2
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -517,7 +584,7 @@ public class HomePage implements Authorization {
}
//个人中心—我的反馈
@Test
(
description
=
"个人中心_我的反馈"
,
priority
=
2
7
)
@Test
(
description
=
"个人中心_我的反馈"
,
priority
=
2
9
)
public
void
我的反馈
(){
//tku 切换为访客的
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
...
...
@@ -533,7 +600,7 @@ public class HomePage implements Authorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
HOME_feedBackSave
,
"反馈意见提交成功"
,
response
.
body
().
asString
()));
}
//管理后台-集客助手反馈
@Test
(
description
=
"管理后台_集客助手反馈"
,
priority
=
28
)
@Test
(
description
=
"管理后台_集客助手反馈"
,
priority
=
30
)
public
void
集客助手反馈结果
(){
//验证管理后台是否接收到消息
Response
manageRes
=
network
.
getResponse
(
MANAGER_feedBackList
);
...
...
@@ -544,7 +611,7 @@ public class HomePage implements Authorization {
//***********************文章配置素材*******************************
@Test
(
description
=
"代理人_访问文章未配置互动素材"
,
priority
=
29
)
@Test
(
description
=
"代理人_访问文章未配置互动素材"
,
priority
=
31
)
public
void
代理人
_
访问文章未配置互动素材
()
{
agentTku
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -579,7 +646,7 @@ public class HomePage implements Authorization {
Assert
.
assertNotNull
(
scid
,
network
.
message
(
params
,
GETSCID
,
"获取文章的scid失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_新增互动方案"
,
priority
=
3
0
)
@Test
(
description
=
"管理后台_新增互动方案"
,
priority
=
3
2
)
public
void
管理后台
_
新增互动方案
()
{
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -638,7 +705,7 @@ public class HomePage implements Authorization {
Assert
.
assertNotNull
(
activity2
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_修改互动方案"
,
priority
=
3
1
)
@Test
(
description
=
"管理后台_修改互动方案"
,
priority
=
3
3
)
public
void
管理后台
_
修改互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
activity2
);
...
...
@@ -665,7 +732,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
activityName
,
"快来摆摊测试吧"
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_通过方案id查找方案是否存在"
,
priority
=
3
2
)
@Test
(
description
=
"管理后台_通过方案id查找方案是否存在"
,
priority
=
3
4
)
public
void
管理后台
_
通过方案
id
查找方案是否存在
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//存在
...
...
@@ -685,7 +752,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
data
,
null
,
network
.
message
(
params
,
MANAGER_activityName
,
"此方案存在"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_新增文章关联互动方案"
,
priority
=
3
3
)
@Test
(
description
=
"管理后台_新增文章关联互动方案"
,
priority
=
3
5
)
public
void
管理后台
_
新增文章关联互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
ArrayList
<
Integer
>
interactIds
=
new
ArrayList
<
Integer
>();
...
...
@@ -717,7 +784,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
aolutionId
,
activity2
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_互动方案使用中会删除失败"
,
priority
=
3
4
)
@Test
(
description
=
"管理后台_互动方案使用中会删除失败"
,
priority
=
3
6
)
public
void
管理后台
_
互动方案使用中会删除失败
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
activity2
);
...
...
@@ -738,7 +805,7 @@ public class HomePage implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"有文章使用互动方案删除成功"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_访问文章新增配置互动素材"
,
priority
=
3
5
)
@Test
(
description
=
"代理人_访问文章新增配置互动素材"
,
priority
=
3
7
)
public
void
代理人
_
访问文章新增配置互动素材
()
{
sleep
(
10000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -756,7 +823,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
activityId
,
answer2
,
network
.
message
(
params
,
ARTICLE_interact
,
"访问文章配置素材ID与实际配置不一致"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_修改文章关联互动方案"
,
priority
=
3
6
)
@Test
(
description
=
"管理后台_修改文章关联互动方案"
,
priority
=
3
8
)
public
void
管理后台
_
修改文章关联互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
ArrayList
<
Integer
>
interactIds
=
new
ArrayList
<
Integer
>();
...
...
@@ -785,7 +852,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
aolutionId
,
activity1
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_访问文章修改配置互动素材并转发"
,
priority
=
3
7
)
@Test
(
description
=
"代理人_访问文章修改配置互动素材并转发"
,
priority
=
3
9
)
public
void
代理人
_
访问文章修改配置互动素材并转发
()
{
sleep
(
10000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -814,7 +881,7 @@ public class HomePage implements Authorization {
Assert
.
assertNotNull
(
response
.
jsonPath
().
getJsonObject
(
"data"
),
network
.
message
(
USER_INFO
,
"获取用户信息失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客_访问文章并参与测评"
,
priority
=
38
)
@Test
(
description
=
"访客_访问文章并参与测评"
,
priority
=
40
)
public
void
访客
_
访问文章并参与测评
()
{
//切换为新用户小葡萄,每次都会产生线索
network
.
agentCookies
.
put
(
"tku"
,
tku
);
...
...
@@ -882,7 +949,7 @@ public class HomePage implements Authorization {
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
GAME_sendInfoForRisk
,
"申请领取食谱失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_删除文章关联互动方案"
,
priority
=
39
)
@Test
(
description
=
"管理后台_删除文章关联互动方案"
,
priority
=
41
)
public
void
管理后台
_
删除文章关联互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"articleId"
,
articleId
);
...
...
@@ -906,7 +973,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
size
,
0
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"删除失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_访问文章删除配置互动素材"
,
priority
=
4
0
)
@Test
(
description
=
"代理人_访问文章删除配置互动素材"
,
priority
=
4
2
)
public
void
代理人
_
访问文章删除配置互动素材
()
{
agentTku
();
sleep
(
10000
);
...
...
@@ -919,7 +986,7 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
size
,
0
,
network
.
message
(
params
,
ARTICLE_interact
,
"返回数据不为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_删除互动方案成功"
,
priority
=
4
1
)
@Test
(
description
=
"管理后台_删除互动方案成功"
,
priority
=
4
3
)
public
void
管理后台
_
删除互动方案成功
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
activity1
);
...
...
src/test/java/com/kjj/cases/live/secondKill/SecondKill.java
View file @
505afdc6
...
...
@@ -339,6 +339,19 @@ public class SecondKill implements Authorization {
/**
* 下单
*/
@Test
(
description
=
"访客端秒杀进度"
,
priority
=
18
)
public
void
访客端秒杀进度
(){
visitorAuth1
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
ConfSecondKill
.
skIdFirst
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_goodsProgress
);
boolean
hasUnPaid
=
response
.
jsonPath
().
getBoolean
(
"data.hasUnPaid"
);
boolean
hasStock
=
response
.
jsonPath
().
getBoolean
(
"data.hasStock"
);
Assert
.
assertFalse
(
hasUnPaid
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_goodsProgress
,
"是否有人锁单记录错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasStock
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_goodsProgress
,
"是否有库存记录错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"正常用户下单"
,
priority
=
19
)
public
void
正常用户下单
()
{
visitorAuth1
();
...
...
@@ -451,7 +464,18 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"占用库存"
,
priority
=
24
)
@Test
(
description
=
"管理后台查看秒杀进度"
,
priority
=
24
)
public
void
管理后台查看秒杀进度
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_goodsProgress
);
int
paidNum
=
response
.
jsonPath
().
getInt
(
"data.get(1).paidNum"
);
int
unpaidNum
=
response
.
jsonPath
().
getInt
(
"data.get(1).unpaidNum"
);
Assert
.
assertEquals
(
paidNum
,
0
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_goodsProgress
,
"已支付数据记录错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
unpaidNum
,
1
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_goodsProgress
,
"待支付数据记录错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"占用库存"
,
priority
=
25
)
public
void
占用库存
()
{
// 切换助播端视角获取当前轮次剩余数量
adminAuth
();
...
...
@@ -466,6 +490,10 @@ public class SecondKill implements Authorization {
hasTarget
=
true
;
int
surplusNum
=
secKillList
.
getSurplusNum
();
Assert
.
assertEquals
(
surplusNum
,
3
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"对应轮次剩余数量有误"
,
liveSecKillRes
.
body
().
asString
()));
int
paidNum
=
secKillList
.
getPaidNum
();
Assert
.
assertEquals
(
paidNum
,
0
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"对应轮次已支付数量有误"
,
liveSecKillRes
.
body
().
asString
()));
int
unpaidNum
=
secKillList
.
getUnpaidNum
();
Assert
.
assertEquals
(
unpaidNum
,
1
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
ANCHOR_secondKillLists
,
"对应轮次待支付数量有误"
,
liveSecKillRes
.
body
().
asString
()));
}
}
if
(!
hasTarget
){
...
...
@@ -477,7 +505,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"超时未支付"
,
priority
=
2
5
)
@Test
(
description
=
"超时未支付"
,
priority
=
2
6
)
public
void
超时未支付
()
{
// 助播端视角查看库存是否释放
Map
<
String
,
Object
>
liveSecKillPar
=
new
HashMap
<>();
...
...
@@ -523,7 +551,7 @@ public class SecondKill implements Authorization {
* 放开代理人秒杀限制
* 助播端需先下架秒杀才能进行编辑
*/
@Test
(
description
=
"助播端下架秒杀"
,
priority
=
2
6
)
@Test
(
description
=
"助播端下架秒杀"
,
priority
=
2
7
)
public
void
助播端下架秒杀
()
{
adminAuth
();
Map
<
String
,
Object
>
skOffPar
=
new
HashMap
<>();
...
...
@@ -538,7 +566,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"上架第二轮秒杀,代理人可参与"
,
priority
=
2
7
)
@Test
(
description
=
"上架第二轮秒杀,代理人可参与"
,
priority
=
2
8
)
public
void
上架第二轮秒杀
()
{
Map
<
String
,
Object
>
skOnPar
=
new
HashMap
<>();
skOnPar
.
put
(
"id"
,
ConfSecondKill
.
skIdSecond
);
...
...
@@ -552,7 +580,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"代理人成功下单-占用库存"
,
priority
=
2
8
)
@Test
(
description
=
"代理人成功下单-占用库存"
,
priority
=
2
9
)
public
void
代理人成功下单
()
{
agentAuth
();
// 下单
...
...
@@ -595,7 +623,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"用户下单无库存秒杀失败"
,
priority
=
29
)
@Test
(
description
=
"用户下单无库存秒杀失败"
,
priority
=
30
)
public
void
用户下单无库存秒杀
()
{
visitorAuth1
();
Map
<
String
,
Object
>
orderPar
=
new
HashMap
<>();
...
...
@@ -646,7 +674,7 @@ public class SecondKill implements Authorization {
}
// 秒杀限制
@Test
(
description
=
"添加秒杀限制"
,
priority
=
3
0
)
@Test
(
description
=
"添加秒杀限制"
,
priority
=
3
1
)
public
void
添加秒杀限制
()
{
confIds
=
new
ArrayList
<>();
// 用户已成功下单0元秒杀商品
...
...
@@ -666,7 +694,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"查询秒杀限制组"
,
priority
=
3
1
)
@Test
(
description
=
"查询秒杀限制组"
,
priority
=
3
2
)
public
void
查询秒杀限制组
()
{
Map
<
String
,
Object
>
limitGroupListPar
=
new
HashMap
<>();
limitGroupListPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
@@ -685,7 +713,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"限制组限制用户下单"
,
priority
=
3
2
)
@Test
(
description
=
"限制组限制用户下单"
,
priority
=
3
3
)
public
void
限制组限制用户下单
()
{
// 等待两分钟代理人释放第二轮次库存
ThreadSleepUtils
.
sleep
(
180000
);
...
...
@@ -739,7 +767,7 @@ public class SecondKill implements Authorization {
}
@Test
(
description
=
"删除已上架过的轮次"
,
priority
=
3
3
)
@Test
(
description
=
"删除已上架过的轮次"
,
priority
=
3
4
)
public
void
已上架过的轮次无法删除
()
{
long
id
=
IdMakeUtil
.
managerDecodeingId
(
ConfSecondKill
.
skIdFirst
);
Map
<
String
,
Object
>
delSkPar
=
new
HashMap
<>();
...
...
@@ -758,7 +786,7 @@ public class SecondKill implements Authorization {
}
}
@Test
(
description
=
"用户成功支付"
,
priority
=
3
4
)
@Test
(
description
=
"用户成功支付"
,
priority
=
3
5
)
public
void
用户成功支付
()
{
visitorAuth1
();
// 新建订单
...
...
@@ -799,7 +827,7 @@ public class SecondKill implements Authorization {
Assert
.
fail
(
network
.
message
(
orderResultPar
,
BasicConfig
.
MOBILE_secondKill_goodsOrderResult
,
"获取数据失败"
,
orderResultRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"上架需要秒杀资格的商品"
,
priority
=
3
5
)
@Test
(
description
=
"上架需要秒杀资格的商品"
,
priority
=
3
6
)
public
void
上架需要秒杀资格的商品
(){
adminAuth
();
Map
<
String
,
Object
>
goodsOnPar
=
new
HashMap
<>();
...
...
@@ -813,7 +841,7 @@ public class SecondKill implements Authorization {
Assert
.
fail
(
network
.
message
(
goodsOnPar
,
BasicConfig
.
ANCHOR_secondKillOn
,
"未获取到数据"
,
goodsOnRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"推送秒杀资格券"
,
priority
=
3
6
)
@Test
(
description
=
"推送秒杀资格券"
,
priority
=
3
7
)
public
void
推送秒杀资格券
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -822,7 +850,7 @@ public class SecondKill implements Authorization {
Boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_sendQualification
,
"助播端推送秒杀资格失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取秒杀资格商品列表"
,
priority
=
3
7
)
@Test
(
description
=
"获取秒杀资格商品列表"
,
priority
=
3
8
)
public
void
获取秒杀资格商品列表
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -830,7 +858,7 @@ public class SecondKill implements Authorization {
int
pushCount
=
response
.
jsonPath
().
getInt
(
"data.get(0).pushCount"
);
Assert
.
assertEquals
(
pushCount
,
1
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_secondKillLists
,
"推送次数记录失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H领取秒杀资格"
,
priority
=
3
8
)
@Test
(
description
=
"访客H领取秒杀资格"
,
priority
=
3
9
)
public
void
访客
H
领取秒杀资格
(){
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -841,7 +869,7 @@ public class SecondKill implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_qualification
,
"访客H领取秒杀资格失败"
,
requireRes
.
body
().
asString
()));
timestamp
=
requireRes
.
jsonPath
().
getJsonObject
(
"timestamp"
);
}
@Test
(
description
=
"访客H分享直播间"
,
priority
=
39
)
@Test
(
description
=
"访客H分享直播间"
,
priority
=
40
)
public
void
访客
H
分享直播间
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -853,7 +881,7 @@ public class SecondKill implements Authorization {
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_sign
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询访客H的秒杀商品助力信息"
,
priority
=
4
0
)
@Test
(
description
=
"查询访客H的秒杀商品助力信息"
,
priority
=
4
1
)
public
void
查询访客
H
的秒杀商品助力信息
()
{
visitorAuth9
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -862,7 +890,7 @@ public class SecondKill implements Authorization {
int
qualificationStatus
=
response
.
jsonPath
().
getInt
(
"data.get(0).qualificationStatus"
);
Assert
.
assertTrue
(
qualificationStatus
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_receiveStatus
,
"访客秒杀资格状态记录错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客H完成助力"
,
priority
=
4
1
)
@Test
(
description
=
"访客H完成助力"
,
priority
=
4
2
)
public
void
访客
H
完成助力
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
visitorAuth27
();
//访客X
...
...
@@ -875,7 +903,7 @@ public class SecondKill implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_assist
,
"用户W给用户H助力失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看秒杀资格商品详情"
,
priority
=
4
2
)
@Test
(
description
=
"查看秒杀资格商品详情"
,
priority
=
4
3
)
public
void
查看秒杀资格商品详情
()
{
visitorAuth9
();
sleep
(
3000
);
...
...
@@ -886,7 +914,7 @@ public class SecondKill implements Authorization {
int
qualificationStatus
=
goodsDetailRes
.
jsonPath
().
getInt
(
"data.qualificationStatus"
);
Assert
.
assertEquals
(
qualificationStatus
,
2
,
network
.
message
(
goodsDetailPar
,
BasicConfig
.
MOBILE_secondKill_getGoodsDetail
,
"秒杀资格商品状态记录错误"
,
goodsDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"查看秒杀商品列表"
,
priority
=
4
3
)
@Test
(
description
=
"查看秒杀商品列表"
,
priority
=
4
4
)
public
void
查看秒杀商品列表
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
505afdc6
...
...
@@ -162,6 +162,8 @@ public class BasicConfig {
public
static
final
String
ANCHOR_sendQualification
=
MOBILE_HOST
+
"/conf/live/second/kill/goods/sendQualification"
;
public
static
final
String
MOBILE_qualification
=
MOBILE_HOST
+
"/clue/goods/receive/qualification"
;
public
static
final
String
MOBILE_receiveStatus
=
MOBILE_HOST
+
"/clue/goods/receive/status"
;
public
static
final
String
MANAGER_goodsProgress
=
MANAGER_HOST
+
"/kjy/manager/live/second/kill/goods/progress"
;
public
static
final
String
MOBILE_goodsProgress
=
MOBILE_HOST
+
"/clue/goods/progress"
;
//客户承诺话术配置
public
static
final
String
MANAGER_saveDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/saveDialogue"
;
public
static
final
String
MANAGER_findDialogue
=
MANAGER_HOST
+
"/kjy/manager/live/potential/findDialogue"
;
...
...
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