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
40dde93e
Commit
40dde93e
authored
May 08, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增宝箱裂变配置
parent
97b56566
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
13546 additions
and
5231 deletions
+13546
-5231
ProvinceCityCodeList.java
src/test/java/com/kjj/bean/manager/ProvinceCityCodeList.java
+12
-0
TreasureCode.java
src/test/java/com/kjj/bean/manager/TreasureCode.java
+1
-0
TreasureList.java
src/test/java/com/kjj/bean/manager/TreasureList.java
+9
-0
Agent.java
src/test/java/com/kjj/cases/live/agent/Agent.java
+2
-4
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+17
-15
TreasureTime.java
src/test/java/com/kjj/cases/live/lottery/TreasureTime.java
+9
-0
LotteryRule.java
src/test/java/com/kjj/cases/live/manager/LotteryRule.java
+6
-18
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/manager/SaveAndUpdate.java
+20
-2
Treasure.java
src/test/java/com/kjj/cases/live/manager/Treasure.java
+0
-2
TreasureTime.java
src/test/java/com/kjj/cases/live/manager/TreasureTime.java
+199
-0
User.java
src/test/java/com/kjj/cases/live/user/User.java
+6
-6
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+5
-0
liveTestNG.xml
src/test/liveTestNG.xml
+7
-0
report.html
test-output/report.html
+13253
-5184
No files found.
src/test/java/com/kjj/bean/manager/ProvinceCityCodeList.java
0 → 100644
View file @
40dde93e
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
ProvinceCityCodeList
{
private
Integer
provinceCode
;
private
Integer
cityCode
;
}
src/test/java/com/kjj/bean/manager/TreasureCode.java
View file @
40dde93e
...
...
@@ -12,4 +12,5 @@ public class TreasureCode {
private
Integer
maxNum
;
private
Integer
treasureProbability
;
}
src/test/java/com/kjj/bean/manager/TreasureList.java
0 → 100644
View file @
40dde93e
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
TreasureList
{
private
long
treasureConfId
;
private
Integer
treasureSort
;
}
src/test/java/com/kjj/cases/live/agent/Agent.java
View file @
40dde93e
...
...
@@ -69,8 +69,7 @@ public class Agent implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
...
...
@@ -110,8 +109,7 @@ public class Agent implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
40dde93e
...
...
@@ -317,6 +317,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"中奖任务邀请C绑定结果和绑定凭证"
,
priority
=
22
)
public
void
获取访客
C
绑定结果和绑定凭证
()
{
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -324,15 +325,14 @@ public class Lottery implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"中奖任务邀请C根据绑定凭证发放抽奖码"
,
priority
=
23
)
public
void
中奖任务邀请
C
根据绑定凭证发放抽奖码
()
{
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
5
00
);
ThreadSleepUtils
.
sleep
(
20
00
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
@@ -380,7 +380,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"访客C抽奖码数量"
,
priority
=
27
)
public
void
访客
C
抽奖码数量
()
{
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
5
00
);
ThreadSleepUtils
.
sleep
(
10
00
);
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
...
...
@@ -487,6 +487,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"幸运任务邀请D绑定结果和绑定凭证"
,
priority
=
34
)
public
void
幸运任务邀请
D
绑定结果和绑定凭证
()
{
visitorAuth4
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -494,14 +495,14 @@ public class Lottery implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请D根据绑定凭证发放抽奖码"
,
priority
=
35
)
public
void
幸运任务邀请
D
根据绑定凭证发放抽奖码
()
{
visitorAuth4
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
@@ -562,6 +563,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"幸运任务邀请E绑定结果和绑定凭证"
,
priority
=
40
)
public
void
幸运任务邀请
E
绑定结果和绑定凭证
()
{
visitorAuth5
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -569,14 +571,14 @@ public class Lottery implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请E根据绑定凭证发放抽奖码"
,
priority
=
41
)
public
void
幸运任务邀请
E
根据绑定凭证发放抽奖码
()
{
visitorAuth5
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
@@ -637,6 +639,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"幸运任务邀请F绑定结果和绑定凭证"
,
priority
=
46
)
public
void
幸运任务邀请
F
绑定结果和绑定凭证
()
{
visitorAuth6
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -644,15 +647,14 @@ public class Lottery implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请F根据绑定凭证发放抽奖码"
,
priority
=
47
)
public
void
幸运任务邀请
F
根据绑定凭证发放抽奖码
()
{
visitorAuth6
();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
5
00
);
ThreadSleepUtils
.
sleep
(
20
00
);
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
...
...
@@ -713,6 +715,7 @@ public class Lottery implements AdminAuthorization {
@Test
(
description
=
"幸运任务邀请G绑定结果和绑定凭证"
,
priority
=
52
)
public
void
幸运任务邀请
G
绑定结果和绑定凭证
()
{
visitorAuth7
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -720,15 +723,14 @@ public class Lottery implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"幸运任务邀请G根据绑定凭证发放抽奖码"
,
priority
=
53
)
public
void
幸运任务邀请
G
根据绑定凭证发放抽奖码
()
{
visitorAuth7
();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
ThreadSleepUtils
.
sleep
(
5
00
);
ThreadSleepUtils
.
sleep
(
20
00
);
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
...
...
@@ -941,7 +943,7 @@ public class Lottery implements AdminAuthorization {
Response
hasEndRes
=
network
.
getResponse
(
hasEndParam
,
BasicConfig
.
USER_result
);
try
{
Boolean
data
=
hasEndRes
.
jsonPath
().
getBoolean
(
"data.lottery"
);
Assert
.
assert
True
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"厦门访客F未中奖
"
,
hasEndRes
.
body
().
asString
()));
Assert
.
assert
False
(
data
,
network
.
message
(
hasEndParam
,
BasicConfig
.
USER_result
,
"厦门访客中奖异常
"
,
hasEndRes
.
body
().
asString
()));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"result = "
+
JSON
.
toJSONString
(
hasEndRes
.
jsonPath
().
get
()));
throw
e
;
...
...
src/test/java/com/kjj/cases/live/lottery/TreasureTime.java
0 → 100644
View file @
40dde93e
package
com
.
kjj
.
cases
.
live
.
lottery
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
public
class
TreasureTime
implements
AdminAuthorization
{
}
src/test/java/com/kjj/cases/live/manager/LotteryRule.java
View file @
40dde93e
...
...
@@ -96,33 +96,21 @@ public class LotteryRule implements AdminAuthorization {
RuleBean
save
=
new
RuleBean
();
save
.
setProvinceCode
(
110000
);
save
.
setCityCode
(
null
);
save
.
setTotalNum
(
4
0
);
save
.
setTotalNum
(
5
0
);
Rule
.
add
(
save
);
RuleBean
save1
=
new
RuleBean
();
save1
.
setProvinceCode
(
35
0000
);
save1
.
setProvinceCode
(
42
0000
);
save1
.
setCityCode
(
null
);
save1
.
setTotalNum
(
4
0
);
save1
.
setTotalNum
(
5
0
);
Rule
.
add
(
save1
);
RuleBean
save2
=
new
RuleBean
();
save2
.
setProvinceCode
(
35
0000
);
save2
.
setCityCode
(
3502
00
);
save2
.
setTotalNum
(
4
0
);
save2
.
setProvinceCode
(
42
0000
);
save2
.
setCityCode
(
4209
00
);
save2
.
setTotalNum
(
5
0
);
Rule
.
add
(
save2
);
RuleBean
save3
=
new
RuleBean
();
save3
.
setProvinceCode
(
420000
);
save3
.
setCityCode
(
null
);
save3
.
setTotalNum
(
20
);
Rule
.
add
(
save3
);
RuleBean
save4
=
new
RuleBean
();
save4
.
setProvinceCode
(
420000
);
save4
.
setCityCode
(
420900
);
save4
.
setTotalNum
(
20
);
Rule
.
add
(
save4
);
saveParam
.
put
(
"list"
,
Rule
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_save
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/cases/live/manager/SaveAndUpdate.java
View file @
40dde93e
...
...
@@ -2,6 +2,7 @@ package com.kjj.cases.live.manager;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.manager.AnswerBean
;
import
com.kjj.bean.manager.AnswerListBean
;
import
com.kjj.bean.manager.ProvinceCityCodeList
;
import
com.kjj.bean.manager.RewardPkBean
;
import
com.kjj.bean.answer.*
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
...
...
@@ -44,9 +45,26 @@ public class SaveAndUpdate implements AdminAuthorization {
saveAndUpdateParam
.
put
(
"noticeTime"
,
noticeTime
);
saveAndUpdateParam
.
put
(
"broadcastTime"
,
broadcastTime
);
saveAndUpdateParam
.
put
(
"shareContent"
,
"自动化直播"
);
saveAndUpdateParam
.
put
(
"shelfStatus"
,
"2"
);
saveAndUpdateParam
.
put
(
"shelfStatus"
,
2
);
saveAndUpdateParam
.
put
(
"secondPoster"
,
"https://streamimg.kjjcrm.com/kjy/image/20210201/cc999ebde48e49f99ac3f0d93480453f.jpg"
);
saveAndUpdateParam
.
put
(
"regionType"
,
2
);
List
<
ProvinceCityCodeList
>
provinceCityCode
=
new
ArrayList
<>();
ProvinceCityCodeList
save
=
new
ProvinceCityCodeList
();
save
.
setProvinceCode
(
110000
);
save
.
setCityCode
(
null
);
provinceCityCode
.
add
(
save
);
ProvinceCityCodeList
save1
=
new
ProvinceCityCodeList
();
save1
.
setProvinceCode
(
420000
);
save1
.
setCityCode
(
420900
);
provinceCityCode
.
add
(
save1
);
ProvinceCityCodeList
save2
=
new
ProvinceCityCodeList
();
save2
.
setProvinceCode
(
330000
);
save2
.
setCityCode
(
330100
);
provinceCityCode
.
add
(
save2
);
saveAndUpdateParam
.
put
(
"provinceCityCodeList"
,
provinceCityCode
);
Response
response
=
network
.
postResponse
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
);
liveID
=
response
.
jsonPath
().
getString
(
"data"
);
EncodeLiveID
=
IdMakeUtil
.
encodingId
(
Long
.
valueOf
(
liveID
));
...
...
src/test/java/com/kjj/cases/live/manager/Treasure.java
View file @
40dde93e
...
...
@@ -28,9 +28,7 @@ public class Treasure implements AdminAuthorization {
public
void
查询奖品列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
// getListParam.put("liveId",2122 );
getListParam
.
put
(
"companyId"
,
101
);
// getListParam.put("companyId", 79);
getListParam
.
put
(
"pageIndex"
,
1
);
getListParam
.
put
(
"pageSize"
,
20
);
getListParam
.
put
(
"welfareType"
,
6
);
...
...
src/test/java/com/kjj/cases/live/manager/TreasureTime.java
0 → 100644
View file @
40dde93e
package
com
.
kjj
.
cases
.
live
.
manager
;
import
com.kjj.bean.manager.*
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
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.List
;
import
java.util.Map
;
public
class
TreasureTime
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
public
List
<
TreasureList
>
ConfId
;
public
List
<
WelfareList
>
id
;
@Test
(
description
=
"获取直播中停留时长宝箱列表"
,
priority
=
1
)
public
void
获取直播中停留时长宝箱列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_list1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
TreasureList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
TreasureList
.
class
);
System
.
out
.
println
(
list
);
this
.
ConfId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_list1
,
"获取直播中停留时长宝箱列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"停留时长1分钟固定抽奖码"
,
priority
=
2
)
public
void
停留时长
1
分钟固定抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
1
);
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
null
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第一轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取第一轮宝箱配置详情"
,
priority
=
3
)
public
void
获取第一轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第一轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"停留时长2分钟随机抽奖码"
,
priority
=
4
)
public
void
停留时长
2
分钟随机抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
2
);
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
3
);
treasureCode
.
setRuleType
(
2
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第二轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取第二轮宝箱配置详情"
,
priority
=
5
)
public
void
获取第二轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第二轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"停留时长3分钟随机抽奖码"
,
priority
=
6
)
public
void
停留时长
3
分钟随机抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
3
);
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
6
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureRed
treasureRed
=
new
TreasureRed
();
treasureRed
.
setRedTotalAmount
(
100
);
treasureRed
.
setRuleType
(
1
);
treasureRed
.
setTotalNum
(
3
);
treasureRed
.
setFixedNum
(
30
);
updateParam
.
put
(
"treasureRed"
,
treasureRed
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第三轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取第三轮宝箱配置详情"
,
priority
=
7
)
public
void
获取第三轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第三轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询奖品列表"
,
priority
=
8
)
public
void
查询奖品列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
getListParam
.
put
(
"companyId"
,
101
);
getListParam
.
put
(
"pageIndex"
,
1
);
getListParam
.
put
(
"pageSize"
,
20
);
getListParam
.
put
(
"welfareType"
,
6
);
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
,
"查询奖品列表失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"停留时长4分钟随机抽奖码"
,
priority
=
9
)
public
void
停留时长
4
分钟随机抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
3
);
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
6
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureAward
treasureAward
=
new
TreasureAward
();
treasureAward
.
setWelfareId
(
this
.
id
.
get
(
9
).
getId
());
treasureAward
.
setTotalNum
(-
1
);
updateParam
.
put
(
"treasureAward"
,
treasureAward
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第四轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取第四轮宝箱配置详情"
,
priority
=
10
)
public
void
获取第四轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第四轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/user/User.java
View file @
40dde93e
...
...
@@ -33,6 +33,7 @@ public class User implements AdminAuthorization {
@Test
(
description
=
"获取绑定结果和绑定凭证"
,
priority
=
2
)
public
void
获取绑定结果和绑定凭证
()
{
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -40,14 +41,13 @@ public class User implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"根据绑定凭证发放抽奖码"
,
priority
=
3
)
public
void
根据绑定凭证发放抽奖码
()
{
ThreadSleepUtils
.
sleep
(
5
00
);
ThreadSleepUtils
.
sleep
(
20
00
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
@@ -168,6 +168,7 @@ public class User implements AdminAuthorization {
@Test
(
description
=
"访客获取绑定结果和绑定凭证"
,
priority
=
12
)
public
void
访客获取绑定结果和绑定凭证
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
2000
);
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
...
...
@@ -175,14 +176,13 @@ public class User implements AdminAuthorization {
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
this
.
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客根据绑定凭证发放抽奖码"
,
priority
=
13
)
public
void
访客根据绑定凭证发放抽奖码
()
{
visitorAuth2
();
ThreadSleepUtils
.
sleep
(
5
00
);
ThreadSleepUtils
.
sleep
(
20
00
);
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
40dde93e
...
...
@@ -72,6 +72,11 @@ public class BasicConfig {
public
static
final
String
MANAGER_confDetail
=
MANAGER_HOST
+
"/kjy/manager/live/treasure/confDetail"
;
public
static
final
String
MANAGER_switchStatus
=
MANAGER_HOST
+
"/kjy/manager/live/treasure/switchStatus"
;
// *************** 宝箱停留时长 ***************
public
static
final
String
MANAGER_list1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/list"
;
public
static
final
String
MANAGER_detail1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/detail"
;
public
static
final
String
MANAGER_update1
=
MANAGER_HOST
+
"/kjy/manager/treasure/time/conf/update"
;
// *************** 代理人指定中奖 ***************
public
static
final
String
MOBILE_getSpecifyAwardConf
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getSpecifyAwardConf"
;
...
...
src/test/liveTestNG.xml
View file @
40dde93e
...
...
@@ -25,6 +25,13 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱时长"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.TreasureTime"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.Add"
/>
...
...
test-output/report.html
View file @
40dde93e
This diff is collapsed.
Click to expand it.
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