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
13fe04ee
Commit
13fe04ee
authored
Apr 26, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
奖品签收
parent
d32099d9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
286 additions
and
3 deletions
+286
-3
QuesReward.java
src/test/java/com/kjj/bean/manager/QuesReward.java
+9
-0
TeamAssignmentList.java
src/test/java/com/kjj/bean/manager/TeamAssignmentList.java
+18
-0
TeamAssignment.java
...com/kjj/cases/live/manager/QuesReward/TeamAssignment.java
+134
-0
Unlimited.java
...java/com/kjj/cases/live/manager/QuesReward/Unlimited.java
+54
-0
limited.java
...t/java/com/kjj/cases/live/manager/QuesReward/limited.java
+51
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+6
-1
liveTestNG.xml
src/test/liveTestNG.xml
+14
-2
No files found.
src/test/java/com/kjj/bean/manager/QuesReward.java
0 → 100644
View file @
13fe04ee
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
QuesReward
{
private
long
id
;
}
src/test/java/com/kjj/bean/manager/TeamAssignmentList.java
0 → 100644
View file @
13fe04ee
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
TeamAssignmentList
{
private
List
<
TeamAssignmentList
.
team_List
>
list
;
@Data
public
static
class
team_List
{
private
long
id
;
}
}
src/test/java/com/kjj/cases/live/manager/QuesReward/TeamAssignment.java
0 → 100644
View file @
13fe04ee
package
com
.
kjj
.
cases
.
live
.
manager
.
QuesReward
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.lottery.ConfidList
;
import
com.kjj.bean.manager.QuesReward
;
import
com.kjj.bean.manager.TeamAssignmentList
;
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.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
TeamAssignment
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
public
List
<
QuesReward
>
ListConfid
;
public
List
<
TeamAssignmentList
.
team_List
>
teamID
;
@Test
(
description
=
"获取有奖答题列表信息"
,
priority
=
1
)
public
void
获取有奖答题列表信息
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
// getConfParam.put("liveId", 2960);
Response
response
=
network
.
getResponse
(
getConfParam
,
BasicConfig
.
MANAGER_reward
);
List
<
QuesReward
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
QuesReward
.
class
);
System
.
out
.
println
(
list
);
this
.
ListConfid
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_reward
,
"获取有奖答题列表信息失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取答题按团队分配的团队列表"
,
priority
=
2
)
public
void
获取答题按团队分配的团队列表
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
,
"获取有奖答题列表信息失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加团队"
,
priority
=
3
)
public
void
添加团队
()
{
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
addTeamParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addTeamParam
.
put
(
"teamIds"
,
Arrays
.
asList
(
3837
,
3324
,
3817
));
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
);
Object
failSize
=
response
.
jsonPath
().
getJsonObject
(
"data.failSize"
);
System
.
out
.
println
(
failSize
);
Assert
.
assertEquals
(
failSize
,
0
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
,
"添加团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取答题已分配的团队列表"
,
priority
=
4
)
public
void
获取答题已分配的团队列表
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
);
List
<
TeamAssignmentList
.
team_List
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.list"
)),
TeamAssignmentList
.
team_List
.
class
);
System
.
out
.
println
(
list
);
this
.
teamID
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
,
"获取有奖答题列表信息失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"单个团队删除"
,
priority
=
5
)
public
void
单个团队删除
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
TeamParam
.
put
(
"id"
,
this
.
teamID
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
TeamParam
,
BasicConfig
.
MANAGER_delTeam
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
TeamParam
,
BasicConfig
.
MANAGER_delTeam
,
"单个团队删除"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"一键清空团队"
,
priority
=
6
)
public
void
一键清空团队
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
Response
response
=
network
.
postResponse
(
TeamParam
,
BasicConfig
.
MANAGER_deleteAll
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
TeamParam
,
BasicConfig
.
MANAGER_deleteAll
,
"一键清空团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加指定中奖团队"
,
priority
=
7
)
public
void
添加指定中奖团队
()
{
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
addTeamParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addTeamParam
.
put
(
"teamIds"
,
Arrays
.
asList
(
3817
));
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
);
Object
failSize
=
response
.
jsonPath
().
getJsonObject
(
"data.failSize"
);
System
.
out
.
println
(
failSize
);
Assert
.
assertEquals
(
failSize
,
0
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
,
"添加指定中奖团队失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启团队配置开关"
,
priority
=
8
)
public
void
开启团队配置开关
()
{
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfid
.
get
(
1
).
getId
());
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_updateTeam
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_updateTeam
,
"开启团队配置开关失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/manager/QuesReward.java
→
src/test/java/com/kjj/cases/live/manager/QuesReward
/Unlimited
.java
View file @
13fe04ee
package
com
.
kjj
.
cases
.
live
.
manager
;
package
com
.
kjj
.
cases
.
live
.
manager
.
QuesReward
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
...
...
@@ -11,7 +12,7 @@ import org.testng.annotations.Test;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
QuesRewar
d
implements
AdminAuthorization
{
public
class
Unlimite
d
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
...
...
@@ -21,8 +22,8 @@ public class QuesReward implements AdminAuthorization {
@Test
(
description
=
"获取有奖答题列表信息"
,
priority
=
1
)
public
void
获取有奖答题列表信息
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
//
getConfParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
getConfParam
.
put
(
"liveId"
,
2960
);
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//
getConfParam.put("liveId", 2960);
Response
response
=
network
.
getResponse
(
getConfParam
,
BasicConfig
.
MANAGER_reward
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -30,19 +31,24 @@ public class QuesReward implements AdminAuthorization {
}
@Test
(
description
=
"
获取本场答题有
奖规则"
,
priority
=
2
)
public
void
获取本场答题有
奖规则
()
{
@Test
(
description
=
"
本场答题无限制中
奖规则"
,
priority
=
2
)
public
void
本场答题无限制中
奖规则
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
//
getConfParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
getConfParam
.
put
(
"liveId"
,
2960
);
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//
getConfParam.put("liveId", 2960);
Response
response
=
network
.
getResponse
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data
"
);
System
.
out
.
println
(
data
);
Assert
.
assert
NotNull
(
data
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"获取本场答题有奖规则失败
"
,
response
.
body
().
asString
()));
Object
redPacketRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.redPacketRuleType
"
);
System
.
out
.
println
(
redPacketRuleType
);
Assert
.
assert
Equals
(
redPacketRuleType
,
1
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包规则无限制
"
,
response
.
body
().
asString
()));
Object
welfareRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.welfareRuleType"
);
System
.
out
.
println
(
welfareRuleType
);
Assert
.
assertEquals
(
welfareRuleType
,
1
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖实物规则无限制"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/manager/QuesReward/limited.java
0 → 100644
View file @
13fe04ee
package
com
.
kjj
.
cases
.
live
.
manager
.
QuesReward
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
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
limited
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
@Test
(
description
=
"修改本场答题规则仅一次中奖"
,
priority
=
1
)
public
void
修改本场答题规则仅一次中奖
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
// updateParam.put("liveId", 2960);
updateParam
.
put
(
"redPacketRuleType"
,
2
);
updateParam
.
put
(
"welfareRuleType"
,
2
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_updateQuestionPrizesRule
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_updateQuestionPrizesRule
,
"答题有奖红包规则无限制"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"答题有奖限制中奖1次"
,
priority
=
2
)
public
void
答题有奖限制中奖
1
次
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
// getConfParam.put("liveId", 2960);
Response
response
=
network
.
getResponse
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
);
Object
redPacketRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.redPacketRuleType"
);
System
.
out
.
println
(
redPacketRuleType
);
Assert
.
assertEquals
(
redPacketRuleType
,
2
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
Object
welfareRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.welfareRuleType"
);
System
.
out
.
println
(
welfareRuleType
);
Assert
.
assertEquals
(
welfareRuleType
,
2
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
13fe04ee
...
...
@@ -298,7 +298,12 @@ public class BasicConfig {
//***************有奖答题*****************
public
static
final
String
MANAGER_reward
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/list"
;
public
static
final
String
MANAGER_getQuestionPrizesRule
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/getQuestionPrizesRule"
;
public
static
final
String
MANAGER_updateQuestionPrizesRule
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/updateQuestionPrizesRule"
;
public
static
final
String
MANAGER_TeamAssignmentList
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/getTeamAssignmentList"
;
public
static
final
String
MANAGER_addTeam
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/addTeamAssignmentList"
;
public
static
final
String
MANAGER_delTeam
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/deleteTeamAssignment"
;
public
static
final
String
MANAGER_deleteAll
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/deleteAllTeamAssignment"
;
public
static
final
String
MANAGER_updateTeam
=
MANAGER_HOST
+
"/kjy/manager/live/ques/reward/updateTeamAssignmentType"
;
// *************** 素材ID ***************
public
static
final
String
ARTICLE_CONTENTID
=
"Kj21NjM4NDc"
;
...
...
src/test/liveTestNG.xml
View file @
13fe04ee
...
...
@@ -19,12 +19,24 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题配置"
>
<test
preserve-order=
"true"
name=
"有奖答题
无限制
配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward"
/>
<class
name=
"com.kjj.cases.live.manager.QuesReward
.Unlimited
"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题团队配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.TeamAssignment"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"有奖答题限制1次中奖"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.QuesReward.limited"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"中奖规则配置"
>
<classes>
<class
name=
"com.kjj.cases.live.manager.LotteryRule"
/>
...
...
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