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
76f8fa1c
Commit
76f8fa1c
authored
Mar 29, 2021
by
别湘灵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理人首页
parent
1d80764e
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
358 additions
and
77 deletions
+358
-77
ResourceForm.java
src/test/java/com/kjj/bean/ResourceForm.java
+24
-0
ResourceFree.java
src/test/java/com/kjj/bean/ResourceFree.java
+26
-0
ResourceLink.java
src/test/java/com/kjj/bean/ResourceLink.java
+13
-0
ResourceTestDetail.java
src/test/java/com/kjj/bean/ResourceTestDetail.java
+28
-0
ResourceTestParticipate.java
src/test/java/com/kjj/bean/ResourceTestParticipate.java
+9
-0
CloseLive.java
src/test/java/com/kjj/cases/live/CloseLive.java
+3
-2
LiveMaterial.java
src/test/java/com/kjj/cases/live/LiveMaterial.java
+16
-15
LiveVisitors.java
src/test/java/com/kjj/cases/live/LiveVisitors.java
+184
-36
MngAuthorization.java
src/test/java/com/kjj/cases/live/MngAuthorization.java
+4
-2
OpenLive.java
src/test/java/com/kjj/cases/live/OpenLive.java
+3
-1
Procurator.java
src/test/java/com/kjj/cases/live/Procurator.java
+5
-3
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
+1
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+27
-7
JsonUtil.java
src/test/java/com/kjj/utils/JsonUtil.java
+7
-1
liveTestNG.xml
src/test/liveTestNG.xml
+8
-10
No files found.
src/test/java/com/kjj/bean/ResourceForm.java
0 → 100644
View file @
76f8fa1c
package
com
.
kjj
.
bean
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ResourceForm
{
private
String
banner
;
private
List
<
FieldList
>
fieldList
;
private
String
received
;
@Data
public
static
class
FieldList
{
private
String
fieldId
;
private
String
fieldName
;
private
int
fieldType
;
private
int
selectType
;
}
}
src/test/java/com/kjj/bean/ResourceFree.java
0 → 100644
View file @
76f8fa1c
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
ResourceFree
{
private
String
Kj21OTQ1NTk
;
private
String
name
;
private
String
img
;
private
String
companyName
;
private
String
companyId
;
private
String
received
;
private
String
receivedTime
;
private
int
interactType
;
private
String
recordId
;
private
String
liveId
;
private
String
outLink
;
private
String
outLinkDesc
;
private
String
resourceDesc
;
private
String
resourcePictures
;
private
int
resourceType
;
private
String
resourceButtonTitle
;
private
int
outLinkType
;
private
String
outLinkAppId
;
private
String
formBanner
;
}
src/test/java/com/kjj/bean/ResourceLink.java
0 → 100644
View file @
76f8fa1c
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
ResourceLink
{
private
String
name
;
private
String
img
;
private
int
interactType
;
private
String
outLink
;
private
String
outLinkType
;
private
String
outLinkAppId
;
}
src/test/java/com/kjj/bean/ResourceTestDetail.java
0 → 100644
View file @
76f8fa1c
package
com
.
kjj
.
bean
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ResourceTestDetail
{
private
int
testType
;
private
int
clueType
;
private
String
tradeIntroducePictures
;
private
String
suspendImg
;
private
String
mainButtonTitle
;
private
String
saleButtonTitle
;
private
List
<
FieldList
>
fieldList
;
private
String
received
;
@Data
public
static
class
FieldList
{
private
String
fieldId
;
private
String
fieldValue
;
private
String
fieldSubmitIds
;
}
private
String
liveId
;
private
String
confId
;
private
int
interactType
;
}
src/test/java/com/kjj/bean/ResourceTestParticipate.java
0 → 100644
View file @
76f8fa1c
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
ResourceTestParticipate
{
private
int
percent
;
private
String
nickname
;
}
src/test/java/com/kjj/cases/live/CloseLive.java
View file @
76f8fa1c
...
...
@@ -20,10 +20,10 @@ public class CloseLive implements AdminAuthorization{
@Test
(
description
=
"结束直播"
,
priority
=
1
)
public
void
结束直播
()
{
public
void
closeLive
()
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
closeParam
.
put
(
"cid"
,
90
);
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -34,5 +34,6 @@ public class CloseLive implements AdminAuthorization{
}
src/test/java/com/kjj/cases/live/LiveMaterial.java
View file @
76f8fa1c
...
...
@@ -34,7 +34,7 @@ public class LiveMaterial implements AdminAuthorization {
saveOrUpdateParam
.
put
(
"welfareName"
,
"盲盒锦鲤"
);
saveOrUpdateParam
.
put
(
"welfarePictures"
,
"https://yun.dui88.com/kjy/image/20210304/1614844198545.jpeg"
);
saveOrUpdateParam
.
put
(
"welfarePicturesArr"
,
"https://yun.dui88.com/kjy/image/20210304/1614844198545.jpeg"
);
saveOrUpdateParam
.
put
(
"companyId"
,
90
);
saveOrUpdateParam
.
put
(
"companyId"
,
101
);
Response
saveOrUpdatePes
=
network
.
postResponse
(
saveOrUpdateParam
,
BasicConfig
.
MANAGER_SAVEORUPDATE6
);
boolean
data
=
saveOrUpdatePes
.
jsonPath
().
getBoolean
(
"data"
);
...
...
@@ -46,7 +46,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
查询福利并删除
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
90
);
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
1
);
...
...
@@ -71,12 +71,13 @@ public class LiveMaterial implements AdminAuthorization {
}
//添加投票
@Test
(
description
=
"添加投票"
,
priority
=
3
)
public
void
添加投票
()
{
Map
<
String
,
Object
>
choiceParam
=
new
HashMap
<>();
choiceParam
.
put
(
"companyId"
,
90
);
choiceParam
.
put
(
"companyId"
,
101
);
choiceParam
.
put
(
"question"
,
"投票测试一"
);
List
<
VoteListBean
>
votes
=
new
ArrayList
<>();
VoteListBean
vote
=
new
VoteListBean
();
...
...
@@ -103,7 +104,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
查询投票并删除
()
{
Map
<
String
,
Object
>
choiceListPram
=
new
HashMap
<>();
choiceListPram
.
put
(
"companyId"
,
90
);
choiceListPram
.
put
(
"companyId"
,
101
);
choiceListPram
.
put
(
"pageIndex"
,
1
);
choiceListPram
.
put
(
"pageSize"
,
1
);
...
...
@@ -131,7 +132,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test
(
description
=
"问题管理"
,
priority
=
5
)
public
void
添加问题
()
{
Map
<
String
,
Object
>
questionParam
=
new
HashMap
<>();
questionParam
.
put
(
"companyId"
,
90
);
questionParam
.
put
(
"companyId"
,
101
);
questionParam
.
put
(
"question"
,
"测试问题"
);
Response
questionRes
=
network
.
postResponse
(
questionParam
,
BasicConfig
.
MANAGER_QUESTION
);
...
...
@@ -144,7 +145,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
查询问题并删除
()
{
Map
<
String
,
Object
>
question1Param
=
new
HashMap
<>();
question1Param
.
put
(
"companyId"
,
90
);
question1Param
.
put
(
"companyId"
,
101
);
question1Param
.
put
(
"pageIndex"
,
1
);
question1Param
.
put
(
"pageSize"
,
1
);
...
...
@@ -172,7 +173,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test
(
description
=
"添加图文资料"
,
priority
=
7
)
public
void
添加图文资料
()
{
Map
<
String
,
Object
>
resourceParam
=
new
HashMap
<>();
resourceParam
.
put
(
"companyId"
,
90
);
resourceParam
.
put
(
"companyId"
,
101
);
resourceParam
.
put
(
"resourceTitle"
,
"图文资料2"
);
resourceParam
.
put
(
"resourceButtonTitle"
,
"我要报名"
);
resourceParam
.
put
(
"resourceImg"
,
"https://yun.dui88.com/kjy/image/20210306/1615023456356.jpeg"
);
...
...
@@ -190,7 +191,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
查询图文并删除
()
{
Map
<
String
,
Object
>
imageTextParam
=
new
HashMap
<>();
imageTextParam
.
put
(
"companyId"
,
90
);
imageTextParam
.
put
(
"companyId"
,
101
);
imageTextParam
.
put
(
"pageIndex"
,
1
);
imageTextParam
.
put
(
"pageSize"
,
1
);
imageTextParam
.
put
(
"resourceTypeList"
,
1
);
...
...
@@ -237,7 +238,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
查询链接并删除
()
{
Map
<
String
,
Object
>
linkParam
=
new
HashMap
<>();
linkParam
.
put
(
"companyId"
,
90
);
linkParam
.
put
(
"companyId"
,
101
);
linkParam
.
put
(
"pageIndex"
,
1
);
linkParam
.
put
(
"pageSize"
,
1
);
linkParam
.
put
(
"resourceTypeList"
,
9
);
...
...
@@ -267,7 +268,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test
(
description
=
"添加表单"
,
priority
=
11
)
public
void
添加表单
()
{
Map
<
String
,
Object
>
formParam
=
new
HashMap
<>();
formParam
.
put
(
"companyId"
,
90
);
formParam
.
put
(
"companyId"
,
101
);
formParam
.
put
(
"resourceTitle"
,
"表单"
);
formParam
.
put
(
"resourceButtonTitle"
,
"我要报名"
);
formParam
.
put
(
"resourcePicturesArr"
,
Arrays
.
asList
(
"https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"
));
...
...
@@ -286,7 +287,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
查询表单并删除
()
{
Map
<
String
,
Object
>
form1Param
=
new
HashMap
<>();
form1Param
.
put
(
"companyId"
,
90
);
form1Param
.
put
(
"companyId"
,
101
);
form1Param
.
put
(
"pageIndex"
,
1
);
form1Param
.
put
(
"pageSize"
,
1
);
form1Param
.
put
(
"resourceTypeList"
,
12
);
...
...
@@ -315,7 +316,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test
(
description
=
"免费领资料"
,
priority
=
13
)
public
void
免费领资料
()
{
Map
<
String
,
Object
>
freeParam
=
new
HashMap
<>();
freeParam
.
put
(
"companyId"
,
90
);
freeParam
.
put
(
"companyId"
,
101
);
freeParam
.
put
(
"resourceTitle"
,
"免费领资料"
);
freeParam
.
put
(
"resourceButtonTitle"
,
"领取资料"
);
freeParam
.
put
(
"resourcePicturesArr"
,
Arrays
.
asList
(
"https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"
));
...
...
@@ -334,7 +335,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
删除免费领资料
()
{
Map
<
String
,
Object
>
form1Param
=
new
HashMap
<>();
form1Param
.
put
(
"companyId"
,
90
);
form1Param
.
put
(
"companyId"
,
101
);
form1Param
.
put
(
"pageIndex"
,
1
);
form1Param
.
put
(
"pageSize"
,
1
);
form1Param
.
put
(
"resourceTypeList"
,
11
);
...
...
@@ -363,7 +364,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test
(
description
=
"秒薪测试"
,
priority
=
15
)
public
void
秒薪测试
()
{
Map
<
String
,
Object
>
testParam
=
new
HashMap
<>();
testParam
.
put
(
"companyId"
,
90
);
testParam
.
put
(
"companyId"
,
101
);
testParam
.
put
(
"clueType"
,
1
);
testParam
.
put
(
"mainButtonTitle"
,
"领取门票"
);
testParam
.
put
(
"resourcePicturesArr"
,
Arrays
.
asList
(
"https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"
));
...
...
@@ -385,7 +386,7 @@ public class LiveMaterial implements AdminAuthorization {
public
void
删除秒薪测试
()
{
Map
<
String
,
Object
>
test1Param
=
new
HashMap
<>();
test1Param
.
put
(
"companyId"
,
90
);
test1Param
.
put
(
"companyId"
,
101
);
test1Param
.
put
(
"pageIndex"
,
1
);
test1Param
.
put
(
"pageSize"
,
1
);
test1Param
.
put
(
"resourceTypeList"
,
13
);
...
...
src/test/java/com/kjj/cases/live/LiveVisitors.java
View file @
76f8fa1c
package
com
.
kjj
.
cases
.
live
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.LiveVisitor
;
import
com.alibaba.fastjson.JSONObject
;
import
com.kjj.bean.*
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.JsonUtil
;
...
...
@@ -10,6 +11,7 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -20,72 +22,218 @@ public class LiveVisitors implements AdminAuthorization
@BeforeClass
public
void
setUp
()
{
visitorAuth
();
}
public
String
confId
;
public
String
confId_imagetext
;
public
String
confId_form
;
public
String
confId_link
;
public
String
confId_test
;
public
String
confId_free
;
/*访客端权益列表*/
@Test
(
description
=
"访客端权益列表"
,
priority
=
1
)
public
void
访客端权益列表
()
{
try
{
Thread
.
sleep
(
30000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"live
id"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
params
.
put
(
"live
Id"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Resource
);
List
<
LiveVisitor
>
agentBeans
=
JsonUtil
.
parseResponseToListBean
(
response
,
LiveVisitor
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
LiveVisitor
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Resource
,
"查询权益列表失败"
,
response
.
body
().
asString
()));
}
List
<
LiveVisitor
>
liveVisitors
=
JsonUtil
.
parseResponseToListBean
(
response
,
LiveVisitor
.
class
);
LiveVisitor
one
=
liveVisitors
.
get
(
0
);
System
.
out
.
println
(
one
.
getConfId
());
confId_imagetext
=
one
.
getConfId
();
LiveVisitor
two
=
liveVisitors
.
get
(
3
);
System
.
out
.
println
(
two
.
getConfId
());
confId_free
=
two
.
getConfId
();
LiveVisitor
three
=
liveVisitors
.
get
(
4
);
System
.
out
.
println
(
three
.
getConfId
());
confId_form
=
three
.
getConfId
();
LiveVisitor
four
=
liveVisitors
.
get
(
5
);
System
.
out
.
println
(
four
.
getConfId
());
confId_test
=
four
.
getConfId
();
LiveVisitor
five
=
liveVisitors
.
get
(
6
);
System
.
out
.
println
(
four
.
getConfId
());
confId_link
=
five
.
getConfId
();
System
.
out
.
println
(
liveVisitors
);
Assert
.
assertNotNull
(
liveVisitors
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Resource
,
"查询权益列表失败"
,
response
.
body
().
asString
()));
}
/*公众号资料-领取*/
@Test
(
description
=
"公众号资料领取"
,
priority
=
2
)
public
void
公众号资料领取
()
/*表单资料-查询*/
@Test
(
description
=
"表单资料查询"
,
priority
=
2
)
public
ResourceForm
系统表单资料查询
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId
);
params
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_OfficialAccounts
);
List
<
LiveVisitor
>
agentBeans
=
JsonUtil
.
parseResponseToListBean
(
response
,
LiveVisitor
.
class
);
LiveVisitor
bean
=
agentBeans
.
get
(
0
);
params
.
put
(
"confId"
,
confId_form
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Form
);
ResourceForm
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
ResourceForm
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_OfficialAccounts
,
"领取公众号资料失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Form
,
"查询表单资料失败"
,
response
.
body
().
asString
()));
return
agentBeans
;
}
/*表单资料-提交*/
@Test
(
description
=
"表单资料提交"
,
priority
=
3
)
public
void
系统表单资料提交
()
{
ResourceForm
list
=
系统表单资料查询
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_form
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List
<
ResourceForm
.
FieldList
>
fieldList
=
list
.
getFieldList
();
List
<
JSONObject
>
fieldListparam
=
new
ArrayList
<>();
JSONObject
one
=
new
JSONObject
();
one
.
put
(
"fieldId"
,
fieldList
.
get
(
0
).
getFieldId
());
one
.
put
(
"fieldValue"
,
"啦啦啦"
);
JSONObject
two
=
new
JSONObject
();
two
.
put
(
"fieldId"
,
fieldList
.
get
(
1
).
getFieldId
());
two
.
put
(
"fieldValue"
,
"152588101691"
);
fieldListparam
.
add
(
one
);
fieldListparam
.
add
(
two
);
params
.
put
(
"fieldList"
,
fieldListparam
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
params
));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_FormSubmit
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_FormSubmit
,
"提交表单资料失败"
,
response
.
body
().
asString
()));
}
/*
表单资料-领取
*/
@Test
(
description
=
"
表单资料领取"
,
priority
=
3
)
public
void
表单资料领取
()
/*
免费领资料-查询
*/
@Test
(
description
=
"
免费领资料查询"
,
priority
=
4
)
public
void
免费领资料查询
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId
);
params
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_OfficialAccounts
);
List
<
LiveVisitor
>
agentBeans
=
JsonUtil
.
parseResponseToListBean
(
response
,
LiveVisitor
.
class
);
LiveVisitor
bean
=
agentBeans
.
get
(
0
);
params
.
put
(
"confId"
,
confId_free
);
params
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ResourceFree
);
ResourceFree
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
ResourceFree
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_OfficialAccounts
,
"领取表单
资料失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ResourceFree
,
"查询免费领
资料失败"
,
response
.
body
().
asString
()));
}
/*免费领资料-领取*/
@Test
(
description
=
"免费领资料领取"
,
priority
=
3
)
@Test
(
description
=
"免费领资料领取"
,
priority
=
5
)
public
void
免费领资料领取
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId
);
params
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_OfficialAccounts
);
List
<
LiveVisitor
>
agentBeans
=
JsonUtil
.
parseResponseToListBean
(
response
,
LiveVisitor
.
class
);
LiveVisitor
bean
=
agentBeans
.
get
(
0
);
params
.
put
(
"confId"
,
confId_free
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Link
);
boolean
invite
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
invite
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Link
,
"领取免费领资料失败"
,
response
.
body
().
asString
()));
}
/*链接小程序资料-查询*/
@Test
(
description
=
"链接资料查询"
,
priority
=
6
)
public
void
链接小程序资料查询
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_link
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Link1
);
ResourceLink
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
ResourceLink
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_OfficialAccounts
,
"领取表单资料失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Link1
,
"查询链接资料失败"
,
response
.
body
().
asString
()));
}
/*链接资料资料-领取*/
@Test
(
description
=
"链接资料领取"
,
priority
=
7
)
public
void
链接小程序资料领取
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_link
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Link
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Link
,
"领取链接资料失败"
,
response
.
body
().
asString
()));
}
/*秒薪测试配置-查询*/
@Test
(
description
=
"秒薪测试查询"
,
priority
=
8
)
public
ResourceTestDetail
秒薪测试查询
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_test
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ResourceTestDetail
);
ResourceTestDetail
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
ResourceTestDetail
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ResourceTestDetail
,
"查询秒薪测试失败"
,
response
.
body
().
asString
()));
return
agentBeans
;
}
/*秒薪测试-参与*/
@Test
(
description
=
"秒薪测试参与"
,
priority
=
9
)
public
void
秒薪测试参与
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ResourceTestParticipate
);
List
<
ResourceTestParticipate
>
agentBeans
=
JsonUtil
.
parseResponseToListBean
(
response
,
ResourceTestParticipate
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ResourceTestParticipate
,
"秒薪测试参与失败"
,
response
.
body
().
asString
()));
}
/*权益测试-详情*/
@Test
(
description
=
"权益测试提交"
,
priority
=
10
)
public
void
权益测试详情提交
()
{
ResourceTestDetail
list
=
秒薪测试查询
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"confId"
,
confId_test
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List
<
ResourceTestDetail
.
FieldList
>
fieldList
=
list
.
getFieldList
();
List
<
JSONObject
>
fieldListparam
=
new
ArrayList
<>();
JSONObject
one
=
new
JSONObject
();
one
.
put
(
"fieldId"
,
fieldList
.
get
(
0
).
getFieldId
());
one
.
put
(
"fieldValue"
,
"100000"
);
one
.
put
(
"fieldSubmitIds"
,
""
);
fieldListparam
.
add
(
one
);
params
.
put
(
"fieldList"
,
fieldListparam
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
params
));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_ResourceTestSubmit
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ResourceTestSubmit
,
"提交秒薪测试失败"
,
response
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/live/MngAuthorization.java
View file @
76f8fa1c
...
...
@@ -3,7 +3,9 @@ package com.kjj.cases.live;
import
com.kjj.utils.NetworkUtils
;
/**
* 管理员小程序授权
* 管理员后台授权
* @author zhanghuifeng
* date 2021/2/20-13:46
*/
public
interface
MngAuthorization
{
...
...
@@ -12,7 +14,7 @@ public interface MngAuthorization {
default
void
mngAuth
(){
// 创建sso用户 并传到network里
network
.
agentCookies
.
put
(
"csrf_token"
,
"ff715857c2234f6577cbf1a57600c316"
);
network
.
agentCookies
.
put
(
"sso_ticket"
,
"dcdc60f6fe4a0c5a439d15d67
90
400cb"
);
network
.
agentCookies
.
put
(
"sso_ticket"
,
"dcdc60f6fe4a0c5a439d15d67
101
400cb"
);
}
}
src/test/java/com/kjj/cases/live/OpenLive.java
View file @
76f8fa1c
...
...
@@ -18,7 +18,7 @@ public class OpenLive implements AdminAuthorization {
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
openParam
.
put
(
"cid"
,
90
);
openParam
.
put
(
"cid"
,
101
);
Response
openRes
=
network
.
postResponse
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
);
Object
data
=
openRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -29,4 +29,6 @@ public class OpenLive implements AdminAuthorization {
}
src/test/java/com/kjj/cases/live/Procurator.java
View file @
76f8fa1c
...
...
@@ -24,6 +24,8 @@ public class Procurator implements AdminAuthorization{
agentAuth
();
}
/*代理人首页直播列表*/
@Test
(
description
=
"代理人首页 "
,
priority
=
1
)
public
void
代理人直播列表
()
{
...
...
@@ -32,7 +34,7 @@ public class Procurator implements AdminAuthorization{
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Procurator
);
List
<
AgentBean
>
agentBeans
=
JsonUtil
.
parseResponseTo
List
Bean
(
response
,
AgentBean
.
class
);
List
<
AgentBean
>
agentBeans
=
JsonUtil
.
parseResponseTo
Page
Bean
(
response
,
AgentBean
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
AgentBean
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
...
...
@@ -48,7 +50,7 @@ public class Procurator implements AdminAuthorization{
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentEndList
);
List
<
AgentEndList
>
agentBeans
=
JsonUtil
.
parseResponseTo
List
Bean
(
response
,
AgentEndList
.
class
);
List
<
AgentEndList
>
agentBeans
=
JsonUtil
.
parseResponseTo
Page
Bean
(
response
,
AgentEndList
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
AgentEndList
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
...
...
@@ -76,7 +78,7 @@ public class Procurator implements AdminAuthorization{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerName"
,
"你好测试"
+
RandomUtils
.
nextInt
(
1
,
100
));
params
.
put
(
"phoneNumber"
,
"152588
90
691"
);
params
.
put
(
"phoneNumber"
,
"152588
101
691"
);
params
.
put
(
"jobNumber"
,
"TTTTTT"
);
params
.
put
(
"wechatQrCode"
,
"//yun.dui88.com/kjy/nc/qrcode1/1981ec88d22fe37041feac4724c627670817.png"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
);
...
...
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
View file @
76f8fa1c
...
...
@@ -51,6 +51,7 @@ public class SaveAndUpdate implements AdminAuthorization {
Assert
.
assertNotNull
(
liveID
,
network
.
message
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
,
"新增直播失败"
,
response
.
body
().
asString
()));
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
());
}
@Test
(
description
=
"查询直播配置"
,
priority
=
2
)
public
void
查询直播配置
()
{
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
76f8fa1c
...
...
@@ -3,7 +3,7 @@ package com.kjj.config;
public
class
BasicConfig
{
public
static
int
apiCount
;
//接口数量统计
// 是否开启钉钉机器人推送
public
static
final
boolean
isPushReport
=
tru
e
;
//true
public
static
final
boolean
isPushReport
=
fals
e
;
//true
// 代理人微信昵称
public
static
final
String
WECHAT_NAME
=
"嘿保险"
;
//true
...
...
@@ -127,16 +127,36 @@ public class BasicConfig {
//访客端领取资料//
//查询资料列表//
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
//公众号领取//
public
static
final
String
MOBILE_OfficialAccounts
=
MOBILE_HOST
+
"/kjy/live/user/resource/receive"
;
//表单资料领取//
public
static
final
String
MOBILE_
=
MOBILE_HOST
+
"/kjy/live/user/resource/receive"
;
//表单资料查询//
public
static
final
String
MOBILE_Form
=
MOBILE_HOST
+
"/clue/resource/form/detail"
;
//表单资料查询//
public
static
final
String
MOBILE_FormSubmit
=
MOBILE_HOST
+
"/clue/resource/form/submit"
;
//链接资料查询
public
static
final
String
MOBILE_Link1
=
MOBILE_HOST
+
"/clue/info/interact"
;
//链接资料领取
public
static
final
String
MOBILE_Link
=
MOBILE_HOST
+
"/kjy/live/user/resource/receive"
;
//免费领
public
static
final
String
MOBILE_ResourceFree
=
MOBILE_HOST
+
"/kjy/live/user/resource/findDetailByConfId"
;
//秒薪测试查询
public
static
final
String
MOBILE_ResourceTestDetail
=
MOBILE_HOST
+
"/clue/resource/test/detail"
;
public
static
final
String
MOBILE_ResourceTestParticipate
=
MOBILE_HOST
+
"/clue/resource/test/participate"
;
public
static
final
String
MOBILE_ResourceTestSubmit
=
MOBILE_HOST
+
"/clue/resource/test/submit"
;
//访客端红包
public
static
final
String
MOBILE_OrdinaryRed
=
MOBILE_HOST
+
"/clue/red/findRedList"
;
public
static
final
String
MOBILE_OrdinaryRed1
=
MOBILE_HOST
+
"/clue/red/findSimpleDetail"
;
//访客端领取资料//
public
static
final
String
MOBILE_GetAgentPosterInfo
=
MOBILE_HOST
+
"/kjy/live/share/getAgentPosterInfo"
;
...
...
src/test/java/com/kjj/utils/JsonUtil.java
View file @
76f8fa1c
...
...
@@ -33,11 +33,17 @@ public class JsonUtil {
* @param <T>
* @return
*/
public
static
<
T
>
List
<
T
>
parseResponseTo
List
Bean
(
Response
response
,
Class
<
T
>
tClass
){
public
static
<
T
>
List
<
T
>
parseResponseTo
Page
Bean
(
Response
response
,
Class
<
T
>
tClass
){
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
str
);
JSONArray
array
=
jsonObject
.
getJSONArray
(
"list"
);
return
array
.
toJavaList
(
tClass
);
}
public
static
<
T
>
List
<
T
>
parseResponseToListBean
(
Response
response
,
Class
<
T
>
tClass
){
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
return
JSON
.
parseArray
(
str
,
tClass
);
}
}
src/test/liveTestNG.xml
View file @
76f8fa1c
...
...
@@ -26,17 +26,19 @@
</test>
<test
preserve-order=
"true"
name=
"访客券码领取"
>
<classes>
<class
name=
"com.kjj.cases.live.User"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客券码领取"
>
<classes>
<class
name=
"com.kjj.cases.live.User"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"指定中奖"
>
<classes>
...
...
@@ -53,11 +55,7 @@
<class
name=
"com.kjj.cases.live.LiveAgent"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
...
...
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