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
73cb6da5
Commit
73cb6da5
authored
Apr 08, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a4b781d8
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
384 additions
and
31 deletions
+384
-31
ConfidList.java
src/test/java/com/kjj/bean/ConfidList.java
+9
-0
LotteryList.java
src/test/java/com/kjj/bean/LotteryList.java
+21
-0
DesignatedWinner.java
src/test/java/com/kjj/cases/live/DesignatedWinner.java
+217
-21
Lottery.java
src/test/java/com/kjj/cases/live/Lottery.java
+97
-0
MngAuthorization.java
src/test/java/com/kjj/cases/live/MngAuthorization.java
+0
-2
OpenLive.java
src/test/java/com/kjj/cases/live/OpenLive.java
+11
-1
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+23
-7
liveTestNG.xml
src/test/liveTestNG.xml
+6
-0
No files found.
src/test/java/com/kjj/bean/ConfidList.java
0 → 100644
View file @
73cb6da5
package
com
.
kjj
.
bean
;
import
lombok.Data
;
@Data
public
class
ConfidList
{
private
String
welfareConfId
;
}
src/test/java/com/kjj/bean/LotteryList.java
0 → 100644
View file @
73cb6da5
package
com
.
kjj
.
bean
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LotteryList
{
private
List
<
List_Lottery
>
LotteryList
;
private
String
welfareId
;
private
String
configId
;
@Data
public
static
class
List_Lottery
{
private
String
id
;
private
String
name
;
}
}
src/test/java/com/kjj/cases/live/DesignatedWinner.java
View file @
73cb6da5
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/Lottery.java
0 → 100644
View file @
73cb6da5
package
com
.
kjj
.
cases
.
live
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.AgentEndList
;
import
com.kjj.bean.ConfidList
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
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
Lottery
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
List
<
ConfidList
>
List_Confid
;
@Test
(
description
=
"抽奖活动弹层福利列表"
,
priority
=
1
)
public
void
抽奖活动弹层福利列表
()
{
Map
<
String
,
Object
>
listLiveLotterParam
=
new
HashMap
<>();
listLiveLotterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
listLiveLotterRes
=
network
.
getResponse
(
listLiveLotterParam
,
BasicConfig
.
USER_listLiveLottery
);
Object
data
=
listLiveLotterRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
listLiveLotterParam
,
BasicConfig
.
USER_listLiveLottery
,
"抽奖活动弹层福利列表查询失败"
,
listLiveLotterRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询抽奖奖品列表"
,
priority
=
2
)
public
void
查询抽奖奖品列表
()
{
Map
<
String
,
Object
>
getLiveAwardListParam
=
new
HashMap
<>();
getLiveAwardListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
getLiveAwardListRes
=
network
.
getResponse
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
);
List
<
ConfidList
>
list
=
JsonUtil
.
parseResponseToListBean
(
getLiveAwardListRes
,
ConfidList
.
class
);
System
.
out
.
println
(
list
);
this
.
List_Confid
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getLiveAwardListParam
,
BasicConfig
.
USER_getLiveAwardList
,
"抽奖标记为false"
,
getLiveAwardListRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始第一轮抽奖"
,
priority
=
3
)
public
void
开始第一轮抽奖
()
{
Map
<
String
,
Object
>
startParam
=
new
HashMap
<>();
startParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
startParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Response
startRes
=
network
.
postResponse
(
startParam
,
BasicConfig
.
ANCHOR_start
);
Object
data
=
startRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
startParam
,
BasicConfig
.
ANCHOR_start
,
"开启第一轮抽奖失败"
,
startRes
.
body
().
asString
()));
}
@Test
(
description
=
"助播视角_权益列表"
,
priority
=
4
)
public
void
助播端权益列表
()
{
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
listRes
=
network
.
getResponse
(
listParam
,
BasicConfig
.
ANCHOR_list
);
Object
data
=
listRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
listParam
,
BasicConfig
.
ANCHOR_list
,
"主播端权益列表查询失败"
,
listRes
.
body
().
asString
()));
}
@Test
(
description
=
"抽奖状态查询"
,
priority
=
5
)
public
void
抽奖状态查询
()
{
Map
<
String
,
Object
>
statusParam
=
new
HashMap
<>();
statusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
statusParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Response
statusRes
=
network
.
postResponse
(
statusParam
,
BasicConfig
.
ANCHOR_status
);
boolean
data
=
statusRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
statusParam
,
BasicConfig
.
ANCHOR_status
,
"抽奖状态查询失败"
,
statusRes
.
body
().
asString
()));
}
@Test
(
description
=
"结束第一轮抽奖"
,
priority
=
6
)
public
void
结束第一轮抽奖
()
{
try
{
Thread
.
sleep
(
1000
);
Map
<
String
,
Object
>
endParam
=
new
HashMap
<>();
endParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
endParam
.
put
(
"confId"
,
this
.
List_Confid
.
get
(
0
).
getWelfareConfId
());
Response
endRes
=
network
.
postResponse
(
endParam
,
BasicConfig
.
ANCHOR_end
);
Boolean
data
=
endRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
endParam
,
BasicConfig
.
ANCHOR_end
,
"结束第一轮抽奖失败"
,
endRes
.
body
().
asString
()));
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
src/test/java/com/kjj/cases/live/MngAuthorization.java
View file @
73cb6da5
...
...
@@ -4,8 +4,6 @@ import com.kjj.utils.NetworkUtils;
/**
* 管理员后台授权
* @author zhanghuifeng
* date 2021/2/20-13:46
*/
public
interface
MngAuthorization
{
...
...
src/test/java/com/kjj/cases/live/OpenLive.java
View file @
73cb6da5
...
...
@@ -13,8 +13,18 @@ public class OpenLive implements AdminAuthorization {
public
void
setUp
()
{
adminAuth
();
}
@Test
(
description
=
"获取直播配置详情"
,
priority
=
1
)
public
void
获取直播配置详情
()
{
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
);
Object
data
=
ConfDetailRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
ConfDetailParam
,
BasicConfig
.
ANCHOR_getConfDetail
,
"获取直播配置详情失败"
,
ConfDetailRes
.
body
().
asString
()));
}
@Test
(
description
=
"开始直播"
,
priority
=
1
)
@Test
(
description
=
"开始直播"
,
priority
=
2
)
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
73cb6da5
...
...
@@ -9,7 +9,7 @@ public class BasicConfig {
// 代理人的openid(固定)
public
static
final
String
OPEN_ID
=
"osi5w5ggFiEXk0tPJH9b0KO_XU08"
;
//直播管理员(嘿 保险)
public
static
String
ADMIN_KEY
=
"LEH7epeHVDJWzhZ6DiexTHns
xr9dj8m9E3cwnnww5M4EuupwiJ3fYP8A6Ahrc22htzmVfYnNSfxHirjfK4BMwzQgtvhqh
"
;
public
static
String
ADMIN_KEY
=
"LEH7epeHVDJWzhZ6DiexTHns
y12nWWyRsr9qezBqCy8rR8eqVZXHyQcwnLYHAkuLohC8Sy9vqcAwUZ3LuJCP5pRfjffr3
"
;
// 直播代理人 (艳玲)
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
//直播访客 (嘿 保险)
...
...
@@ -42,17 +42,32 @@ public class BasicConfig {
// *************** 主播端 ***************
public
static
final
String
ANCHOR_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_getConfDetail
=
MOBILE_HOST
+
"/conf/pre/getConfDetail"
;
public
static
final
String
ANCHOR_CLOSE
=
MOBILE_HOST
+
"/conf/live/close"
;
public
static
final
String
ANCHOR_ADDQUESTION
=
MOBILE_HOST
+
"/kjy/live/assist/question/addQuestion"
;
public
static
final
String
ANCHOR_LIVECARD
=
MOBILE_HOST
+
"/kjy/mp/liveCard/getLiveEndSellerCard"
;
public
static
final
String
MOBILE_getSpecifyAwardConf
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getSpecifyAwardConf"
;
public
static
final
String
MOBILE_getAgentParticipateCond
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getAgentParticipateCond"
;
public
static
final
String
MOBILE_getLiveAwardList
=
MOBILE_HOST
+
"/conf/pre/specifyAward/getLiveAwardList"
;
public
static
final
String
ANCHOR_start
=
MOBILE_HOST
+
"/conf/live/lottery/start"
;
public
static
final
String
ANCHOR_status
=
MOBILE_HOST
+
"/conf/live/lottery/status"
;
public
static
final
String
ANCHOR_end
=
MOBILE_HOST
+
"/conf/live/lottery/end"
;
public
static
final
String
ANCHOR_list
=
MOBILE_HOST
+
"/conf/live/lottery/list"
;
public
static
final
String
ANCHOR_List
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/list"
;
public
static
final
String
ANCHOR_add
=
MOBILE_HOST
+
"/conf/pre/lottery/add"
;
public
static
final
String
ANCHOR_preModify
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/modify"
;
public
static
final
String
ANCHOR_Modify
=
MOBILE_HOST
+
"/conf/pre/lottery/modify"
;
public
static
final
String
ANCHOR_delete
=
MOBILE_HOST
+
"/conf/pre/lottery/delete"
;
public
static
final
String
ANCHOR_getList4Admin
=
MOBILE_HOST
+
"/conf/pre/welfare/getList4Admin"
;
public
static
final
String
ANCHOR_list1
=
MOBILE_HOST
+
"/conf/pre/lottery/list"
;
public
static
final
String
ANCHOR_preAdd
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/add"
;
public
static
final
String
ANCHOR_preDelete
=
MOBILE_HOST
+
"/conf/pre/lottery/pre/delete"
;
// *************** 直播抽奖 ***************
public
static
final
String
USER_getLiveAwardList
=
MOBILE_HOST
+
"/kjy/live/conf/specifyAward/getLiveAwardList"
;
public
static
final
String
USER_listLiveLottery
=
MOBILE_HOST
+
"/kjy/live/lottery/listLiveLottery"
;
// *************** 访客端 ***************
public
static
final
String
USER_SUBSCRIBE
=
MOBILE_HOST
+
"/kjy/live/user/appointment/subscribe"
;
public
static
final
String
USER_FIND
=
MOBILE_HOST
+
"/kjy/live/user/subscribe/find"
;
public
static
final
String
USER_SYCAPPOINTMENT
=
MOBILE_HOST
+
"/kjy/live/user/sycAppointment"
;
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_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_myCount
=
MOBILE_HOST
+
"/kjy/live/user/lottery/myCount"
;
public
static
final
String
USER_wxIdAllList
=
MOBILE_HOST1
+
"/kjy/mp/msg/config/live/user/wxIdAllList"
;
...
...
@@ -112,11 +127,12 @@ public class BasicConfig {
public
static
final
String
MOBILE_Code
=
MOBILE_HOST
+
"/clue/invitation/code"
;
public
static
final
String
MOBILE_MyLotteryCode
=
MOBILE_HOST
+
"/kjy/live/lottery/myLotteryCode"
;
public
static
final
String
MOBILE_SpecifyAwardUserSelectList
=
MOBILE_HOST
+
"/kjy/live/agent/specifyAwardUserSelectList"
;
public
static
final
String
MOBILE_status
=
MOBILE_HOST
+
"/index/status"
;
public
static
final
String
MOBILE_status
1
=
MOBILE_HOST
+
"/index/status"
;
public
static
final
String
MOBILE_agentSpecifyAwardUserList
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardUserList"
;
public
static
final
String
MOBILE_agentSpecifyAwardInfo
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardInfo"
;
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_WELFARELIST
=
MANAGER_HOST
+
"/kjy/manager/conf/base/welfare/list"
;
...
...
src/test/liveTestNG.xml
View file @
73cb6da5
...
...
@@ -19,6 +19,7 @@
<class
name=
"com.kjj.cases.live.Procurator"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人分享直播间"
>
<classes>
<class
name=
"com.kjj.cases.live.Agent"
/>
...
...
@@ -42,6 +43,11 @@
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<classes>
<class
name=
"com.kjj.cases.live.Lottery"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客领取资料"
>
<classes>
<class
name=
"com.kjj.cases.live.LiveVisitors"
/>
...
...
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