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
Hide 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 {
...
@@ -25,7 +25,7 @@ public class ArticalPersonCard implements Authorization {
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
agent
Auth
();
agent
Tku
();
}
}
//文章内容页
//文章内容页
...
...
src/test/java/com/kjj/cases/assistant/homePage/HomePage.java
View file @
47f73497
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
tku
;
import
static
com
.
kjj
.
utils
.
IdMakeUtil
.
decodingId
;
import
static
com
.
kjj
.
utils
.
IdMakeUtil
.
encodingId
;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
import
com.kjj.bean.marketTools.Activity
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
org.testng.annotations.*
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
HomePage
implements
Authorization
{
public
class
HomePage
implements
Authorization
{
public
int
firstTagId
;
//获取种草素材标签ID
public
int
firstTagId
;
//获取种草素材标签ID
...
@@ -20,13 +26,23 @@ public class HomePage implements Authorization {
...
@@ -20,13 +26,23 @@ public class HomePage implements Authorization {
public
int
hotTagId
;
//获取热榜标签ID
public
int
hotTagId
;
//获取热榜标签ID
public
int
posterTagId
;
//获取海报标签ID
public
int
posterTagId
;
//获取海报标签ID
public
String
posterContentId
;
//获取海报的的contentId
public
String
posterContentId
;
//获取海报的的contentId
public
String
grasscontentId
;
//获取发圈素材标签名称
public
int
caseId
;
//获取成功案例id
public
int
caseId
;
//获取成功案例id
public
long
answer1
=
4700
;
//胃部测评的id
public
long
answer2
=
8784
;
//摆摊测试的id
public
long
activity1
;
//胃部测评的互动id
public
long
activity2
;
//摆摊测试的互动id
public
String
scid
;
//获取文章对应的scid
public
int
sid
;
//代理人的sid
public
int
userId
;
//用户的userId
public
String
visitId
;
//用户的visitId
public
String
activityScid
;
//测评对应的scid
public
long
articleId
;
//解密后的的文章id
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
agentTku
();
agentTku
();
userTku
();
}
}
//获取种草素材列表页
//获取种草素材列表页
...
@@ -40,6 +56,15 @@ public class HomePage implements Authorization {
...
@@ -40,6 +56,15 @@ public class HomePage implements Authorization {
Response
response
=
network
.
getResponse
(
params
,
HOME_getContentList
);
Response
response
=
network
.
getResponse
(
params
,
HOME_getContentList
);
Object
obj
=
response
.
jsonPath
().
getJsonObject
(
"data.list"
);
Object
obj
=
response
.
jsonPath
().
getJsonObject
(
"data.list"
);
Assert
.
assertNotNull
(
obj
,
network
.
message
(
params
,
HOME_getContentList
,
"获取首页种草素材列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
obj
,
network
.
message
(
params
,
HOME_getContentList
,
"获取首页种草素材列表失败"
,
response
.
body
().
asString
()));
grasscontentId
=
response
.
jsonPath
().
getString
(
"data.list.get(0).contentId"
);
articleId
=
decodingId
(
grasscontentId
);
//获取素材对应的scid
params
.
clear
();
params
.
put
(
"contentId"
,
grasscontentId
);
response
=
network
.
getResponse
(
params
,
GETSCID
);
scid
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
scid
,
network
.
message
(
params
,
GETSCID
,
"获取文章的scid失败"
,
response
.
body
().
asString
()));
}
}
//获取发圈素材列表
//获取发圈素材列表
...
@@ -343,4 +368,395 @@ public class HomePage implements Authorization {
...
@@ -343,4 +368,395 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
feedbackContent
,
"自动化测试"
,
network
.
message
(
MANAGER_feedBackList
,
"个人中心反馈失败"
,
manageRes
.
body
().
asString
()));
Assert
.
assertEquals
(
feedbackContent
,
"自动化测试"
,
network
.
message
(
MANAGER_feedBackList
,
"个人中心反馈失败"
,
manageRes
.
body
().
asString
()));
}
}
//***********************文章配置素材*******************************
@Test
(
description
=
"代理人_访问文章未配置互动素材"
,
priority
=
26
)
public
void
代理人
_
访问文章未配置互动素材
()
{
agentTku
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"cid"
,
grasscontentId
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_interact
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
ARTICLE_interact
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
0
,
network
.
message
(
params
,
ARTICLE_interact
,
"返回数据为空"
,
response
.
body
().
asString
()));
//获取文章对应的scid
params
.
clear
();
params
.
put
(
"contentId"
,
grasscontentId
);
response
=
network
.
getResponse
(
params
,
GETSCID
);
scid
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
scid
,
network
.
message
(
params
,
GETSCID
,
"获取文章的scid失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_新增互动方案"
,
priority
=
27
)
public
void
管理后台
_
新增互动方案
()
{
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
params
,
MANAGER_searchAnswerList
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"返回数据为空"
,
response
.
body
().
asString
()));
List
<
Activity
>
list
=
JsonUtil
.
parseResponsePathToListBean
(
response
,
"data.list"
,
Activity
.
class
);
for
(
Activity
item:
list
)
{
if
(
item
.
getTitle
().
equals
(
"肝脏测评"
)){
answer1
=
item
.
getId
();
}
if
(
item
.
getTitle
().
equals
(
"摆摊测试"
)){
answer2
=
item
.
getId
();
}
}
params
.
clear
();
params
.
put
(
"activityId"
,
answer1
);
params
.
put
(
"activityName"
,
"肝脏测试"
);
params
.
put
(
"coverImgUrl"
,
"https://yun.dui88.com/kjy/image/20210804/1628075514881.jpeg"
);
params
.
put
(
"activityRemark"
,
""
);
response
=
network
.
postResponse
(
params
,
MANAGER_saveActivity
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_saveActivity
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_saveActivity
,
"返回数据为空"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"activityId"
,
answer2
);
params
.
put
(
"activityName"
,
"摆摊测试"
);
params
.
put
(
"coverImgUrl"
,
"https://yun.dui88.com/kjy/image/20210804/1628075514881.jpeg"
);
params
.
put
(
"activityRemark"
,
""
);
response
=
network
.
postResponse
(
params
,
MANAGER_saveActivity
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_saveActivity
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_saveActivity
,
"返回数据为空"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_solutionPageList
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"返回数据为空"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
activity1
=
response
.
jsonPath
().
getLong
(
"data.list.get(1).id"
);
activity2
=
response
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
Assert
.
assertNotNull
(
activity1
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
activity2
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_修改互动方案"
,
priority
=
28
)
public
void
管理后台
_
修改互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
activity2
);
params
.
put
(
"activityName"
,
"快来摆摊测试吧"
);
params
.
put
(
"coverImgUrl"
,
"https://yun.dui88.com/kjy/image/20210804/1628075514881.jpeg"
);
params
.
put
(
"activityRemark"
,
"备注呀"
);
Response
response
=
network
.
postResponse
(
params
,
MANAGER_updateActivity
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_updateActivity
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
MANAGER_updateActivity
,
"修改失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"activityId"
,
answer2
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_solutionPageList
);
System
.
out
.
println
(
response
.
body
().
asString
());
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
result
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
String
activityName
=
response
.
jsonPath
().
getString
(
"data.list.get(0).activityName"
);
Assert
.
assertEquals
(
activityName
,
"快来摆摊测试吧"
,
network
.
message
(
params
,
MANAGER_searchAnswerList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_通过方案id查找方案是否存在"
,
priority
=
29
)
public
void
管理后台
_
通过方案
id
查找方案是否存在
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//存在
params
.
put
(
"interactId"
,
activity2
);
Response
response
=
network
.
getResponse
(
params
,
MANAGER_activityName
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_activityName
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
"快来摆摊测试吧"
,
network
.
message
(
params
,
MANAGER_activityName
,
"方案名称错误"
,
response
.
body
().
asString
()));
//不存在
params
.
put
(
"interactId"
,
2
);
response
=
network
.
getResponse
(
params
,
MANAGER_activityName
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_activityName
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
null
,
network
.
message
(
params
,
MANAGER_activityName
,
"此方案存在"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_新增文章关联互动方案"
,
priority
=
30
)
public
void
管理后台
_
新增文章关联互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
ArrayList
<
Integer
>
interactIds
=
new
ArrayList
<
Integer
>();
interactIds
.
add
((
int
)
activity2
);
params
.
put
(
"articleId"
,
articleId
);
params
.
put
(
"interactIds"
,
interactIds
);
params
.
put
(
"refRemark"
,
""
);
Response
response
=
network
.
postResponse
(
params
,
MANAGER_saveInteract
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
System
.
out
.
println
(
new
Date
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_saveInteract
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_saveInteract
,
"接口返回失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"articleId"
,
articleId
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_articlePageList
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
int
aolutionId
=
response
.
jsonPath
().
getInt
(
"data.list.get(0).interactSolution.get(0).interactId"
);
Assert
.
assertEquals
(
aolutionId
,
activity2
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_互动方案使用中会删除失败"
,
priority
=
31
)
public
void
管理后台
_
互动方案使用中会删除失败
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
activity2
);
Response
response
=
network
.
postResponse
(
params
,
MANAGER_deleteActivity
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertFalse
(
success
,
network
.
message
(
params
,
MANAGER_deleteActivity
,
"有文章使用互动方案删除成功"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"activityId"
,
activity2
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_solutionPageList
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"有文章使用互动方案删除成功"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_访问文章新增配置互动素材"
,
priority
=
32
)
public
void
代理人
_
访问文章新增配置互动素材
()
{
sleep
(
10000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"cid"
,
grasscontentId
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_interact
);
System
.
out
.
println
(
new
Date
());
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
ARTICLE_interact
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
ARTICLE_interact
,
"返回数据为空"
,
response
.
body
().
asString
()));
String
activityIdStr
=
response
.
jsonPath
().
getString
(
"data.get(0).activityId"
);
long
activityId
=
decodingId
(
activityIdStr
);
Assert
.
assertEquals
(
activityId
,
answer2
,
network
.
message
(
params
,
ARTICLE_interact
,
"访问文章配置素材ID与实际配置不一致"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_修改文章关联互动方案"
,
priority
=
33
)
public
void
管理后台
_
修改文章关联互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
ArrayList
<
Integer
>
interactIds
=
new
ArrayList
<
Integer
>();
interactIds
.
add
((
int
)
activity1
);
params
.
put
(
"articleId"
,
articleId
);
params
.
put
(
"interactIds"
,
interactIds
);
params
.
put
(
"refRemark"
,
"更新了方案"
);
Response
response
=
network
.
postResponse
(
params
,
MANAGER_updateInteract
);
System
.
out
.
println
(
new
Date
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_updateInteract
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_updateInteract
,
"接口返回失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"articleId"
,
articleId
);
params
.
put
(
"activityName"
,
""
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_articlePageList
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
int
aolutionId
=
response
.
jsonPath
().
getInt
(
"data.list.get(0).interactSolution.get(0).interactId"
);
Assert
.
assertEquals
(
aolutionId
,
activity1
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_访问文章修改配置互动素材并转发"
,
priority
=
34
)
public
void
代理人
_
访问文章修改配置互动素材并转发
()
{
sleep
(
10000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"cid"
,
grasscontentId
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_interact
);
System
.
out
.
println
(
new
Date
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
ARTICLE_interact
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
ARTICLE_interact
,
"返回数据为空"
,
response
.
body
().
asString
()));
String
activityIdStr
=
response
.
jsonPath
().
getString
(
"data.get(0).activityId"
);
long
activityId
=
decodingId
(
activityIdStr
);
Assert
.
assertEquals
(
activityId
,
answer1
,
network
.
message
(
params
,
ARTICLE_interact
,
"访问文章配置素材ID与实际配置不一致"
,
response
.
body
().
asString
()));
//转发文章
params
.
clear
();
params
.
put
(
"scId"
,
scid
);
params
.
put
(
"forwardType"
,
1
);
response
=
network
.
getResponse
(
params
,
FORWARD
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
FORWARD
,
"种草文章转发失败"
,
response
.
body
().
asString
()));
params
.
clear
();
response
=
network
.
getResponse
(
USER_INFO
);
sid
=
response
.
jsonPath
().
getInt
(
"data.sellerId"
);
Assert
.
assertNotNull
(
response
.
jsonPath
().
getJsonObject
(
"data"
),
network
.
message
(
USER_INFO
,
"获取用户信息失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客_访问文章并参与测评"
,
priority
=
34
)
public
void
访客
_
访问文章并参与测评
()
{
//切换为新用户小葡萄,每次都会产生线索
network
.
agentCookies
.
put
(
"tku"
,
tku
);
//获取用户信息
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Response
response
=
network
.
getResponse
(
USER_INFO
);
userId
=
response
.
jsonPath
().
getInt
(
"data.userId"
);
Assert
.
assertNotNull
(
response
.
jsonPath
().
getJsonObject
(
"data"
),
network
.
message
(
USER_INFO
,
"获取用户信息失败"
,
response
.
body
().
asString
()));
//阅读文章
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"fromUserId"
,
userId
);
//代理人的用户id
params
.
put
(
"visitPath"
,
1
);
response
=
network
.
getResponse
(
params
,
CONTENT_READ
);
visitId
=
response
.
jsonPath
().
getString
(
"data.visitId"
);
System
.
out
.
println
(
"visitId:"
+
visitId
);
Assert
.
assertNotNull
(
visitId
,
network
.
message
(
params
,
CONTENT_READ
,
"访客记录查看素材失败"
,
response
.
body
().
asString
()));
//打开测评
params
.
clear
();
params
.
put
(
"contentId"
,
encodingId
(
answer1
));
params
.
put
(
"sid"
,
encodingId
((
long
)
sid
));
response
=
network
.
getResponse
(
params
,
GETSCID
);
activityScid
=
response
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
activityScid
);
Assert
.
assertNotNull
(
scid
,
network
.
message
(
params
,
GETSCID
,
"获取scid失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"scid"
,
activityScid
);
params
.
put
(
"fromUserId"
,
userId
);
//代理人的用户id
params
.
put
(
"sourceScId"
,
scid
);
//代理人的用户id
params
.
put
(
"visitPath"
,
1
);
response
=
network
.
getResponse
(
params
,
CONTENT_READ
);
visitId
=
response
.
jsonPath
().
getString
(
"data.visitId"
);
System
.
out
.
println
(
"visitId:"
+
visitId
);
Assert
.
assertNotNull
(
visitId
,
network
.
message
(
params
,
CONTENT_READ
,
"访客记录查看素材失败"
,
response
.
body
().
asString
()));
//发送测试结果-多次提交接口返回失败
params
.
clear
();
params
.
put
(
"scid"
,
activityScid
);
params
.
put
(
"completed"
,
1
);
params
.
put
(
"sourceScId"
,
scid
);
params
.
put
(
"visitExtra"
,
"{\"食物\":\"爱吃垃圾食品\",\"喝酒\":\"爱喝酒\",\"睡觉\":\"习惯早睡\",\"早餐\":\"按时吃早饭\",\"心情\":\"心情烦闷\"}"
);
response
=
network
.
postResponse
(
params
,
GAME_sendInfo
);
System
.
out
.
println
(
response
.
body
().
asString
());
//申请领取报告
params
.
clear
();
params
.
put
(
"scid"
,
activityScid
);
params
.
put
(
"completed"
,
1
);
params
.
put
(
"sourceScId"
,
scid
);
params
.
put
(
"originScId"
,
scid
);
params
.
put
(
"riskTestOperateType"
,
2
);
params
.
put
(
"sourceType"
,
"1"
);
params
.
put
(
"visitId"
,
visitId
);
response
=
network
.
postResponse
(
params
,
GAME_sendInfoForRisk
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GAME_sendInfoForRisk
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
GAME_sendInfoForRisk
,
"申请领取食谱失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_删除文章关联互动方案"
,
priority
=
35
)
public
void
管理后台
_
删除文章关联互动方案
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"articleId"
,
articleId
);
Response
response
=
network
.
postHeaderResponse
(
params
,
MANAGER_deleteInteract
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_deleteInteract
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_deleteInteract
,
"删除失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"articleId"
,
articleId
);
params
.
put
(
"activityName"
,
""
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_articlePageList
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
0
,
network
.
message
(
params
,
MANAGER_articlePageList
,
"删除失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_访问文章删除配置互动素材"
,
priority
=
36
)
public
void
代理人
_
访问文章删除配置互动素材
()
{
agentTku
();
sleep
(
10000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"cid"
,
grasscontentId
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_interact
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
ARTICLE_interact
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
0
,
network
.
message
(
params
,
ARTICLE_interact
,
"返回数据不为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台_删除互动方案成功"
,
priority
=
37
)
public
void
管理后台
_
删除互动方案成功
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
activity1
);
Response
response
=
network
.
postHeaderResponse
(
params
,
MANAGER_deleteActivity
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_deleteActivity
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_deleteActivity
,
"删除失败"
,
response
.
body
().
asString
()));
params
.
put
(
"id"
,
activity2
);
response
=
network
.
postHeaderResponse
(
params
,
MANAGER_deleteActivity
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
result
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_deleteActivity
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
MANAGER_deleteActivity
,
"删除失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"activityId"
,
answer1
);
params
.
put
(
"activityName"
,
""
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
params
,
MANAGER_solutionPageList
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
0
,
network
.
message
(
params
,
MANAGER_solutionPageList
,
"删除失败"
,
response
.
body
().
asString
()));
}
}
}
src/test/java/com/kjj/cases/assistant/homePage/RecommendMaterial.java
View file @
47f73497
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
package
com
.
kjj
.
cases
.
assistant
.
homePage
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
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.cases.admin.Authorization
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
org.testng.annotations.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -31,7 +33,6 @@ public class RecommendMaterial implements Authorization {
...
@@ -31,7 +33,6 @@ public class RecommendMaterial implements Authorization {
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
userTku
();
agentTku
();
agentTku
();
}
}
...
@@ -406,6 +407,4 @@ public class RecommendMaterial implements Authorization {
...
@@ -406,6 +407,4 @@ public class RecommendMaterial implements Authorization {
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
CHECKUNREAD
,
"访客-获取私信有误"
,
response
.
body
().
asString
()));
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.*;
...
@@ -9,6 +9,8 @@ import org.testng.annotations.*;
import
java.util.*
;
import
java.util.*
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
tku
;
public
class
PersonalCenter
implements
Authorization
{
public
class
PersonalCenter
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
faqId
;
// 问答的contentId
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;
...
@@ -20,6 +20,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
WhoSawMe
implements
Authorization
{
public
class
WhoSawMe
implements
Authorization
{
private
Response
response
;
private
Response
response
;
...
@@ -30,6 +32,8 @@ public class WhoSawMe implements Authorization {
...
@@ -30,6 +32,8 @@ public class WhoSawMe implements Authorization {
private
Long
xxrUserId
;
private
Long
xxrUserId
;
private
Long
jjSellerId
;
private
Long
jjSellerId
;
private
String
tagId0
;
private
String
tagId0
;
private
String
reportId
;
private
String
reportScid
;
private
String
weeklyPublicationId
;
private
String
weeklyPublicationId
;
private
String
scid
;
// 代理人周报scid
private
String
scid
;
// 代理人周报scid
private
String
taskArticleContentId
;
// 任务素材contentId
private
String
taskArticleContentId
;
// 任务素材contentId
...
@@ -869,4 +873,74 @@ public class WhoSawMe implements Authorization {
...
@@ -869,4 +873,74 @@ public class WhoSawMe implements Authorization {
Assert
.
assertEquals
(
remarkName
,
"备注"
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户备注错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
remarkName
,
"备注"
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户备注错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
tagIsMark
,
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 {
...
@@ -242,7 +242,7 @@ public class Answer implements Authorization {
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
Integer
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
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
()));
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 {
...
@@ -444,7 +444,7 @@ public class FlipCard implements Authorization {
@Test
(
description
=
"用户开红包状态查询"
,
priority
=
21
)
@Test
(
description
=
"用户开红包状态查询"
,
priority
=
21
)
public
void
用户开红包状态查询
()
{
public
void
用户开红包状态查询
()
{
ThreadSleepUtils
.
sleep
(
1
000
);
ThreadSleepUtils
.
sleep
(
3
000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
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 {
...
@@ -1355,7 +1355,7 @@ public class Lottery implements Authorization {
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
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
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
throw
e
;
...
@@ -1364,22 +1364,22 @@ public class Lottery implements Authorization {
...
@@ -1364,22 +1364,22 @@ public class Lottery implements Authorization {
@Test
(
description
=
"不在团队指定访客I是否中奖"
,
priority
=
93
)
@Test
(
description
=
"不在团队指定访客I是否中奖"
,
priority
=
93
)
public
void
不在团队指定访客
I
是否中奖
()
{
public
void
不在团队指定访客
I
是否中奖
()
{
visitorAuth8
();
visitorAuth8
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
hasEndParam
=
new
HashMap
<>();
hasEndParam
.
put
(
"confId"
,
this
.
List_ConfId
.
get
(
3
).
getWelfareConfId
());
hasEndParam
.
put
(
"confId"
,
this
.
List_ConfId
.
get
(
3
).
getWelfareConfId
());
hasEndParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
hasEndParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
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
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
throw
e
;
}
}
}
}
@Test
(
description
=
"开始第五轮抽奖"
,
priority
=
94
)
@Test
(
description
=
"开始第五轮抽奖"
,
priority
=
94
)
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
47f73497
...
@@ -92,6 +92,7 @@ public class BasicConfig {
...
@@ -92,6 +92,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.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"
;
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
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"
;
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
...
@@ -738,6 +739,7 @@ public class BasicConfig {
...
@@ -738,6 +739,7 @@ public class BasicConfig {
public
static
final
String
CLUEINFO
=
HOST
+
"/kjy/mp/whoSawMe/clue/info"
;
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
CLUEADVISE
=
HOST
+
"/kjy/mp/whoSawMe/clue/info/advise"
;
public
static
final
String
FOLLOWADVICE
=
HOST
+
"/kjy/mp/whoSawMe/clue/followAdvice"
;
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"
;
public
static
final
String
WEEKLY_INDEXINFO
=
HOST
+
"/kjy/mp/weekly/getWeeklyIndexInfo"
;
...
@@ -805,6 +807,7 @@ public class BasicConfig {
...
@@ -805,6 +807,7 @@ public class BasicConfig {
public
static
final
String
ARTICLE_ENHANCEDCOLUMN_GETFAQS
=
HOST
+
"/kjy/mp/enhancedColumn/getFAQs"
;
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_getQuestionDetail
=
HOST
+
"/kjy/mp/explosioncontent/qa/getQuestionDetail"
;
public
static
final
String
ARTICLE_GETEXPLOSIONCONTENTLIST
=
HOST
+
"/kjy/mp/explosioncontent/getExplosionContentList"
;
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"
;
public
static
final
String
RISKTEST_SENDINFO
=
ACTIVITY1_HOST
+
"/kjy/mp/activity/sendInfoForRisk"
;
...
@@ -983,6 +986,10 @@ public class BasicConfig {
...
@@ -983,6 +986,10 @@ public class BasicConfig {
//*********************趣味测试************************
//*********************趣味测试************************
public
static
final
String
GAME_answerPageList
=
HOST
+
"/kjy/mp/game/answerPageList"
;
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_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"
;
public
static
final
String
SSO_doLogin
=
SSO_HOST
+
"/doLogin"
;
...
@@ -1012,6 +1019,14 @@ public class BasicConfig {
...
@@ -1012,6 +1019,14 @@ public class BasicConfig {
public
static
final
String
MANAGER_encryptTku
=
MANAGER_HOST
+
"/kjy/manager/testUser/encryptTku"
;
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_changeCompany
=
MANAGER_HOST
+
"/kjy/manager/seller/changeCompany"
;
public
static
final
String
MANAGER_feedBackList
=
MANAGER_HOST
+
"/kjy/manager/feedback/list"
;
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_searchAnswerList
=
MANAGER_HOST
+
"/kjy/manager/game/searchAnswerList"
;
public
static
final
String
MANAGER_interactSolution
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/searchPageList"
;
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 {
...
@@ -102,6 +102,18 @@ public class NetworkUtils {
return
response
;
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 文件上传
// post 文件上传
public
Response
postFileResponse
(
String
filePath
,
String
path
){
public
Response
postFileResponse
(
String
filePath
,
String
path
){
Response
response
=
given
()
Response
response
=
given
()
...
...
src/test/liveTestNG.xml
View file @
47f73497
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"成功案例"
>
<test
preserve-order=
"true"
name=
"成功案例"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.LiveCase"
/>
<class
name=
"com.kjj.cases.live.liveConfig.LiveCase"
/>
...
...
src/test/wechatTestNG.xml
View file @
47f73497
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
<class
name=
"com.kjj.cases.assistant.homePage.Upload"
/>
<class
name=
"com.kjj.cases.assistant.homePage.Upload"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name =
"获取访客"
>
<test
preserve-order=
"true"
name =
"获取访客"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.assistant.whoSawMe.ForwardAndRead"
/>
<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