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
dc993508
Commit
dc993508
authored
Apr 09, 2021
by
别湘灵
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/test/liveTestNG.xml
parents
c017c078
73cb6da5
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
674 additions
and
51 deletions
+674
-51
ConfidList.java
src/test/java/com/kjj/bean/ConfidList.java
+9
-0
LotteryList.java
src/test/java/com/kjj/bean/LotteryList.java
+21
-0
Video.java
src/test/java/com/kjj/cases/basics/Video.java
+0
-5
AdminAuthorization.java
src/test/java/com/kjj/cases/live/AdminAuthorization.java
+13
-2
DesignatedWinner.java
src/test/java/com/kjj/cases/live/DesignatedWinner.java
+268
-16
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
User.java
src/test/java/com/kjj/cases/live/User.java
+210
-10
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+33
-5
liveTestNG.xml
src/test/liveTestNG.xml
+12
-10
No files found.
src/test/java/com/kjj/bean/ConfidList.java
0 → 100644
View file @
dc993508
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 @
dc993508
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/basics/Video.java
deleted
100644 → 0
View file @
c017c078
package
com
.
kjj
.
cases
.
basics
;
public
class
Video
{
}
src/test/java/com/kjj/cases/live/AdminAuthorization.java
View file @
dc993508
...
...
@@ -24,14 +24,25 @@ public interface AdminAuthorization {
// 创建用户 并传到network里
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
}
/**
* 访客授权
* 访客
(嘿保险)
授权
*/
}
default
void
visitorAuth
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY
);
}
/**
* 访客(🍗)授权
*/
default
void
visitorAuth2
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY1
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY1
);
}
}
src/test/java/com/kjj/cases/live/DesignatedWinner.java
View file @
dc993508
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/Lottery.java
0 → 100644
View file @
dc993508
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 @
dc993508
...
...
@@ -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 @
dc993508
...
...
@@ -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/cases/live/User.java
View file @
dc993508
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/config/BasicConfig.java
View file @
dc993508
...
...
@@ -14,6 +14,8 @@ public class BasicConfig {
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
//直播访客 (嘿 保险)
public
static
String
VISITORKEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKnNHmHY52FxaDfigK3U4NQpLsQrodQUPUXwmumQ1kr3xsfZoGw7cEswYryWfUtMW"
;
//直播访客 (🍗)
public
static
String
VISITORKEY1
=
"LEH7epeHVDJWzhZ6DiexTHnsYWTEo46qxbPUiJ1xnTqmCJPHLGsoTuy5C2psyH1j5t5ppr3BNQLrBXrBmsmJUDJcXSivb"
;
// 基础线代理人 TKU
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
// 基础线访客 TKU
...
...
@@ -36,22 +38,39 @@ public class BasicConfig {
//手机端地址
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST1
=
"https://kjj.m.duibatest.com.cn"
;
// *************** 主播端 ***************
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"
;
// *************** 直播管理端 ***************
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
...
...
@@ -183,6 +202,15 @@ public class BasicConfig {
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
public
static
final
String
MOBILE_binding
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_AgentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
public
static
final
String
MOBILE_Token
=
MOBILE_HOST
+
"/clue/invitation/token"
;
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_status1
=
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"
;
//***************直播素材*****************
...
...
src/test/liveTestNG.xml
View file @
dc993508
...
...
@@ -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"
/>
...
...
@@ -26,12 +27,6 @@
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客券码领取"
>
<classes>
<class
name=
"com.kjj.cases.live.User"
/>
...
...
@@ -42,6 +37,16 @@
<classes>
<class
name=
"com.kjj.cases.live.DesignatedWinner"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<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>
...
...
@@ -53,6 +58,7 @@
<class
name=
"com.kjj.cases.live.LiveAgent"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"红包领取"
>
<classes>
<class
name=
"com.kjj.cases.live.LiveVistorRed"
/>
...
...
@@ -63,9 +69,5 @@
<class
name=
"com.kjj.cases.live.CloseLive"
/>
</classes>
</test>
</suite>
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