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
a4b781d8
Commit
a4b781d8
authored
Apr 07, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a04efa8d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
309 additions
and
41 deletions
+309
-41
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
+69
-13
User.java
src/test/java/com/kjj/cases/live/User.java
+210
-10
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+12
-0
liveTestNG.xml
src/test/liveTestNG.xml
+5
-11
No files found.
src/test/java/com/kjj/cases/basics/Video.java
deleted
100644 → 0
View file @
a04efa8d
package
com
.
kjj
.
cases
.
basics
;
public
class
Video
{
}
src/test/java/com/kjj/cases/live/AdminAuthorization.java
View file @
a4b781d8
...
@@ -24,14 +24,25 @@ public interface AdminAuthorization {
...
@@ -24,14 +24,25 @@ public interface AdminAuthorization {
// 创建用户 并传到network里
// 创建用户 并传到network里
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
}
/**
/**
* 访客授权
* 访客
(嘿保险)
授权
*/
*/
}
default
void
visitorAuth
()
{
default
void
visitorAuth
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY
);
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
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 @
a4b781d8
...
@@ -14,7 +14,20 @@ public class DesignatedWinner implements AdminAuthorization{
...
@@ -14,7 +14,20 @@ public class DesignatedWinner implements AdminAuthorization{
agentAuth
();
agentAuth
();
}
}
@Test
(
description
=
"查询指定中奖配置"
,
priority
=
1
)
@Test
(
description
=
"获取直播状态"
,
priority
=
1
)
public
void
获取直播状态
()
{
Map
<
String
,
Object
>
astatusParam
=
new
HashMap
<>();
astatusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
astatusRes
=
network
.
getResponse
(
astatusParam
,
BasicConfig
.
MOBILE_status
);
Map
<
String
,
Object
>
data
=
astatusRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
int
liveStatus
=
(
int
)
data
.
get
(
"liveStatus"
);
boolean
lotteryFlag
=
(
boolean
)
data
.
get
(
"lotteryFlag"
);
Assert
.
assertEquals
(
liveStatus
,
1
,
network
.
message
(
astatusParam
,
BasicConfig
.
MOBILE_status
,
"直播状态查询失败"
,
astatusRes
.
body
().
asString
()));
Assert
.
assertTrue
(
lotteryFlag
,
network
.
message
(
astatusParam
,
BasicConfig
.
MOBILE_status
,
"抽奖标记为false"
,
astatusRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询指定中奖配置"
,
priority
=
2
)
public
void
查询指定中奖配置
()
{
public
void
查询指定中奖配置
()
{
Map
<
String
,
Object
>
awardConfParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
awardConfParam
=
new
HashMap
<>();
awardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
awardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -23,20 +36,63 @@ public class DesignatedWinner implements AdminAuthorization{
...
@@ -23,20 +36,63 @@ public class DesignatedWinner implements AdminAuthorization{
System
.
out
.
println
(
data
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
awardConfParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
,
"中奖配置查询失败"
,
awardConfRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
awardConfParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardConf
,
"中奖配置查询失败"
,
awardConfRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询指定中奖用户列表"
,
priority
=
3
)
public
void
查询指定中奖用户列表
()
{
Map
<
String
,
Object
>
UserSelectListfParam
=
new
HashMap
<>();
UserSelectListfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
UserSelectListRes
=
network
.
getResponse
(
UserSelectListfParam
,
BasicConfig
.
MOBILE_SpecifyAwardUserSelectList
);
Object
data
=
UserSelectListRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
UserSelectListfParam
,
BasicConfig
.
MOBILE_SpecifyAwardUserSelectList
,
"查询指定中奖用户失败"
,
UserSelectListRes
.
body
().
asString
()));
}
@Test
(
description
=
"代理人指定访客中奖表单提交"
,
priority
=
4
)
public
void
代理人指定访客中奖表单提交
()
{
Map
<
String
,
Object
>
SubmitParam
=
new
HashMap
<>();
SubmitParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
SubmitParam
.
put
(
"visitorId"
,
"Kj22NzI2Mw"
);
Response
SubmitRes
=
network
.
postResponse
(
SubmitParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardSubmit
);
Object
data
=
SubmitRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
SubmitParam
,
BasicConfig
.
MOBILE_AgentSpecifyAwardSubmit
,
"代理人指定中奖提交失败"
,
SubmitRes
.
body
().
asString
()));
}
}
// @Test(description = "代理人指定访客中奖表单提交", priority = 2)
@Test
(
description
=
"被代理人指定中奖的用户列表"
,
priority
=
5
)
// public void 代理人指定访客中奖表单提交() {
public
void
被代理人指定中奖的用户列表
()
{
// Map<String, Object> SubmitParam = new HashMap<>();
Map
<
String
,
Object
>
AwardUserListParam
=
new
HashMap
<>();
// SubmitParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
AwardUserListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
// SubmitParam.put("visitorId","Kj21NDE0NTU");
Response
AwardUserListRes
=
network
.
getResponse
(
AwardUserListParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardUserList
);
//
Object
data
=
AwardUserListRes
.
jsonPath
().
getJsonObject
(
"data"
);
// Response SubmitRes = network.getResponse(SubmitParam, BasicConfig.MOBILE_AgentSpecifyAwardSubmit);
System
.
out
.
println
(
data
);
// Object data = SubmitRes.jsonPath().getJsonObject("data");
Assert
.
assertNotNull
(
data
,
network
.
message
(
AwardUserListParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardUserList
,
"查询指定中奖用户列表失败"
,
AwardUserListRes
.
body
().
asString
()));
// System.out.println(data);
// Assert.assertNotNull(data, network.message(SubmitParam, BasicConfig.MOBILE_AgentSpecifyAwardSubmit, "代理人指定中奖失败", SubmitRes.body().asString()));
}
//
// }
@Test
(
description
=
"代理人指定中奖信息查询"
,
priority
=
6
)
public
void
代理人指定中奖信息查询
()
{
Map
<
String
,
Object
>
AwardInfoParam
=
new
HashMap
<>();
AwardInfoParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
AAwardInfoRes
=
network
.
getResponse
(
AwardInfoParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardInfo
);
Object
data
=
AAwardInfoRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
AwardInfoParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardInfo
,
"查询指定中奖信息失败"
,
AAwardInfoRes
.
body
().
asString
()));
}
@Test
(
description
=
"代理人指定中奖配置查询"
,
priority
=
7
)
public
void
代理人指定中奖配置查询
()
{
Map
<
String
,
Object
>
AwardConfParam
=
new
HashMap
<>();
AwardConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
AwardConfRes
=
network
.
getResponse
(
AwardConfParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardConf
);
Object
data
=
AwardConfRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
AwardConfParam
,
BasicConfig
.
MOBILE_agentSpecifyAwardConf
,
"代理人指定中奖配置查询失败"
,
AwardConfRes
.
body
().
asString
()));
}
...
...
src/test/java/com/kjj/cases/live/User.java
View file @
a4b781d8
...
@@ -13,23 +13,68 @@ import java.util.Map;
...
@@ -13,23 +13,68 @@ import java.util.Map;
public
class
User
implements
AdminAuthorization
{
public
class
User
implements
AdminAuthorization
{
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
visitorAuth
();
}
visitorAuth
()
;
public
String
token
;
}
public
String
shareSign
;
@Test
(
description
=
"邀请关系绑定"
,
priority
=
1
)
//代理人邀请绑定
@Test
(
description
=
"代理人邀请关系绑定"
,
priority
=
1
)
public
void
邀请关系绑定
()
{
public
void
邀请关系绑定
()
{
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"share
Type
"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
()));
bindingParam
.
put
(
"share
Sign
"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
()));
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"获取绑定结果和绑定凭证"
,
priority
=
2
)
public
void
获取绑定结果和绑定凭证
()
{
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"根据绑定凭证发放抽奖码"
,
priority
=
3
)
public
void
根据绑定凭证发放抽奖码
()
{
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询用户自己的抽奖券列表"
,
priority
=
4
)
public
void
查询用户自己的抽奖券列表
()
{
try
{
agentAuth
();
Thread
.
sleep
(
500
);
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myLotteryCodeParam
.
put
(
"pageIndex"
,
1
);
myLotteryCodeParam
.
put
(
"pageSize"
,
30
);
Response
myLotteryCodeRes
=
network
.
getResponse
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
);
Object
data
=
myLotteryCodeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"查询用户自己的抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
catch
(
InterruptedException
e
){
e
.
printStackTrace
();
}
finally
{
visitorAuth
();
}
@Test
(
description
=
"预约直播间"
,
priority
=
2
)
}
@Test
(
description
=
"预约直播间"
,
priority
=
5
)
public
void
预约直播间
()
{
public
void
预约直播间
()
{
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -45,7 +90,7 @@ public class User implements AdminAuthorization{
...
@@ -45,7 +90,7 @@ public class User implements AdminAuthorization{
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"关注直播间"
,
priority
=
3
)
@Test
(
description
=
"关注直播间"
,
priority
=
6
)
public
void
关注直播间
()
{
public
void
关注直播间
()
{
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -59,7 +104,7 @@ public class User implements AdminAuthorization{
...
@@ -59,7 +104,7 @@ public class User implements AdminAuthorization{
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
}
@Test
(
description
=
"查询关注状态"
,
priority
=
4
)
@Test
(
description
=
"查询关注状态"
,
priority
=
7
)
public
void
查询关注状态
()
{
public
void
查询关注状态
()
{
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
findParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
findParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -70,7 +115,7 @@ public class User implements AdminAuthorization{
...
@@ -70,7 +115,7 @@ public class User implements AdminAuthorization{
}
}
@Test
(
description
=
"保存海报获得抽奖码"
,
priority
=
5
)
@Test
(
description
=
"保存海报获得抽奖码"
,
priority
=
8
)
public
void
保存海报获得抽奖码
()
{
public
void
保存海报获得抽奖码
()
{
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -81,7 +126,7 @@ public class User implements AdminAuthorization{
...
@@ -81,7 +126,7 @@ public class User implements AdminAuthorization{
}
}
@Test
(
description
=
"我的抽奖码数量"
,
priority
=
6
)
@Test
(
description
=
"我的抽奖码数量"
,
priority
=
9
)
public
void
我的抽奖码数量
()
{
public
void
我的抽奖码数量
()
{
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
@@ -93,4 +138,159 @@ public class User implements AdminAuthorization{
...
@@ -93,4 +138,159 @@ public class User implements AdminAuthorization{
}
}
//访客分享直播间
@Test
(
description
=
"访客分享直播间"
,
priority
=
10
)
public
void
访客分享直播间
()
{
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
2
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
//访客邀请绑定
@Test
(
description
=
"访客邀请关系绑定"
,
priority
=
11
)
public
void
访客邀请关系绑定
()
{
visitorAuth2
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareSign"
,
shareSign
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客获取绑定结果和绑定凭证"
,
priority
=
12
)
public
void
访客获取绑定结果和绑定凭证
()
{
visitorAuth2
();
Map
<
String
,
Object
>
tokenParam
=
new
HashMap
<>();
tokenParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
tokenRes
=
network
.
getResponse
(
tokenParam
,
BasicConfig
.
MOBILE_Token
);
HashMap
data
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
this
.
token
=
(
String
)
data
.
get
(
"token"
);
System
.
out
.
println
(
token
);
Object
token
=
tokenRes
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
token
,
network
.
message
(
tokenParam
,
BasicConfig
.
MOBILE_Token
,
"未获取到绑定结果"
,
tokenRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客根据绑定凭证发放抽奖码"
,
priority
=
13
)
public
void
访客根据绑定凭证发放抽奖码
()
{
visitorAuth2
();
Map
<
String
,
Object
>
codeParam
=
new
HashMap
<>();
codeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
codeParam
.
put
(
"token"
,
token
);
Response
codeRes
=
network
.
getResponse
(
codeParam
,
BasicConfig
.
MOBILE_Code
);
boolean
success
=
codeRes
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
codeParam
,
BasicConfig
.
MOBILE_Code
,
"发放抽奖码失败"
,
codeRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播所有的订阅消息模板"
,
priority
=
14
)
public
void
获取直播所有的订阅消息模板
()
{
visitorAuth2
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"appid"
,
"wx4d7276f866bd24c8"
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
);
Object
data
=
sycRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_wxIdAllList
,
"获取订阅消息失败"
,
sycRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客预约直播间"
,
priority
=
15
)
public
void
访客预约直播间
()
{
visitorAuth2
();
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
sycParam
.
put
(
"bizType"
,
1
);
List
<
Long
>
markIds2
=
new
ArrayList
<>();
markIds2
.
add
(
142L
);
markIds2
.
add
(
143L
);
markIds2
.
add
(
140L
);
sycParam
.
put
(
"markIds"
,
markIds2
);
Response
sycRes
=
network
.
postResponse
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
);
Object
data
=
sycRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客关注直播间"
,
priority
=
16
)
public
void
访客关注直播间
()
{
visitorAuth2
();
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
List
<
Long
>
markIds2
=
new
ArrayList
<>();
markIds2
.
add
(
146L
);
markIds2
.
add
(
144L
);
subscribeParam
.
put
(
"markIds"
,
markIds2
);
Response
subscribeRes
=
network
.
postResponse
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
);
boolean
data
=
subscribeRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客关注状态查询"
,
priority
=
17
)
public
void
访客关注状态查询
()
{
visitorAuth2
();
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
findParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
findRes
=
network
.
getResponse
(
findParam
,
BasicConfig
.
USER_FIND
);
boolean
data
=
findRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
findParam
,
BasicConfig
.
USER_FIND
,
"关注失败"
,
findRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客保存海报获得抽奖码"
,
priority
=
18
)
public
void
访客保存海报获得抽奖码
()
{
visitorAuth2
();
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
savePosterRes
=
network
.
postResponse
(
savePosterParam
,
BasicConfig
.
USER_savePoster
);
boolean
data
=
savePosterRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
savePosterParam
,
BasicConfig
.
USER_savePoster
,
"海报保存失败"
,
savePosterRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询访客抽奖码数量"
,
priority
=
19
)
public
void
查询访客抽奖码数量
()
{
visitorAuth2
();
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
myCountRes
=
network
.
getResponse
(
myCountParam
,
BasicConfig
.
USER_myCount
);
long
data
=
myCountRes
.
jsonPath
().
getLong
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myCountParam
,
BasicConfig
.
USER_myCount
,
"获取抽奖码数量失败"
,
myCountRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客查询抽奖券列表"
,
priority
=
20
)
public
void
访客查询抽奖券列表
()
{
visitorAuth
();
try
{
Thread
.
sleep
(
500
);
Map
<
String
,
Object
>
myLotteryCodeParam
=
new
HashMap
<>();
myLotteryCodeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
myLotteryCodeParam
.
put
(
"pageIndex"
,
1
);
myLotteryCodeParam
.
put
(
"pageSize"
,
30
);
Response
myLotteryCodeRes
=
network
.
getResponse
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
);
Object
data
=
myLotteryCodeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
myLotteryCodeParam
,
BasicConfig
.
MOBILE_MyLotteryCode
,
"查询用户自己的抽奖券列表失败"
,
myLotteryCodeRes
.
body
().
asString
()));
}
catch
(
InterruptedException
e
){
e
.
printStackTrace
();
}
}
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
a4b781d8
...
@@ -14,6 +14,8 @@ public class BasicConfig {
...
@@ -14,6 +14,8 @@ public class BasicConfig {
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
//直播访客 (嘿 保险)
//直播访客 (嘿 保险)
public
static
String
VISITORKEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKnNHmHY52FxaDfigK3U4NQpLsQrodQUPUXwmumQ1kr3xsfZoGw7cEswYryWfUtMW"
;
public
static
String
VISITORKEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKnNHmHY52FxaDfigK3U4NQpLsQrodQUPUXwmumQ1kr3xsfZoGw7cEswYryWfUtMW"
;
//直播访客 (🍗)
public
static
String
VISITORKEY1
=
"LEH7epeHVDJWzhZ6DiexTHnsYWTEo46qxbPUiJ1xnTqmCJPHLGsoTuy5C2psyH1j5t5ppr3BNQLrBXrBmsmJUDJcXSivb"
;
// 基础线代理人 TKU
// 基础线代理人 TKU
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
// 基础线访客 TKU
// 基础线访客 TKU
...
@@ -36,6 +38,7 @@ public class BasicConfig {
...
@@ -36,6 +38,7 @@ public class BasicConfig {
//手机端地址
//手机端地址
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
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_OPEN
=
MOBILE_HOST
+
"/conf/live/open"
;
...
@@ -52,6 +55,7 @@ public class BasicConfig {
...
@@ -52,6 +55,7 @@ public class BasicConfig {
public
static
final
String
USER_END
=
MOBILE_HOST
+
"/kjy/live/assist/lottery/end"
;
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_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_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"
;
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
...
@@ -104,6 +108,14 @@ public class BasicConfig {
...
@@ -104,6 +108,14 @@ public class BasicConfig {
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
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_binding
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_AgentSpecifyAwardConf
=
MOBILE_HOST
+
"/kjy/live/agent/agentSpecifyAwardConf"
;
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_status
=
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_SAVEORUPDATE6
=
MANAGER_HOST
+
"/kjy/manager/conf/base/welfare/saveOrUpdate"
;
...
...
src/test/liveTestNG.xml
View file @
a4b781d8
...
@@ -32,17 +32,16 @@
...
@@ -32,17 +32,16 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"指定中奖"
>
<test
preserve-order=
"true"
name=
"指定中奖"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.DesignatedWinner"
/>
<class
name=
"com.kjj.cases.live.DesignatedWinner"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<class
name=
"com.kjj.cases.live.OpenLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客领取资料"
>
<test
preserve-order=
"true"
name=
"访客领取资料"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.LiveVisitors"
/>
<class
name=
"com.kjj.cases.live.LiveVisitors"
/>
...
@@ -54,15 +53,10 @@
...
@@ -54,15 +53,10 @@
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<test
preserve-order=
"true"
name=
"助播-结束直播"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.CloseLive"
/>
<class
name=
"com.kjj.cases.live.CloseLive"
/>
</classes>
</classes>
</test>
</test>
</suite>
</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