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
67f3e4ad
Commit
67f3e4ad
authored
May 22, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增猜数字红包
parent
16f9382c
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
276 additions
and
8 deletions
+276
-8
GuessList.java
src/test/java/com/kjj/bean/manager/GuessList.java
+12
-0
ManagerGuess.java
src/test/java/com/kjj/cases/live/guess/ManagerGuess.java
+222
-0
Limited.java
src/test/java/com/kjj/cases/live/red/Limited.java
+7
-3
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+15
-0
JsonUtil.java
src/test/java/com/kjj/utils/JsonUtil.java
+8
-0
liveTestNG.xml
src/test/liveTestNG.xml
+11
-5
testNG.xml
src/test/testNG.xml
+1
-0
No files found.
src/test/java/com/kjj/bean/manager/GuessList.java
0 → 100644
View file @
67f3e4ad
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
GuessList
{
private
String
confId
;
private
Integer
redSort
;
}
src/test/java/com/kjj/cases/live/guess/ManagerGuess.java
0 → 100644
View file @
67f3e4ad
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/red/Limited.java
View file @
67f3e4ad
...
...
@@ -150,7 +150,9 @@ public class Limited implements AdminAuthorization {
ThreadSleepUtils
.
sleep
(
500
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
String
quesConfId
=
this
.
quesConfId
.
get
(
0
).
getQuesConfId
();
params
.
put
(
"confId"
,
quesConfId
);
System
.
out
.
println
(
"quesConfId:"
+
quesConfId
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -227,8 +229,9 @@ public class Limited implements AdminAuthorization {
ThreadSleepUtils
.
sleep
(
5000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
0
).
getQuesConfId
());
System
.
out
.
println
(
" 查询用户A领取答题红包结果 timestamp:"
+
new
Date
().
getTime
());
String
quesConfId
=
this
.
quesConfId
.
get
(
0
).
getQuesConfId
();
params
.
put
(
"quesConfId"
,
quesConfId
);
System
.
out
.
println
(
" 查询用户A领取答题红包结果 timestamp:"
+
new
Date
().
getTime
()+
"quesConfId:"
+
quesConfId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
...
...
@@ -236,6 +239,7 @@ public class Limited implements AdminAuthorization {
Integer
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
System
.
out
.
println
(
amount
);
Assert
.
assertTrue
(
amount
>
0
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"用户答题结果获取失败"
,
response
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
67f3e4ad
...
...
@@ -84,6 +84,21 @@ public class BasicConfig {
public
static
final
String
ANCHOR_listLiveFreeReward
=
MOBILE_HOST
+
"/kjy/live/lottery/listLiveFreeReward"
;
public
static
final
String
ANCHOR_receive
=
MOBILE_HOST
+
"/kjy/live/user/lottery/receive"
;
// *************** 猜数字红包 ***************
public
static
final
String
MANAGER_getSurplusAmount
=
MANAGER_HOST
+
"/kjy/manager/red/conf/getSurplusAmount"
;
public
static
final
String
MANAGER_saveOrUpdate1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/saveOrUpdate"
;
public
static
final
String
MANAGER_list_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/list"
;
public
static
final
String
MANAGER_detail_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/detail"
;
public
static
final
String
MANAGER_del_1
=
MANAGER_HOST
+
"/kjy/manager/red/guess/delete"
;
//助播端
public
static
final
String
MOBILE_saveOrUpdate
=
MOBILE_HOST
+
"/conf/pre/red/guess/saveOrUpdate"
;
public
static
final
String
MOBILE_findDetail
=
MOBILE_HOST
+
"/conf/pre/red/findDetail"
;
public
static
final
String
MOBILE_list
=
MOBILE_HOST
+
"/conf/pre/red/guess/list"
;
public
static
final
String
MOBILE_detail
=
MOBILE_HOST
+
"/conf/pre/red/guess/detail"
;
public
static
final
String
MOBILE_delete
=
MOBILE_HOST
+
"/conf/pre/red/guess/delete"
;
// *************** 宝箱裂变 ***************
public
static
final
String
MANAGER_getList4Admin
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/getList4Admin"
;
public
static
final
String
MANAGER_saveTreasureConf
=
MANAGER_HOST
+
"/kjy/manager/live/treasure/saveTreasureConf"
;
...
...
src/test/java/com/kjj/utils/JsonUtil.java
View file @
67f3e4ad
...
...
@@ -7,6 +7,7 @@ import groovy.json.JsonBuilder;
import
io.restassured.response.Response
;
import
java.util.List
;
import
java.util.Map
;
public
class
JsonUtil
{
...
...
@@ -47,6 +48,13 @@ public class JsonUtil {
return
JSON
.
parseArray
(
str
,
tClass
);
}
public
static
<
T
>
List
<
T
>
parseResponseToListBean
(
Response
response
,
Class
<
T
>
tClass
,
String
listName
){
Map
map
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
map
.
get
(
listName
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
return
JSON
.
parseArray
(
str
,
tClass
);
}
public
static
<
T
>
T
parseResponseToBean1
(
Response
response
,
Class
<
T
>
tClass
){
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"d"
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
...
...
src/test/liveTestNG.xml
View file @
67f3e4ad
...
...
@@ -25,11 +25,17 @@
</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.treasure.Treasure"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播前猜数字红包配置"
>
<classes>
<class
name=
"com.kjj.cases.live.guess.ManagerGuess"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱时长"
>
...
...
src/test/testNG.xml
View file @
67f3e4ad
...
...
@@ -2,6 +2,7 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite
name=
"客集集"
verbose=
"1"
thread-count=
"3"
>
<suite-files>
<suite-file
path=
"liveTestNG.xml"
></suite-file>
<suite-file
path=
"wechatTestNG.xml"
></suite-file>
...
...
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