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
13a37900
Commit
13a37900
authored
Aug 04, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gifeature/20210729-gj' into 'master'
180天打卡、我的吐槽、历史分享接口用例 See merge request test-group/kejiji!90
parents
916a8391
bd2ccc67
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
130 additions
and
7 deletions
+130
-7
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+5
-2
CashBack.java
src/test/java/com/kjj/cases/assistant/homePage/CashBack.java
+83
-0
HomePage.java
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
+27
-2
RecommendMaterial.java
...a/com/kjj/cases/assistant/homePage/RecommendMaterial.java
+7
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+8
-3
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
13a37900
...
...
@@ -55,8 +55,11 @@ public interface Authorization {
network
.
agentCookies
.
put
(
"tku"
,
VISITOR1_TKU
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR1_TKU
);
}
//获取代理人tku,180天打卡返现专用:Jovia
default
void
cashBackTku
(){
network
.
agentCookies
.
put
(
"tku"
,
CASHBACK_TKU
);
System
.
out
.
println
(
"打卡返现tku:"
+
CASHBACK_TKU
);
}
/**
* 直播业务相关
...
...
src/test/java/com/kjj/cases/assistant/homePage/CashBack.java
0 → 100644
View file @
13a37900
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
com.kjj.cases.admin.Authorization
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
io.restassured.response.Response
;
import
java.util.*
;
import
java.text.SimpleDateFormat
;
public
class
CashBack
implements
Authorization
{
public
String
sid
;
//加密的销售id
public
String
grassContentId
;
//文章内容id
public
String
scId
;
//获取文章id
public
Integer
clockTimes
;
//获取打卡的总次数
@BeforeClass
public
void
setUp
()
{
//打卡返现专用TKU
cashBackTku
();
}
//种草文章转发
@Test
(
description
=
"种草素材转发"
,
priority
=
1
)
public
void
种草素材转发
()
{
//获取种草素材列表页
Response
listRes
=
network
.
getResponse
(
ARTICLE_GETEXPLOSIONCONTENTLIST
);
grassContentId
=
listRes
.
jsonPath
().
getString
(
"data[0].contentId"
);
//根据种草素材的ContentId获取Scid
Map
<
String
,
Object
>
getScIdParams
=
new
HashMap
<>();
getScIdParams
.
put
(
"contentId"
,
grassContentId
);
Response
getScIdRes
=
network
.
getResponse
(
getScIdParams
,
GETSCID
);
scId
=
getScIdRes
.
jsonPath
().
getString
(
"data"
);
//种草文章转发
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scId"
,
scId
);
params
.
put
(
"forwardType"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
FORWARD
);
Boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
FORWARD
,
"种草文章转发失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"打卡任务进度"
,
priority
=
2
)
public
void
打卡任务进度
(){
Response
response
=
network
.
getResponse
(
HOME_dailyProgress
);
Object
dayStatus
=
response
.
jsonPath
().
getJsonObject
(
"data.dayStatus"
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
clockTimes
=
response
.
jsonPath
().
getInt
(
"data.clockInTimes"
);
Assert
.
assertEquals
(
dayStatus
,
2
,
network
.
message
(
HOME_dailyProgress
,
"打卡任务查询失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
HOME_dailyProgress
,
"打卡任务查询失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"打卡数据统计"
,
priority
=
3
)
public
void
打卡数据统计
(){
Response
response
=
network
.
getResponse
(
HOME_statistic
);
Object
clockInTimes
=
response
.
jsonPath
().
getJsonObject
(
"data.clockInTimes"
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
clockInTimes
,
clockTimes
,
network
.
message
(
HOME_dailyProgress
,
"打卡数据统计错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
HOME_dailyProgress
,
"打卡数据统计错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"打卡记录"
,
priority
=
4
)
public
void
打卡记录
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"dayStatus"
,
2
);
Response
response
=
network
.
getResponse
(
params
,
HOME_record
);
Object
doneTime
=
response
.
jsonPath
().
getJsonObject
(
"data.list.get(0).doneTime"
);
//获取当天时间
Date
date
=
new
Date
();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
today
=
simpleDateFormat
.
format
(
date
.
getTime
());
//获取当天凌晨的时间戳
long
current
=
System
.
currentTimeMillis
();
long
currentDate
=
current
-(
current
+
TimeZone
.
getDefault
().
getRawOffset
())%(
1000
*
3600
*
24
);
Assert
.
assertEquals
(
doneTime
,
currentDate
,
network
.
message
(
params
,
HOME_record
,
"获取当日打卡记录成功"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
13a37900
...
...
@@ -24,10 +24,9 @@ public class HomePage implements Authorization {
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
agentTku
();
userTku
();
//管理后台登录
BaseUtils
.
ssoLogin
();
}
//获取种草素材列表页
...
...
@@ -318,4 +317,30 @@ public class HomePage implements Authorization {
Assert
.
assertTrue
(
updateSuccess
,
network
.
message
(
params
,
MANAGER_updateStatus
,
"下架成功案例失败"
,
updateRes
.
body
().
asString
()));
}
//个人中心—我的反馈
@Test
(
description
=
"个人中心_我的反馈"
,
priority
=
20
)
public
void
我的反馈
(){
//tku 切换为访客的
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"feedbackContent"
,
"自动化测试"
);
params
.
put
(
"feedbackPics"
,
"//yun.dui88.com/kjy/image/20210729/d66257a1efe348819539372d4b53313f.jpg"
);
params
.
put
(
"feedbackSource"
,
3
);
//feedbackSource指反馈建议的入口,3指代个人中心
params
.
put
(
"feedbackType"
,
4
);
Response
response
=
network
.
postResponse
(
params
,
HOME_feedBackSave
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
HOME_feedBackSave
,
"反馈意见提交成功"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
HOME_feedBackSave
,
"反馈意见提交成功"
,
response
.
body
().
asString
()));
}
//管理后台-集客助手反馈
@Test
(
description
=
"管理后台_集客助手反馈"
,
priority
=
21
)
public
void
集客助手反馈结果
(){
//验证管理后台是否接收到消息
Response
manageRes
=
network
.
getResponse
(
MANAGER_feedBackList
);
Object
feedbackContent
=
manageRes
.
jsonPath
().
getJsonObject
(
"data.list.get(0).feedbackContent"
);
System
.
out
.
println
(
feedbackContent
);
Assert
.
assertEquals
(
feedbackContent
,
"自动化测试"
,
network
.
message
(
MANAGER_feedBackList
,
"个人中心反馈失败"
,
manageRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/assistant/homePage/RecommendMaterial.java
View file @
13a37900
...
...
@@ -80,6 +80,13 @@ public class RecommendMaterial implements Authorization {
Response
response
=
network
.
getResponse
(
params
,
FORWARD
);
Boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
FORWARD
,
"种草文章转发失败"
,
response
.
body
().
asString
()));
//个人中心——历史分享
Map
<
String
,
Object
>
paramsHistory
=
new
HashMap
<>();
paramsHistory
.
put
(
"sellerId"
,
2991
);
//吉吉的销售员id
Response
historyRes
=
network
.
getResponse
(
paramsHistory
,
HOME_sellerContentHistory
);
Object
list
=
historyRes
.
jsonPath
().
getJsonObject
(
"data.list.get(0).scId"
);
Assert
.
assertEquals
(
list
,
scid
,
network
.
message
(
paramsHistory
,
HOME_sellerContentHistory
,
"获取历史分享失败"
,
historyRes
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
13a37900
...
...
@@ -82,8 +82,8 @@ public class BasicConfig {
public
static
String
VISITOR_UserTku
=
"T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3sz6YRdcqKfzRJ8dMnfqDmgS8EprRjhFpXPFLBvp"
;
// 钉钉机器人 线上-告警群
public
static
final
String
dingTalkPath
=
"https://oapi.dingtalk.com/robot/send?access_token=f63c9cb36e89dd68e9af82d926933b3afc6544e57b23a3a55ed5b3b772d5e8d2"
;
// 180天打卡专用代理人 TKU (Jovia),sid :3591
public
static
String
CASHBACK_TKU
=
"T3gM31f18jCeXXZ8mG3oRE5KGiKg8r7x3Kqf81G5TYpPDL2evLbGxhnkJpUxTr1LvrUd1ZGJqxf6jEHoUY"
;
// *************** 客集集域名 ***************
public
static
final
String
HOST
=
"https://kjj.m.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST
=
"https://kjj-activity.duibatest.com.cn"
;
...
...
@@ -823,7 +823,11 @@ public class BasicConfig {
public
static
final
String
HOME_getPosterTemplateList
=
HOST
+
"/kjy/mp/posterTemplate/getPosterTemplateList"
;
public
static
final
String
HOME_findPosterById
=
HOST
+
"/kjy/mp/posterTemplate/findPosterById"
;
public
static
final
String
HOME_getExclusiveArea
=
HOST
+
"/kjy/mp/classify/getExclusiveArea"
;
public
static
final
String
HOME_sellerContentHistory
=
HOST
+
"/kjy/mp/chat/sellerContentHistory"
;
public
static
final
String
HOME_feedBackSave
=
HOST
+
"/kjy/mp/seller/feedback/save"
;
public
static
final
String
HOME_dailyProgress
=
HOST
+
"/kjy/mp/clockIn/task/dailyProgress"
;
public
static
final
String
HOME_statistic
=
HOST
+
"/kjy/mp/clockIn/task/statistic"
;
public
static
final
String
HOME_record
=
HOST
+
"/kjy/mp/clockIn/task/record"
;
//******************个人中心**********************
public
static
final
String
USINGSTRATAGY_index
=
HOST
+
"/kjy/mp/usingStrategy/index"
;
public
static
final
String
USINGSTRATAGY_strategyList
=
HOST
+
"/kjy/mp/usingStrategy/strategyList"
;
...
...
@@ -966,4 +970,5 @@ public class BasicConfig {
public
static
final
String
MANAGER_addExclusiveArea
=
MANAGER_HOST
+
"/kjy/manager/exclusiveArea/add"
;
public
static
final
String
MANAGER_searchTemplateList
=
MANAGER_HOST
+
"/kjy/manager/game/searchTemplateList"
;
public
static
final
String
MANAGER_getTemplateDetail
=
MANAGER_HOST
+
"/kjy/manager/game/getTemplateDetail"
;
public
static
final
String
MANAGER_feedBackList
=
MANAGER_HOST
+
"/kjy/manager/feedback/list"
;
}
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