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
47f73497
Commit
47f73497
authored
Aug 12, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增文章配置素材的测试用例
parent
a948910d
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
559 additions
and
32 deletions
+559
-32
Activity.java
src/test/java/com/kjj/bean/marketTools/Activity.java
+10
-0
ArticalPersonCard.java
.../java/com/kjj/cases/assistant/card/ArticalPersonCard.java
+1
-1
HomePage.java
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
+420
-4
RecommendMaterial.java
...a/com/kjj/cases/assistant/homePage/RecommendMaterial.java
+3
-4
PersonalCenter.java
...est/java/com/kjj/cases/assistant/menu/PersonalCenter.java
+2
-0
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+74
-0
Answer.java
src/test/java/com/kjj/cases/live/answer/Answer.java
+1
-1
FlipCard.java
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
+1
-1
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+17
-17
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+17
-2
NetworkUtils.java
src/test/java/com/kjj/utils/NetworkUtils.java
+12
-0
liveTestNG.xml
src/test/liveTestNG.xml
+0
-2
wechatTestNG.xml
src/test/wechatTestNG.xml
+1
-0
No files found.
src/test/java/com/kjj/bean/marketTools/Activity.java
0 → 100644
View file @
47f73497
package
com
.
kjj
.
bean
.
marketTools
;
import
lombok.Data
;
@Data
public
class
Activity
{
private
String
title
;
private
long
id
;
private
int
status
;
}
src/test/java/com/kjj/cases/assistant/card/ArticalPersonCard.java
View file @
47f73497
...
...
@@ -25,7 +25,7 @@ public class ArticalPersonCard implements Authorization {
@BeforeClass
public
void
setUp
()
{
agent
Auth
();
agent
Tku
();
}
//文章内容页
...
...
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
47f73497
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/assistant/homePage/RecommendMaterial.java
View file @
47f73497
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
kjj
.
utils
.
IdMakeUtil
.
decodingId
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -31,7 +33,6 @@ public class RecommendMaterial implements Authorization {
@BeforeClass
public
void
setUp
()
{
userTku
();
agentTku
();
}
...
...
@@ -406,6 +407,4 @@ public class RecommendMaterial implements Authorization {
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
CHECKUNREAD
,
"访客-获取私信有误"
,
response
.
body
().
asString
()));
}
}
\ No newline at end of file
src/test/java/com/kjj/cases/assistant/menu/PersonalCenter.java
View file @
47f73497
...
...
@@ -9,6 +9,8 @@ import org.testng.annotations.*;
import
java.util.*
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
tku
;
public
class
PersonalCenter
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
faqId
;
// 问答的contentId
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
47f73497
...
...
@@ -20,6 +20,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
WhoSawMe
implements
Authorization
{
private
Response
response
;
...
...
@@ -30,6 +32,8 @@ public class WhoSawMe implements Authorization {
private
Long
xxrUserId
;
private
Long
jjSellerId
;
private
String
tagId0
;
private
String
reportId
;
private
String
reportScid
;
private
String
weeklyPublicationId
;
private
String
scid
;
// 代理人周报scid
private
String
taskArticleContentId
;
// 任务素材contentId
...
...
@@ -869,4 +873,74 @@ public class WhoSawMe implements Authorization {
Assert
.
assertEquals
(
remarkName
,
"备注"
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户备注错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
tagIsMark
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户标签错误"
,
response
.
body
().
asString
()));
}
// 销售线索_测评报告领取线索
@Test
(
description
=
"销售线索_测评报告领取线索"
,
priority
=
58
)
public
void
销售线索
_
测评报告领取线索
()
throws
IOException
{
agentTku
();
List
<
Object
>
customerTagIds
=
Lists
.
newArrayList
();
param
=
new
HashMap
<>();
param
.
put
(
"customerTagIds"
,
customerTagIds
);
param
.
put
(
"lastClueId"
,
0
);
param
.
put
(
"listType"
,
1
);
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
clueSummary
=
response
.
jsonPath
().
getString
(
"data.list.find{it.nickName == '小葡萄'}.clueSummary"
);
Assert
.
assertEquals
(
clueSummary
,
"TA想要领取风险测评报告"
,
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"最近访客微信昵称不匹配"
,
response
.
body
().
asString
()));
clueId
=
response
.
jsonPath
().
getLong
(
"data.list.find{it.nickName == '小葡萄'}.clueId"
);
System
.
out
.
println
(
response
.
body
().
asString
());
}
// 销售线索_查看测评报告的领取详情
@Test
(
description
=
"销售线索_查看测评报告的领取详情"
,
priority
=
59
)
public
void
销售线索
_
查看测评报告的领取详情
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"clueId"
,
clueId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUEINFO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
visitClueType
=
response
.
jsonPath
().
getInt
(
"data.visitClueType"
);
reportId
=
response
.
jsonPath
().
getString
(
"data.contentId"
);
String
clueSummary
=
response
.
jsonPath
().
getString
(
"data.clueSummary"
);
Assert
.
assertEquals
(
visitClueType
,
32
,
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索类型错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
clueSummary
,
"领评测报告"
,
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源类型错误"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
}
// 代理人_转发评测报告
@Test
(
description
=
"代理人_转发评测报告"
,
priority
=
60
)
public
void
代理人
_
转发评测报告
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"contentId"
,
reportId
);
response
=
network
.
getResponse
(
param
,
GETSCID
);
reportScid
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
reportScid
,
network
.
message
(
param
,
GETSCID
,
"获取sCid失败"
,
response
.
body
().
asString
()));
//查看线索客户信息
param
.
put
(
"clueId"
,
clueId
);
Response
response
=
network
.
getResponse
(
param
,
WHOSAWME_clientInfo
);
String
custName
=
response
.
jsonPath
().
getString
(
"data.custName"
);
Assert
.
assertEquals
(
custName
,
"小葡萄"
,
network
.
message
(
param
,
WHOSAWME_clientInfo
,
"线索客户信息错误"
,
response
.
body
().
asString
()));
}
// 访客_咨询问题
@Test
(
description
=
"访客_咨询问题"
,
priority
=
61
)
public
void
访客
_
咨询问题
()
throws
IOException
{
userTku
();
//获取问题按钮列表
param
.
put
(
"scene"
,
1
);
Response
response
=
network
.
getResponse
(
param
,
GAME_button
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertEquals
(
size
,
4
,
network
.
message
(
param
,
GAME_button
,
"问题个数错误"
,
response
.
body
().
asString
()));
//点击问题
param
.
clear
();
param
.
put
(
"order"
,
3
);
param
.
put
(
"scene"
,
2
);
param
.
put
(
"scid"
,
reportScid
);
response
=
network
.
postResponse
(
param
,
GAME_consult
);
String
sCid
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
reportScid
,
network
.
message
(
param
,
GAME_consult
,
"获取sCid失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/answer/Answer.java
View file @
47f73497
...
...
@@ -242,7 +242,7 @@ public class Answer implements Authorization {
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
Integer
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
System
.
out
.
println
(
amount
);
System
.
out
.
println
(
response
.
body
().
asString
()
);
Assert
.
assertTrue
(
amount
>
0
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/live/flipCard/FlipCard.java
View file @
47f73497
...
...
@@ -444,7 +444,7 @@ public class FlipCard implements Authorization {
@Test
(
description
=
"用户开红包状态查询"
,
priority
=
21
)
public
void
用户开红包状态查询
()
{
ThreadSleepUtils
.
sleep
(
1
000
);
ThreadSleepUtils
.
sleep
(
3
000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
47f73497
...
...
@@ -1355,7 +1355,7 @@ public class Lottery implements Authorization {
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"
企业指定访客F未
中奖"
,
hasEndRes
.
body
().
asString
()));
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"
团队未指定访客F
中奖"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
...
...
@@ -1374,7 +1374,7 @@ public class Lottery implements Authorization {
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"企业指定访客I未
中奖"
,
hasEndRes
.
body
().
asString
()));
Assert
.
assertFalse
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"团队未指定访客I
中奖"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
47f73497
...
...
@@ -92,6 +92,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
public
static
final
String
MOBILE_SPOKEHOST
=
"https://tt.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST1
=
"https://kjj-activity-1.duibatest.com.cn"
;
// *************** 开启&结束直播 ***************
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
...
...
@@ -738,6 +739,7 @@ public class BasicConfig {
public
static
final
String
CLUEINFO
=
HOST
+
"/kjy/mp/whoSawMe/clue/info"
;
public
static
final
String
CLUEADVISE
=
HOST
+
"/kjy/mp/whoSawMe/clue/info/advise"
;
public
static
final
String
FOLLOWADVICE
=
HOST
+
"/kjy/mp/whoSawMe/clue/followAdvice"
;
public
static
final
String
WHOSAWME_clientInfo
=
HOST
+
"/kjy/mp/whoSawMe/clue/clientInfo"
;
// *************** 运营周报 ***************
public
static
final
String
WEEKLY_INDEXINFO
=
HOST
+
"/kjy/mp/weekly/getWeeklyIndexInfo"
;
...
...
@@ -805,6 +807,7 @@ public class BasicConfig {
public
static
final
String
ARTICLE_ENHANCEDCOLUMN_GETFAQS
=
HOST
+
"/kjy/mp/enhancedColumn/getFAQs"
;
public
static
final
String
ARTICLE_getQuestionDetail
=
HOST
+
"/kjy/mp/explosioncontent/qa/getQuestionDetail"
;
public
static
final
String
ARTICLE_GETEXPLOSIONCONTENTLIST
=
HOST
+
"/kjy/mp/explosioncontent/getExplosionContentList"
;
public
static
final
String
ARTICLE_interact
=
HOST
+
"/kjy/mp/article/interact"
;
// 风险评测
public
static
final
String
RISKTEST_SENDINFO
=
ACTIVITY1_HOST
+
"/kjy/mp/activity/sendInfoForRisk"
;
...
...
@@ -983,6 +986,10 @@ public class BasicConfig {
//*********************趣味测试************************
public
static
final
String
GAME_answerPageList
=
HOST
+
"/kjy/mp/game/answerPageList"
;
public
static
final
String
GAME_clueList
=
HOST
+
"/kjy/mp/tag/clue/list"
;
public
static
final
String
GAME_sendInfo
=
ACTIVITY_HOST
+
"/kjy/mp/activity/sendInfo"
;
public
static
final
String
GAME_sendInfoForRisk
=
ACTIVITY_HOST
+
"/kjy/mp/activity/sendInfoForRisk"
;
public
static
final
String
GAME_consult
=
ACTIVITY_HOST
+
"/kjy/mp/activity/consult"
;
public
static
final
String
GAME_button
=
ACTIVITY_HOST
+
"/kjy/mp/activity/button"
;
// *************** 管理后台 ***************
public
static
final
String
SSO_doLogin
=
SSO_HOST
+
"/doLogin"
;
...
...
@@ -1012,6 +1019,14 @@ public class BasicConfig {
public
static
final
String
MANAGER_encryptTku
=
MANAGER_HOST
+
"/kjy/manager/testUser/encryptTku"
;
public
static
final
String
MANAGER_changeCompany
=
MANAGER_HOST
+
"/kjy/manager/seller/changeCompany"
;
public
static
final
String
MANAGER_feedBackList
=
MANAGER_HOST
+
"/kjy/manager/feedback/list"
;
public
static
final
String
MANAGER_articleInteraction
=
MANAGER_HOST
+
"/kjy/manager/interact/article/searchPageList"
;
public
static
final
String
MANAGER_interactSolution
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/searchPageList"
;
public
static
final
String
MANAGER_searchAnswerList
=
MANAGER_HOST
+
"/kjy/manager/game/searchAnswerList"
;
public
static
final
String
MANAGER_saveActivity
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/save"
;
public
static
final
String
MANAGER_updateActivity
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/update"
;
public
static
final
String
MANAGER_solutionPageList
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/searchPageList"
;
public
static
final
String
MANAGER_saveInteract
=
MANAGER_HOST
+
"/kjy/manager/interact/article/save"
;
public
static
final
String
MANAGER_updateInteract
=
MANAGER_HOST
+
"/kjy/manager/interact/article/update"
;
public
static
final
String
MANAGER_articlePageList
=
MANAGER_HOST
+
"/kjy/manager/interact/article/searchPageList"
;
public
static
final
String
MANAGER_activityName
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/activityName"
;
public
static
final
String
MANAGER_deleteInteract
=
MANAGER_HOST
+
"/kjy/manager/interact/article/delete"
;
public
static
final
String
MANAGER_deleteActivity
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/delete"
;
}
src/test/java/com/kjj/utils/NetworkUtils.java
View file @
47f73497
...
...
@@ -102,6 +102,18 @@ public class NetworkUtils {
return
response
;
}
// post 头部带参请求
public
Response
postHeaderResponse
(
Map
<
String
,
Object
>
params
,
String
path
)
{
Response
response
=
given
()
.
cookies
(
agentCookies
)
.
params
(
params
)
.
post
(
path
);
if
(!
Objects
.
equals
(
response
.
statusCode
(),
200
)){
System
.
out
.
println
(
"请求状态码错误,path=【"
+
path
+
"】 code=【"
+
response
.
statusCode
()+
"】"
);
}
return
response
;
}
// post 文件上传
public
Response
postFileResponse
(
String
filePath
,
String
path
){
Response
response
=
given
()
...
...
src/test/liveTestNG.xml
View file @
47f73497
...
...
@@ -24,8 +24,6 @@
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"成功案例"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.LiveCase"
/>
...
...
src/test/wechatTestNG.xml
View file @
47f73497
...
...
@@ -46,6 +46,7 @@
<class
name=
"com.kjj.cases.assistant.homePage.Upload"
/>
</classes>
</test>
<test
preserve-order=
"true"
name =
"获取访客"
>
<classes>
<class
name=
"com.kjj.cases.assistant.whoSawMe.ForwardAndRead"
/>
...
...
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