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
fa19d1a8
Commit
fa19d1a8
authored
Mar 26, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
dd82d44a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6403 additions
and
406 deletions
+6403
-406
DesignatedWinner.java
src/test/java/com/kjj/cases/live/DesignatedWinner.java
+46
-0
LiveMaterial.java
src/test/java/com/kjj/cases/live/LiveMaterial.java
+0
-2
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
+75
-67
User.java
src/test/java/com/kjj/cases/live/User.java
+6
-7
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+5
-3
liveTestNG.xml
src/test/liveTestNG.xml
+8
-2
testNG.xml
src/test/testNG.xml
+1
-1
report.html
test-output/report.html
+6262
-324
No files found.
src/test/java/com/kjj/cases/live/DesignatedWinner.java
0 → 100644
View file @
fa19d1a8
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
DesignatedWinner
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
@Test
(
description
=
"查询指定中奖配置"
,
priority
=
1
)
public
void
查询指定中奖配置
()
{
Map
<
String
,
Object
>
awardConfParam
=
new
HashMap
<>();
awardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
awardConfRes
=
network
.
getResponse
(
awardConfParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
);
Object
data
=
awardConfRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
awardConfParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
,
"中奖配置查询失败"
,
awardConfRes
.
body
().
asString
()));
}
@Test
(
description
=
"代理人指定访客中奖表单提交"
,
priority
=
2
)
public
void
代理人指定访客中奖表单提交
()
{
Map
<
String
,
Object
>
SubmitParam
=
new
HashMap
<>();
SubmitParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
SubmitParam
.
put
(
"visitorId"
,
"Kj21NDE0NTU"
);
Response
SubmitRes
=
network
.
getResponse
(
SubmitParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
);
Object
data
=
SubmitRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
SubmitParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
,
"代理人指定中奖失败"
,
SubmitRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/LiveMaterial.java
View file @
fa19d1a8
package
com
.
kjj
.
cases
.
live
;
package
com
.
kjj
.
cases
.
live
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.kjj.bean.VoteBean
;
import
com.kjj.bean.VoteBean
;
import
com.kjj.bean.VoteListBean
;
import
com.kjj.bean.VoteListBean
;
import
com.kjj.bean.WelfareBean
;
import
com.kjj.bean.WelfareBean
;
...
@@ -8,7 +7,6 @@ import com.kjj.bean.WelfareListBean;
...
@@ -8,7 +7,6 @@ import com.kjj.bean.WelfareListBean;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.JsonUtil
;
import
groovy.json.JsonBuilder
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.BeforeClass
;
...
...
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
View file @
fa19d1a8
...
@@ -17,6 +17,7 @@ import java.util.*;
...
@@ -17,6 +17,7 @@ import java.util.*;
public
class
SaveAndUpdate
implements
AdminAuthorization
{
public
class
SaveAndUpdate
implements
AdminAuthorization
{
public
String
liveID
;
public
String
liveID
;
public
String
EncodeLiveID
;
public
String
EncodeLiveID
;
public
long
welfareConfId
;
@Test
(
description
=
"创建直播"
,
priority
=
1
)
@Test
(
description
=
"创建直播"
,
priority
=
1
)
public
void
创建直播
()
{
public
void
创建直播
()
{
...
@@ -48,7 +49,6 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -48,7 +49,6 @@ public class SaveAndUpdate implements AdminAuthorization {
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
(),
liveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
(),
liveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
(),
EncodeLiveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
(),
EncodeLiveID
);
Assert
.
assertNotNull
(
liveID
,
network
.
message
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
,
"新增直播失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
liveID
,
network
.
message
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
,
"新增直播失败"
,
response
.
body
().
asString
()));
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
());
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
());
}
}
...
@@ -152,8 +152,71 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -152,8 +152,71 @@ public class SaveAndUpdate implements AdminAuthorization {
Assert
.
assertTrue
(
data5
,
network
.
message
(
saveOrUpdate4Param
,
BasicConfig
.
MANAGER_SAVEORUPDATE4
,
"问卷配置失败"
,
saveOrUpdate4Res
.
body
().
asString
()));
Assert
.
assertTrue
(
data5
,
network
.
message
(
saveOrUpdate4Param
,
BasicConfig
.
MANAGER_SAVEORUPDATE4
,
"问卷配置失败"
,
saveOrUpdate4Res
.
body
().
asString
()));
}
}
//直播中奖品配置
@Test
(
description
=
"直播中抽奖"
,
priority
=
9
)
public
void
直播中抽奖
()
{
Map
<
String
,
Object
>
add1Param
=
new
HashMap
<>();
add1Param
.
put
(
"liveId"
,
liveID
);
add1Param
.
put
(
"interactNum"
,
100
);
add1Param
.
put
(
"showInteractNum"
,
100
);
add1Param
.
put
(
"welfareId"
,
191
);
add1Param
.
put
(
"afterMin"
,
20
);
Response
add1Res
=
network
.
postResponse
(
add1Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data
=
add1Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
add1Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add1Res
.
body
().
asString
()));
Map
<
String
,
Object
>
add2Param
=
new
HashMap
<>();
add2Param
.
put
(
"liveId"
,
liveID
);
add2Param
.
put
(
"interactNum"
,
100
);
add2Param
.
put
(
"showInteractNum"
,
100
);
add2Param
.
put
(
"welfareId"
,
192
);
add2Param
.
put
(
"afterMin"
,
30
);
Response
add2Res
=
network
.
postResponse
(
add2Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data1
=
add2Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
add2Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add2Res
.
body
().
asString
()));
Map
<
String
,
Object
>
add3Param
=
new
HashMap
<>();
add3Param
.
put
(
"liveId"
,
liveID
);
add3Param
.
put
(
"interactNum"
,
100
);
add3Param
.
put
(
"showInteractNum"
,
100
);
add3Param
.
put
(
"welfareId"
,
193
);
add3Param
.
put
(
"afterMin"
,
35
);
Response
add3Res
=
network
.
postResponse
(
add3Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data2
=
add3Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data2
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
add3Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add3Res
.
body
().
asString
()));
@Test
(
description
=
"指定中奖奖品"
,
priority
=
9
)
Map
<
String
,
Object
>
add4Param
=
new
HashMap
<>();
add4Param
.
put
(
"liveId"
,
liveID
);
add4Param
.
put
(
"interactNum"
,
100
);
add4Param
.
put
(
"showInteractNum"
,
100
);
add4Param
.
put
(
"welfareId"
,
194
);
add4Param
.
put
(
"afterMin"
,
40
);
Response
add4Res
=
network
.
postResponse
(
add4Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data3
=
add4Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data3
);
Assert
.
assertNotNull
(
data3
,
network
.
message
(
add4Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add4Res
.
body
().
asString
()));
}
@Test
(
description
=
"查询抽奖奖品列表"
,
priority
=
10
)
public
void
查询抽奖奖品列表
()
{
Map
<
String
,
Object
>
sgetLiveAwardListParam
=
new
HashMap
<>();
sgetLiveAwardListParam
.
put
(
"liveId"
,
liveID
);
Response
sgetLiveAwardListRes
=
network
.
getResponse
(
sgetLiveAwardListParam
,
BasicConfig
.
MANAGER_getLiveAwardList
);
List
data
=
sgetLiveAwardListRes
.
jsonPath
().
getList
(
"data"
);
Map
resultMap
=
(
Map
)
data
.
get
(
0
);
System
.
out
.
println
(
resultMap
.
get
(
"welfareConfId"
));
welfareConfId
=
Long
.
parseLong
(
resultMap
.
get
(
"welfareConfId"
).
toString
());
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
sgetLiveAwardListParam
,
BasicConfig
.
MANAGER_getLiveAwardList
,
"查询奖品列表失败"
,
sgetLiveAwardListRes
.
body
().
asString
()));
}
@Test
(
description
=
"指定中奖奖品"
,
priority
=
11
)
public
void
指定中奖奖品
()
{
public
void
指定中奖奖品
()
{
Map
<
String
,
Object
>
saveSpecifyAwardParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveSpecifyAwardParam
=
new
HashMap
<>();
saveSpecifyAwardParam
.
put
(
"Id"
,
""
);
saveSpecifyAwardParam
.
put
(
"Id"
,
""
);
...
@@ -164,22 +227,21 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -164,22 +227,21 @@ public class SaveAndUpdate implements AdminAuthorization {
saveSpecifyAwardParam
.
put
(
"maxCanSpecifyCount"
,
0
);
saveSpecifyAwardParam
.
put
(
"maxCanSpecifyCount"
,
0
);
saveSpecifyAwardParam
.
put
(
"privilegeScope"
,
1
);
saveSpecifyAwardParam
.
put
(
"privilegeScope"
,
1
);
saveSpecifyAwardParam
.
put
(
"inviteCount"
,
1
);
saveSpecifyAwardParam
.
put
(
"inviteCount"
,
1
);
saveSpecifyAwardParam
.
put
(
"welfareConfId"
,
192
);
saveSpecifyAwardParam
.
put
(
"welfareConfId"
,
welfareConfId
);
Response
saveSpecifyAwardRes
=
network
.
postResponse
(
saveSpecifyAwardParam
,
BasicConfig
.
MANAGER_SAVESPECIFYAWARD
);
Response
saveSpecifyAwardRes
=
network
.
postResponse
(
saveSpecifyAwardParam
,
BasicConfig
.
MANAGER_SAVESPECIFYAWARD
);
boolean
data7
=
saveSpecifyAwardRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data7
=
saveSpecifyAwardRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data7
);
System
.
out
.
println
(
data7
);
Assert
.
assertTrue
(
data7
,
network
.
message
(
saveSpecifyAwardParam
,
BasicConfig
.
MANAGER_SAVESPECIFYAWARD
,
"指定中奖配置失败"
,
saveSpecifyAwardRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data7
,
network
.
message
(
saveSpecifyAwardParam
,
BasicConfig
.
MANAGER_SAVESPECIFYAWARD
,
"指定中奖配置失败"
,
saveSpecifyAwardRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"个人PK奖励"
,
priority
=
1
0
)
@Test
(
description
=
"个人PK奖励"
,
priority
=
1
2
)
public
void
个人
PK
奖励
()
{
public
void
个人
PK
奖励
()
{
Map
<
String
,
Object
>
saveOrUpdate5Param
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveOrUpdate5Param
=
new
HashMap
<>();
saveOrUpdate5Param
.
put
(
"liveId"
,
liveID
);
saveOrUpdate5Param
.
put
(
"liveId"
,
liveID
);
saveOrUpdate5Param
.
put
(
"rewardType"
,
1
);
//1:个人,2:团队
saveOrUpdate5Param
.
put
(
"rewardType"
,
1
);
//1:个人,2:团队
List
<
RewardPkBean
>
rewardPks
=
new
ArrayList
<>();
// []
List
<
RewardPkBean
>
rewardPks
=
new
ArrayList
<>();
RewardPkBean
rewardPk
=
new
RewardPkBean
();
// {}
RewardPkBean
rewardPk
=
new
RewardPkBean
();
rewardPk
.
setPrizeName
(
"1"
);
rewardPk
.
setPrizeName
(
"1"
);
rewardPk
.
setRanking
(
1
);
rewardPk
.
setRanking
(
1
);
rewardPks
.
add
(
rewardPk
);
rewardPks
.
add
(
rewardPk
);
...
@@ -202,7 +264,7 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -202,7 +264,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
}
@Test
(
description
=
"团队PK奖励"
,
priority
=
1
1
)
@Test
(
description
=
"团队PK奖励"
,
priority
=
1
3
)
public
void
团队
PK
奖励
()
{
public
void
团队
PK
奖励
()
{
Map
<
String
,
Object
>
saveOrUpdate6Param
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveOrUpdate6Param
=
new
HashMap
<>();
...
@@ -234,7 +296,7 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -234,7 +296,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
}
@Test
(
description
=
"获取剩余红包金额"
,
priority
=
1
2
)
@Test
(
description
=
"获取剩余红包金额"
,
priority
=
1
4
)
public
void
获取剩余红包金额
()
{
public
void
获取剩余红包金额
()
{
Map
<
String
,
Object
>
getSurplusAmountParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
getSurplusAmountParam
=
new
HashMap
<>();
getSurplusAmountParam
.
put
(
"liveId"
,
liveID
);
getSurplusAmountParam
.
put
(
"liveId"
,
liveID
);
...
@@ -247,7 +309,7 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -247,7 +309,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
}
//添加红包配置
//添加红包配置
@Test
(
description
=
"新增红包配置"
,
priority
=
1
3
)
@Test
(
description
=
"新增红包配置"
,
priority
=
1
5
)
public
void
新增红包配置
()
{
public
void
新增红包配置
()
{
Map
<
String
,
Object
>
saveOrUpdateRedParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveOrUpdateRedParam
=
new
HashMap
<>();
saveOrUpdateRedParam
.
put
(
"liveId"
,
liveID
);
saveOrUpdateRedParam
.
put
(
"liveId"
,
liveID
);
...
@@ -265,7 +327,7 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -265,7 +327,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
}
//答题红包配置
//答题红包配置
@Test
(
description
=
"新增答题红包"
,
priority
=
1
4
)
@Test
(
description
=
"新增答题红包"
,
priority
=
1
6
)
public
void
新增答题红包
()
{
public
void
新增答题红包
()
{
Map
<
String
,
Object
>
saveOrUpdate9Param
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveOrUpdate9Param
=
new
HashMap
<>();
saveOrUpdate9Param
.
put
(
"liveId"
,
liveID
);
saveOrUpdate9Param
.
put
(
"liveId"
,
liveID
);
...
@@ -297,7 +359,7 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -297,7 +359,7 @@ public class SaveAndUpdate implements AdminAuthorization {
}
}
//直播前奖品配置
//直播前奖品配置
@Test
(
description
=
"直播前抽奖"
,
priority
=
1
5
)
@Test
(
description
=
"直播前抽奖"
,
priority
=
1
7
)
public
void
直播前抽奖
()
{
public
void
直播前抽奖
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
addParam
.
put
(
"liveId"
,
liveID
);
addParam
.
put
(
"liveId"
,
liveID
);
...
@@ -313,63 +375,9 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -313,63 +375,9 @@ public class SaveAndUpdate implements AdminAuthorization {
}
}
//直播中奖品配置
@Test
(
description
=
"直播中抽奖"
,
priority
=
16
)
public
void
直播中抽奖
()
{
Map
<
String
,
Object
>
add1Param
=
new
HashMap
<>();
add1Param
.
put
(
"liveId"
,
liveID
);
add1Param
.
put
(
"interactNum"
,
100
);
add1Param
.
put
(
"showInteractNum"
,
100
);
add1Param
.
put
(
"welfareId"
,
191
);
add1Param
.
put
(
"afterMin"
,
20
);
Response
add1Res
=
network
.
postResponse
(
add1Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data
=
add1Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
add1Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add1Res
.
body
().
asString
()));
Map
<
String
,
Object
>
add2Param
=
new
HashMap
<>();
add2Param
.
put
(
"liveId"
,
liveID
);
add2Param
.
put
(
"interactNum"
,
100
);
add2Param
.
put
(
"showInteractNum"
,
100
);
add2Param
.
put
(
"welfareId"
,
192
);
add2Param
.
put
(
"afterMin"
,
30
);
Response
add2Res
=
network
.
postResponse
(
add2Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data1
=
add2Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertNotNull
(
data1
,
network
.
message
(
add2Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add2Res
.
body
().
asString
()));
Map
<
String
,
Object
>
add3Param
=
new
HashMap
<>();
add3Param
.
put
(
"liveId"
,
liveID
);
add3Param
.
put
(
"interactNum"
,
100
);
add3Param
.
put
(
"showInteractNum"
,
100
);
add3Param
.
put
(
"welfareId"
,
193
);
add3Param
.
put
(
"afterMin"
,
35
);
Response
add3Res
=
network
.
postResponse
(
add3Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data2
=
add3Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data2
);
Assert
.
assertNotNull
(
data2
,
network
.
message
(
add3Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add3Res
.
body
().
asString
()));
Map
<
String
,
Object
>
add4Param
=
new
HashMap
<>();
add4Param
.
put
(
"liveId"
,
liveID
);
add4Param
.
put
(
"interactNum"
,
100
);
add4Param
.
put
(
"showInteractNum"
,
100
);
add4Param
.
put
(
"welfareId"
,
194
);
add4Param
.
put
(
"afterMin"
,
40
);
Response
add4Res
=
network
.
postResponse
(
add4Param
,
BasicConfig
.
MANAGER_ADD1
);
Object
data3
=
add4Res
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data3
);
Assert
.
assertNotNull
(
data3
,
network
.
message
(
add4Param
,
BasicConfig
.
MANAGER_ADD1
,
"直播中抽奖配置失败"
,
add4Res
.
body
().
asString
()));
}
//配置免费福利
//配置免费福利
@Test
(
description
=
"配置免费福利"
,
priority
=
1
7
)
@Test
(
description
=
"配置免费福利"
,
priority
=
1
8
)
public
void
配置免费福利
()
{
public
void
配置免费福利
()
{
Map
<
String
,
Object
>
saveOrUpdate8Param
=
new
HashMap
<>();
Map
<
String
,
Object
>
saveOrUpdate8Param
=
new
HashMap
<>();
saveOrUpdate8Param
.
put
(
"liveId"
,
liveID
);
saveOrUpdate8Param
.
put
(
"liveId"
,
liveID
);
...
...
src/test/java/com/kjj/cases/live/User.java
View file @
fa19d1a8
...
@@ -34,16 +34,15 @@ public class User implements AdminAuthorization{
...
@@ -34,16 +34,15 @@ public class User implements AdminAuthorization{
}
}
//访客与代理人建立绑定关系
@Test
(
description
=
"邀请关系绑定"
,
priority
=
2
)
@Test
(
description
=
"邀请关系绑定"
,
priority
=
2
)
public
void
邀请关系绑定
()
{
public
void
邀请关系绑定
()
{
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareType"
,
shareSign
);
bindingParam
.
put
(
"shareType"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_
BINDING
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_
binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_
BINDING
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_
binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
...
@@ -93,10 +92,10 @@ public class User implements AdminAuthorization{
...
@@ -93,10 +92,10 @@ public class User implements AdminAuthorization{
public
void
保存海报获得抽奖码
()
{
public
void
保存海报获得抽奖码
()
{
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
savePosterRes
=
network
.
postResponse
(
savePosterParam
,
BasicConfig
.
USER_
SAVEPOSTER
);
Response
savePosterRes
=
network
.
postResponse
(
savePosterParam
,
BasicConfig
.
USER_
savePoster
);
boolean
data
=
savePosterRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
savePosterRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
savePosterParam
,
BasicConfig
.
USER_
SAVEPOSTER
,
"海报保存失败"
,
savePosterRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
savePosterParam
,
BasicConfig
.
USER_
savePoster
,
"海报保存失败"
,
savePosterRes
.
body
().
asString
()));
}
}
...
@@ -104,10 +103,10 @@ public class User implements AdminAuthorization{
...
@@ -104,10 +103,10 @@ public class User implements AdminAuthorization{
public
void
我的抽奖码数量
()
{
public
void
我的抽奖码数量
()
{
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_
MYCOUNT
);
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_
myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_
MYCOUNT
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_
myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
fa19d1a8
...
@@ -48,8 +48,8 @@ public class BasicConfig {
...
@@ -48,8 +48,8 @@ public class BasicConfig {
public
static
final
String
USER_START
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/start"
;
public
static
final
String
USER_START
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/start"
;
public
static
final
String
USER_DRAW
=
MOBILE_HOST
+
"/kjy/live/user/lottery/draw"
;
public
static
final
String
USER_DRAW
=
MOBILE_HOST
+
"/kjy/live/user/lottery/draw"
;
public
static
final
String
USER_END
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/end"
;
public
static
final
String
USER_END
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/end"
;
public
static
final
String
USER_
SAVEPOSTER
=
MOBILE_HOST
+
"/kjy/live/user/share/savePoster"
;
public
static
final
String
USER_
savePoster
=
MOBILE_HOST
+
"/kjy/live/user/share/savePoster"
;
public
static
final
String
USER_
MYCOUNT
=
MOBILE_HOST
+
"/kjy/live/user/lottery/myCount"
;
public
static
final
String
USER_
myCount
=
MOBILE_HOST
+
"/kjy/live/user/lottery/myCount"
;
// *************** 直播管理端 ***************
// *************** 直播管理端 ***************
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
...
@@ -69,6 +69,7 @@ public class BasicConfig {
...
@@ -69,6 +69,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_ADD
=
MANAGER_HOST
+
"/kjy/manager/lottery/pre/conf/add"
;
public
static
final
String
MANAGER_ADD
=
MANAGER_HOST
+
"/kjy/manager/lottery/pre/conf/add"
;
public
static
final
String
MANAGER_ADD1
=
MANAGER_HOST
+
"/kjy/manager/lottery/conf/add"
;
public
static
final
String
MANAGER_ADD1
=
MANAGER_HOST
+
"/kjy/manager/lottery/conf/add"
;
public
static
final
String
MANAGER_SAVEORUPDATE7
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_SAVEORUPDATE7
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_getLiveAwardList
=
MANAGER_HOST
+
"/kjy/manager/specifyAward/pre/conf/getLiveAwardList"
;
// *************** 代理人 ***************
// *************** 代理人 ***************
...
@@ -85,7 +86,8 @@ public class BasicConfig {
...
@@ -85,7 +86,8 @@ public class BasicConfig {
public
static
final
String
MOBILE_ClueList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/list"
;
public
static
final
String
MOBILE_ClueList
=
MOBILE_HOST
+
"/kjy/live/agent/clue/list"
;
public
static
final
String
MOBILE_AGENTSPECIFYAWARDSUBMIN
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardSubmit"
;
public
static
final
String
MOBILE_AGENTSPECIFYAWARDSUBMIN
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardSubmit"
;
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
public
static
final
String
MOBILE_BINDING
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_binding
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_AgentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
//***************直播素材*****************
//***************直播素材*****************
public
static
final
String
MANAGER_SAVEORUPDATE6
=
MANAGER_HOST
+
"/kjy/manager/conf/base/welfare/saveOrUpdate"
;
public
static
final
String
MANAGER_SAVEORUPDATE6
=
MANAGER_HOST
+
"/kjy/manager/conf/base/welfare/saveOrUpdate"
;
...
...
src/test/liveTestNG.xml
View file @
fa19d1a8
...
@@ -26,9 +26,9 @@
...
@@ -26,9 +26,9 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"
助播-开启直播
"
>
<test
preserve-order=
"true"
name=
"
指定中奖
"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.
OpenLive
"
/>
<class
name=
"com.kjj.cases.live.
DesignatedWinner
"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"获取代理人排行榜及客户信息"
>
<test
preserve-order=
"true"
name=
"获取代理人排行榜及客户信息"
>
...
@@ -36,6 +36,12 @@
...
@@ -36,6 +36,12 @@
<class
name=
"com.kjj.cases.live.LiveAgent"
/>
<class
name=
"com.kjj.cases.live.LiveAgent"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.CloseLive"
/>
<class
name=
"com.kjj.cases.live.CloseLive"
/>
...
...
src/test/testNG.xml
View file @
fa19d1a8
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<suite-files>
<suite-files>
<suite-file
path=
"liveTestNG.xml"
></suite-file>
<suite-file
path=
"liveTestNG.xml"
></suite-file>
<!-- <suite-file path="wechatTestNG.xml"></suite-file>--
>
<suite-file
path=
"wechatTestNG.xml"
></suite-file
>
</suite-files>
</suite-files>
<!-- 监听器-->
<!-- 监听器-->
...
...
test-output/report.html
View file @
fa19d1a8
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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