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
5051cc72
Commit
5051cc72
authored
May 21, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增裂变宝箱配置
parent
6e08856a
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1502 additions
and
440 deletions
+1502
-440
LotteryCode.java
...test/java/com/kjj/cases/live/LotteryCode/LotteryCode.java
+326
-0
SignIn.java
src/test/java/com/kjj/cases/live/LotteryCode/SignIn.java
+1
-1
AdminAuthorization.java
...est/java/com/kjj/cases/live/admin/AdminAuthorization.java
+71
-7
Lottery.java
src/test/java/com/kjj/cases/live/lottery/Lottery.java
+1
-1
Treasure.java
src/test/java/com/kjj/cases/live/manager/Treasure.java
+0
-111
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+1083
-0
User.java
src/test/java/com/kjj/cases/live/user/User.java
+0
-297
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+1
-1
liveTestNG.xml
src/test/liveTestNG.xml
+19
-22
No files found.
src/test/java/com/kjj/cases/live/
agent/Agent
.java
→
src/test/java/com/kjj/cases/live/
LotteryCode/LotteryCode
.java
View file @
5051cc72
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/
user
/SignIn.java
→
src/test/java/com/kjj/cases/live/
LotteryCode
/SignIn.java
View file @
5051cc72
package
com
.
kjj
.
cases
.
live
.
user
;
package
com
.
kjj
.
cases
.
live
.
LotteryCode
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
...
...
src/test/java/com/kjj/cases/live/admin/AdminAuthorization.java
View file @
5051cc72
...
...
@@ -4,7 +4,7 @@ import static com.kjj.config.BasicConfig.*;
/**
* 管理员授权
* @author
嘿保险
,ID:907
* @author
吉吉
,ID:907
*/
public
interface
AdminAuthorization
{
...
...
@@ -26,7 +26,7 @@ public interface AdminAuthorization {
}
/**
* 代理人(小疙瘩人寿)授权,ID:
81
5
* 代理人(小疙瘩人寿)授权,ID:
99
5
*/
default
void
agentAuth1
(){
// 创建用户 并传到network里
...
...
@@ -51,7 +51,7 @@ public interface AdminAuthorization {
}
/**
* 访客C(刘超)授权,
用户,
用户ID:811
* 访客C(刘超)授权,
地域指定
用户ID:811
*/
default
void
visitorAuth3
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY3
);
...
...
@@ -59,7 +59,7 @@ public interface AdminAuthorization {
}
/**
* 访客D(李执)授权,用户ID:89
* 访客D(李执)授权,
地域指定
用户ID:89
*/
default
void
visitorAuth4
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY4
);
...
...
@@ -74,7 +74,7 @@ public interface AdminAuthorization {
}
/**
* 访客F(新强)授权,
区域指定中奖用户,
ID:82
* 访客F(新强)授权,
用户
ID:82
*/
default
void
visitorAuth6
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY6
);
...
...
@@ -97,7 +97,7 @@ public interface AdminAuthorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY8
);
}
/**
* 访客H(
嘿保险)
授权,ID:907
* 访客H(
吉吉)非实名用户
授权,ID:907
*/
default
void
visitorAuth9
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY9
);
...
...
@@ -105,13 +105,77 @@ public interface AdminAuthorization {
}
/**
* 访客
H
(日落)授权,ID:703
* 访客
J
(日落)授权,ID:703
*/
default
void
visitorAuth10
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY10
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY10
);
}
/**
* 访客K(沈小四)授权,ID:108
*/
default
void
visitorAuth11
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY11
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY11
);
}
/**
* 访客L(饺子)授权,ID:97
*/
default
void
visitorAuth12
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY12
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY12
);
}
/**
* 访客M(大妹子保险)非实名用户授权,ID:102
*/
default
void
visitorAuth13
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY13
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY13
);
}
/**
* 访客N(光头强)非实名用户授权,ID:173
*/
default
void
visitorAuth14
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY14
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY14
);
}
/**
* 访客O(少侠)授权,ID:79
*/
default
void
visitorAuth15
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY15
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY15
);
}
/**
* 访客P(抬头有飞碟)授权,ID:99
*/
default
void
visitorAuth16
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY16
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY16
);
}
/**
* 访客Q(枫城)授权,ID:77
*/
default
void
visitorAuth17
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY17
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY17
);
}
/**
* 访客R(小老弟来了)非实名用户授权,ID:94
*/
default
void
visitorAuth18
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY18
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY18
);
}
}
src/test/java/com/kjj/cases/live/lottery/Lottery.java
View file @
5051cc72
...
...
@@ -1351,7 +1351,7 @@ public class Lottery implements AdminAuthorization {
}
//团队分配
制
定中奖
//团队分配
指
定中奖
@Test
(
description
=
"普通抽奖轮次访客是否中奖"
,
priority
=
95
)
public
void
普通抽奖轮次访客是否中奖
()
{
ThreadSleepUtils
.
sleep
(
3000
);
...
...
src/test/java/com/kjj/cases/live/manager/Treasure.java
deleted
100644 → 0
View file @
6e08856a
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.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Treasure
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
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
()));
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
=
"新增宝箱裂变配置"
,
priority
=
2
)
public
void
新增宝箱裂变配置
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"openCondition"
,
1
);
saveParam
.
put
(
"openNum"
,
1
);
TreasureAward
treasureAward
=
new
TreasureAward
();
treasureAward
.
setWelfareId
(
this
.
id
.
get
(
0
).
getId
());
treasureAward
.
setAwardName
(
"宝箱锦鲤"
);
treasureAward
.
setTreasureProbability
(
2000
);
treasureAward
.
setTreasureType
(
3
);
treasureAward
.
setRuleType
(
1
);
treasureAward
.
setTotalNum
(
10
);
treasureAward
.
setWinLimitCount
(-
1
);
saveParam
.
put
(
"treasureAward"
,
treasureAward
);
TreasureRed
treasureRed
=
new
TreasureRed
();
treasureRed
.
setRedTotalAmount
(
100
);
treasureRed
.
setRuleType
(
2
);
treasureRed
.
setTotalNum
(
3
);
treasureRed
.
setTreasureProbability
(
4000
);
treasureRed
.
setTreasureType
(
2
);
treasureRed
.
setWinLimitCount
(
1
);
treasureRed
.
setShowAmount
(
200
);
saveParam
.
put
(
"treasureRed"
,
treasureRed
);
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
3
);
treasureCode
.
setRuleType
(
2
);
treasureCode
.
setTreasureProbability
(
4000
);
treasureCode
.
setTreasureType
(
1
);
saveParam
.
put
(
"treasureCode"
,
treasureCode
);
saveParam
.
put
(
"treasurePeriod"
,
3
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveTreasureConf
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MANAGER_saveTreasureConf
,
"新增宝箱裂变配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询宝箱配置详情"
,
priority
=
3
)
public
void
查询宝箱配置详情
()
{
Map
<
String
,
Object
>
confDetailParam
=
new
HashMap
<>();
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
confDetailParam
,
BasicConfig
.
MANAGER_confDetail
);
System
.
out
.
println
(
response
);
Integer
openCondition
=
response
.
jsonPath
().
getInt
(
"data.openCondition"
);
System
.
out
.
println
(
openCondition
);
Assert
.
assertTrue
(
openCondition
>
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_confDetail
,
"查询宝箱配置详情失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启宝箱"
,
priority
=
4
)
public
void
开启宝箱
()
{
Map
<
String
,
Object
>
switchStatusParam
=
new
HashMap
<>();
switchStatusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
switchStatusParam
.
put
(
"confStatus"
,
1
);
Response
response
=
network
.
postResponse
(
switchStatusParam
,
BasicConfig
.
MANAGER_switchStatus
);
boolean
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
switchStatusParam
,
BasicConfig
.
MANAGER_switchStatus
,
"开启宝箱失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/treasure/Treasure.java
0 → 100644
View file @
5051cc72
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/user/User.java
deleted
100644 → 0
View file @
6e08856a
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
5051cc72
...
...
@@ -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
// 代理人的openid(固定)
...
...
src/test/liveTestNG.xml
View file @
5051cc72
...
...
@@ -19,12 +19,19 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱裂变配置
"
>
<test
preserve-order=
"true"
name=
"获取抽奖码校验
"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.Treasur
e"
/>
<class
name=
"com.kjj.cases.live.LotteryCode.LotteryCod
e"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱裂变"
>
<classes>
<class
name=
"com.kjj.cases.live.treasure.Treasure"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱时长"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.TreasureTime"
/>
...
...
@@ -75,17 +82,6 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人分享直播间"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.Agent"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客券码领取"
>
<classes>
<class
name=
"com.kjj.cases.live.user.User"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"指定中奖"
>
<classes>
...
...
@@ -108,7 +104,7 @@
<test
preserve-order=
"true"
name=
"访客签到"
>
<classes>
<class
name=
"com.kjj.cases.live.user
.SignIn"
/>
<class
name=
"com.kjj.cases.live.LotteryCode
.SignIn"
/>
</classes>
</test>
...
...
@@ -168,6 +164,7 @@
<class
name=
"com.kjj.cases.live.question.Question"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
<class
name=
"com.kjj.cases.live.anchor.CloseLive"
/>
...
...
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