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
8b758343
Commit
8b758343
authored
Sep 11, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播中测试完善
parent
cd75062f
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
503 additions
and
64 deletions
+503
-64
LiveVisitor.java
src/test/java/com/kjj/bean/resources/LiveVisitor.java
+1
-0
ResourceForm.java
src/test/java/com/kjj/bean/resources/ResourceForm.java
+1
-0
ResourceFree.java
src/test/java/com/kjj/bean/resources/ResourceFree.java
+1
-0
LiveVisitors.java
src/test/java/com/kjj/cases/live/anchor/LiveVisitors.java
+258
-25
EvaluationConf.java
...st/java/com/kjj/cases/live/liveConfig/EvaluationConf.java
+92
-5
LiveMaterial.java
...test/java/com/kjj/cases/live/liveConfig/LiveMaterial.java
+113
-10
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+2
-0
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+2
-2
LotteryCode.java
...test/java/com/kjj/cases/live/lotteryCode/LotteryCode.java
+2
-2
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+4
-0
IdMakeUtil.java
src/test/java/com/kjj/utils/IdMakeUtil.java
+2
-0
liveTestNG.xml
src/test/liveTestNG.xml
+25
-20
No files found.
src/test/java/com/kjj/bean/resources/LiveVisitor.java
View file @
8b758343
...
...
@@ -17,4 +17,5 @@ public class LiveVisitor {
private
String
testType
;
private
boolean
hasPasterOn
;
private
boolean
hasConfPaster
;
private
String
evaluationId
;
}
src/test/java/com/kjj/bean/resources/ResourceForm.java
View file @
8b758343
...
...
@@ -11,6 +11,7 @@ public class ResourceForm {
private
String
banner
;
private
List
<
FieldList
>
fieldList
;
private
String
received
;
private
String
evaluationId
;
@Data
public
static
class
FieldList
...
...
src/test/java/com/kjj/bean/resources/ResourceFree.java
View file @
8b758343
...
...
@@ -23,4 +23,5 @@ public class ResourceFree {
private
int
outLinkType
;
private
String
outLinkAppId
;
private
String
formBanner
;
private
String
evaluationId
;
}
src/test/java/com/kjj/cases/live/anchor/LiveVisitors.java
View file @
8b758343
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/liveConfig/EvaluationConf.java
View file @
8b758343
...
...
@@ -7,15 +7,102 @@ import com.kjj.utils.BaseUtils;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
public
class
EvaluationConf
implements
Authorization
{
private
static
final
String
resultPhoto
=
"https://yun.dui88.com/kjy/image/20210907/1630997534648.jpg"
;
private
static
Map
<
String
,
Object
>
params
;
private
static
final
long
companyId
=
139
;
private
static
final
long
companyId
=
101
;
/**
* 开启直播后修改权益关联测试ID
*/
@Test
(
description
=
"直播中修改权益关联测试ID"
,
priority
=
1
)
public
void
直播中修改权益关联测试
ID
()
{
// 测试
Map
<
String
,
Object
>
addEvaResourcePar
=
new
HashMap
<>();
addEvaResourcePar
.
put
(
"companyId"
,
companyId
);
addEvaResourcePar
.
put
(
"evaluationId"
,
92
);
// 修改测试ID
addEvaResourcePar
.
put
(
"id"
,
LiveMaterial
.
resourceId
);
addEvaResourcePar
.
put
(
"resourceButtonTitle"
,
"这是按钮"
);
addEvaResourcePar
.
put
(
"resourceImg"
,
resultPhoto
);
addEvaResourcePar
.
put
(
"resourceSubTitle"
,
"这是描述内容"
);
addEvaResourcePar
.
put
(
"resourceTitle"
,
"编辑后测试权益标题"
);
addEvaResourcePar
.
put
(
"resourceType"
,
23
);
Response
addEvaResourceRes
=
network
.
postResponse
(
addEvaResourcePar
,
BasicConfig
.
MANAGER_evaluation_saveEvaResource
);
System
.
out
.
println
(
addEvaResourceRes
.
body
().
asString
());
// try {
// boolean data = addEvaResourceRes.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(addEvaResourcePar, BasicConfig.MANAGER_evaluation_saveEvaResource, "编辑测试权益失败", addEvaResourceRes.body().asString()));
// }catch (NullPointerException e){
// e.printStackTrace();
// Assert.fail(network.message(addEvaResourcePar, BasicConfig.MANAGER_evaluation_saveEvaResource, "获取数据失败", addEvaResourceRes.body().asString()));
// }
// 表单
Map
<
String
,
Object
>
formParam
=
new
HashMap
<>();
formParam
.
put
(
"companyId"
,
companyId
);
formParam
.
put
(
"evaluationId"
,
92
);
formParam
.
put
(
"id"
,
LiveMaterial
.
termResourceId
);
formParam
.
put
(
"resourceTitle"
,
"表单关联测试"
);
formParam
.
put
(
"resourceButtonTitle"
,
"我要报名"
);
formParam
.
put
(
"resourcePicturesArr"
,
Arrays
.
asList
(
"https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"
));
formParam
.
put
(
"resourceImg"
,
"https://yun.dui88.com/kjy/image/20210306/1615033315608.jpeg"
);
formParam
.
put
(
"formBanner"
,
"https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"
);
formParam
.
put
(
"fieldIds"
,
"1,2"
);
Response
formRes
=
network
.
postResponse
(
formParam
,
BasicConfig
.
MANAGER_saveForm
);
System
.
out
.
println
(
formRes
.
body
().
asString
());
// 免费领
Map
<
String
,
Object
>
freeParam
=
new
HashMap
<>();
freeParam
.
put
(
"companyId"
,
companyId
);
freeParam
.
put
(
"evaluationId"
,
92
);
freeParam
.
put
(
"id"
,
LiveMaterial
.
freeResourceId
);
freeParam
.
put
(
"resourceTitle"
,
"免费领关联测试"
);
freeParam
.
put
(
"resourceButtonTitle"
,
"领取资料"
);
freeParam
.
put
(
"resourcePicturesArr"
,
Arrays
.
asList
(
"https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"
));
freeParam
.
put
(
"resourceImg"
,
"https://yun.dui88.com/kjy/image/20210306/1615033315608.jpeg"
);
freeParam
.
put
(
"resourcePictures"
,
"https://yun.dui88.com/kjy/image/20210306/1615039670425.jpg"
);
Response
FreeRes
=
network
.
postResponse
(
freeParam
,
BasicConfig
.
MANAGER_saveFree
);
System
.
out
.
println
(
FreeRes
.
body
().
asString
());
// 图文
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"companyId"
,
companyId
);
Params
.
put
(
"evaluationId"
,
92
);
Params
.
put
(
"id"
,
LiveMaterial
.
picResourceId
);
Params
.
put
(
"resourceTitle"
,
"图文资料2"
);
Params
.
put
(
"resourceButtonTitle"
,
"我要报名"
);
Params
.
put
(
"resourceImg"
,
"https://yun.dui88.com/kjy/image/20210306/1615023456356.jpeg"
);
Params
.
put
(
"resourcePictures"
,
"https://yun.dui88.com/kjy/image/20210306/1615023476770.jpeg"
);
Params
.
put
(
"resourcePicturesArr"
,
"https://yun.dui88.com/kjy/image/20210306/1615023476770.jpeg"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_resource
);
System
.
out
.
println
(
response
.
body
().
asString
());
}
@Test
(
description
=
"删除权益"
,
priority
=
2
)
public
void
删除权益
()
{
for
(
int
resourceId
:
Arrays
.
asList
(
LiveMaterial
.
resourceId
,
LiveMaterial
.
termResourceId
,
LiveMaterial
.
freeResourceId
,
LiveMaterial
.
picResourceId
)){
System
.
out
.
println
(
resourceId
);
Map
<
String
,
Object
>
delResourceParam
=
new
HashMap
<>();
delResourceParam
.
put
(
"id"
,
resourceId
);
Response
delResourceRes
=
network
.
postResponse
(
delResourceParam
,
BasicConfig
.
MANAGER_delResource
);
try
{
boolean
data
=
delResourceRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
delResourceParam
,
BasicConfig
.
MANAGER_delResource
,
"删除权益失败"
,
delResourceRes
.
body
().
asString
()));
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
Assert
.
fail
(
network
.
message
(
delResourceParam
,
BasicConfig
.
MANAGER_delResource
,
"获取数据失败"
,
delResourceRes
.
body
().
asString
()));
}
}
}
// 初始化params
public
static
Map
<
String
,
Object
>
initParams
()
{
...
...
src/test/java/com/kjj/cases/live/liveConfig/LiveMaterial.java
View file @
8b758343
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
8b758343
...
...
@@ -171,6 +171,8 @@ public class SaveLive implements Authorization {
ids
.
add
(
new
Material
(
960L
,
0
));
ids
.
add
(
new
Material
(
3384L
,
0
));
ids
.
add
(
new
Material
(
LiveMaterial
.
resourceId
,
0
));
// 直播添加测试权益资料
ids
.
add
(
new
Material
(
LiveMaterial
.
termResourceId
,
0
));
// 直播添加表单关联测试权益
ids
.
add
(
new
Material
(
LiveMaterial
.
freeResourceId
,
0
));
// 直播添加免费领关联测试权益
Params
.
put
(
"resourceList"
,
ids
);
System
.
out
.
println
(
Params
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveAndUpdate_8
);
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
8b758343
...
...
@@ -68,7 +68,7 @@ public class Lottery implements Authorization {
Assert
.
assertTrue
(
success
,
network
.
message
(
connectSuccessParam
,
BasicConfig
.
USER_connectSuccess
,
"访客到场请求失败"
,
response
.
body
().
asString
()));
}
/*
@Test(description = "访客A抽奖查询抽奖活动弹层", priority = 5)
public void 访客A抽奖查询抽奖活动弹层() {
visitorAuth();
...
...
@@ -1473,7 +1473,7 @@ public class Lottery implements Authorization {
throw e;
}
}
*/
}
...
...
src/test/java/com/kjj/cases/live/lotteryCode/LotteryCode.java
View file @
8b758343
...
...
@@ -54,7 +54,7 @@ public class LotteryCode implements Authorization {
Assert
.
assertTrue
(
type
==
3
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
/*
@Test(description = "访客A获取直播所有的订阅消息模板", priority = 4)
public void 访客A获取直播所有的订阅消息模板() {
visitorAuth();
...
...
@@ -243,7 +243,7 @@ public class LotteryCode implements Authorization {
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
*/
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
8b758343
...
...
@@ -546,6 +546,8 @@ public class BasicConfig {
public
static
final
String
MOBILE_pasterInfo
=
MOBILE_HOST
+
"/clue/paster/info"
;
public
static
final
String
MOBILE_pasterOff
=
MOBILE_HOST
+
"/conf/live/push/pasterOff"
;
public
static
final
String
MOBILE_getShortUrl
=
MOBILE_HOST
+
"/kjy/live/share/short/getShortUrl"
;
public
static
final
String
MOBILE_evaluationDetail
=
MOBILE_HOST
+
"/clue/evaluation/detail"
;
public
static
final
String
MOBILE_evaluationSubmit
=
MOBILE_HOST
+
"/clue/evaluation/submit"
;
//投票
...
...
@@ -627,6 +629,8 @@ public class BasicConfig {
public
static
final
String
MANAGER_evaluation_getEnable
=
MANAGER_HOST
+
"/kjy/manager/live/evaluation/searchByTitle"
;
public
static
final
String
MANAGER_evaluation_saveEvaResource
=
MANAGER_HOST
+
"/kjy/manager/live/resource/saveOrUpdateEvaluation"
;
public
static
final
String
MANAGER_evaluation_saveEnable
=
MANAGER_HOST
+
"/kjy/manager/live/evaluation/updateEnabled"
;
public
static
final
String
MANAGER_resource_evaluationDetail
=
MANAGER_HOST
+
"/kjy/manager/live/resource/detailEvaluation"
;
public
static
final
String
MANAGER_resource_nonReceive
=
MANAGER_HOST
+
"/kjy/manager/live/resource/nonReceive"
;
//***************直播团队管理*****************
public
static
final
String
MANAGER_teamList
=
MANAGER_HOST
+
"/kjy/manager/live/company/team/teamList"
;
...
...
src/test/java/com/kjj/utils/IdMakeUtil.java
View file @
8b758343
...
...
@@ -56,7 +56,9 @@ public class IdMakeUtil implements Authorization {
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
ids
=
new
HashMap
<>();
ids
.
put
(
"code"
,
id
);
// System.out.println("input: "+id);
Response
encodeIdRes
=
network
.
getResponse
(
ids
,
BasicConfig
.
MANAGER_ID_ENCODE
);
// System.out.println("encodeIdRes: "+encodeIdRes.body().asString());
String
encodeId
=
encodeIdRes
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
encodeId
,
network
.
message
(
ids
,
BasicConfig
.
MANAGER_ID_ENCODE
,
"加密id失败"
,
encodeIdRes
.
body
().
asString
()));
return
encodeId
;
...
...
src/test/liveTestNG.xml
View file @
8b758343
...
...
@@ -41,11 +41,11 @@
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="资料贴片">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.live.liveConfig.Paster"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"资料贴片"
>
<classes
>
<class
name=
"com.kjj.cases.live.liveConfig.Paster"
/
>
</classes
>
</test
>
<!-- <test preserve-order="true" name="代理人首页">-->
...
...
@@ -60,11 +60,11 @@
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="获取抽奖码校验">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.live.lotteryCode.LotteryCode"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"获取抽奖码校验"
>
<classes
>
<class
name=
"com.kjj.cases.live.lotteryCode.LotteryCode"
/
>
</classes
>
</test
>
<!-- <test preserve-order="false" name="预告页">-->
<!-- <classes>-->
...
...
@@ -105,6 +105,11 @@
<class
name=
"com.kjj.cases.live.anchor.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播中编辑资料"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.EvaluationConf"
/>
</classes>
</test>
<!-- <test preserve-order="true" name="访客签到">-->
<!-- <classes>-->
...
...
@@ -118,11 +123,11 @@
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中抽奖">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.live.lottery.Lottery"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<classes
>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/
>
</classes
>
</test
>
<!-- <test preserve-order="true" name="秒杀互动">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.secondKill.SecondKill"/>-->
...
...
@@ -152,11 +157,11 @@
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="访客领取资料">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.live.anchor.LiveVisitors"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"访客领取资料"
>
<classes
>
<class
name=
"com.kjj.cases.live.anchor.LiveVisitors"
/
>
</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