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
a6f97eba
Commit
a6f97eba
authored
Mar 29, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8d36761e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
34 deletions
+48
-34
Agent.java
src/test/java/com/kjj/cases/live/Agent.java
+32
-0
LiveAgent.java
src/test/java/com/kjj/cases/live/LiveAgent.java
+0
-8
User.java
src/test/java/com/kjj/cases/live/User.java
+7
-25
LiveConstants.java
src/test/java/com/kjj/constants/LiveConstants.java
+3
-1
liveTestNG.xml
src/test/liveTestNG.xml
+6
-0
No files found.
src/test/java/com/kjj/cases/live/Agent.java
0 → 100644
View file @
a6f97eba
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
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
Agent
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
String
shareSign
;
@Test
(
description
=
"分享直播间"
,
priority
=
1
)
public
void
分享直播间
()
{
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"data"
);
this
.
shareSign
=
(
String
)
data
.
get
(
"shareSign"
);
System
.
out
.
println
(
shareSign
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
(),
shareSign
);
Assert
.
assertNotNull
(
shareSign
,
network
.
message
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
,
"分享失败"
,
signRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/LiveAgent.java
View file @
a6f97eba
...
...
@@ -19,13 +19,7 @@ public class LiveAgent implements AdminAuthorization {
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
String
liveid
;
public
String
pageIndex
;
public
String
pageSize
;
public
String
agentId
;
//代理人直播排行榜;
...
...
@@ -35,7 +29,6 @@ public class LiveAgent implements AdminAuthorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
// params.put("liveId",liveID);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentPersonalCharts
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
...
...
@@ -48,7 +41,6 @@ public class LiveAgent implements AdminAuthorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
// params.put("liveId",liveID);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_TeamTeamCharts
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
...
...
src/test/java/com/kjj/cases/live/User.java
View file @
a6f97eba
...
...
@@ -11,34 +11,17 @@ import java.util.List;
import
java.util.Map
;
public
class
User
implements
AdminAuthorization
{
public
String
shareSign
;
@BeforeClass
public
void
setUp
()
{
visitorAuth
();
agentAuth
();
}
//代理人分享直播链接
@Test
(
description
=
"分享直播间"
,
priority
=
1
)
public
void
分享直播间
()
{
Map
<
String
,
Object
>
signParam
=
new
HashMap
<>();
signParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
signParam
.
put
(
"shareType"
,
1
);
Response
signRes
=
network
.
getResponse
(
signParam
,
BasicConfig
.
MOBILE_GETSHARESIGN
);
HashMap
data
=
signRes
.
jsonPath
().
getJsonObject
(
"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
=
2
)
@Test
(
description
=
"邀请关系绑定"
,
priority
=
1
)
public
void
邀请关系绑定
()
{
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
bindingParam
.
put
(
"shareType"
,
shareSign
);
bindingParam
.
put
(
"shareType"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
shareSign
.
getKey
())
);
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
...
...
@@ -46,8 +29,7 @@ public class User implements AdminAuthorization{
}
@Test
(
description
=
"预约直播间"
,
priority
=
3
)
@Test
(
description
=
"预约直播间"
,
priority
=
2
)
public
void
预约直播间
()
{
Map
<
String
,
Object
>
sycParam
=
new
HashMap
<>();
sycParam
.
put
(
"bizId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -63,7 +45,7 @@ public class User implements AdminAuthorization{
Assert
.
assertNotNull
(
data
,
network
.
message
(
sycParam
,
BasicConfig
.
USER_SYCAPPOINTMENT
,
"预约失败"
,
sycRes
.
body
().
asString
()));
}
@Test
(
description
=
"关注直播间"
,
priority
=
4
)
@Test
(
description
=
"关注直播间"
,
priority
=
3
)
public
void
关注直播间
()
{
Map
<
String
,
Object
>
subscribeParam
=
new
HashMap
<>();
subscribeParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -77,7 +59,7 @@ public class User implements AdminAuthorization{
Assert
.
assertTrue
(
data
,
network
.
message
(
subscribeParam
,
BasicConfig
.
USER_SUBSCRIBE
,
"关注失败"
,
subscribeRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询关注状态"
,
priority
=
5
)
@Test
(
description
=
"查询关注状态"
,
priority
=
4
)
public
void
查询关注状态
()
{
Map
<
String
,
Object
>
findParam
=
new
HashMap
<>();
findParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -88,7 +70,7 @@ public class User implements AdminAuthorization{
}
@Test
(
description
=
"保存海报获得抽奖码"
,
priority
=
6
)
@Test
(
description
=
"保存海报获得抽奖码"
,
priority
=
5
)
public
void
保存海报获得抽奖码
()
{
Map
<
String
,
Object
>
savePosterParam
=
new
HashMap
<>();
savePosterParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -99,7 +81,7 @@ public class User implements AdminAuthorization{
}
@Test
(
description
=
"我的抽奖码数量"
,
priority
=
7
)
@Test
(
description
=
"我的抽奖码数量"
,
priority
=
6
)
public
void
我的抽奖码数量
()
{
Map
<
String
,
Object
>
myCountParam
=
new
HashMap
<>();
myCountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/constants/LiveConstants.java
View file @
a6f97eba
...
...
@@ -3,6 +3,7 @@ package com.kjj.constants;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.security.Key
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -22,7 +23,8 @@ public class LiveConstants {
public
enum
StringKeyEnum
{
LIVE_ID
(
1
,
"直播ID的key"
),
ENCODE_LIVE_ID
(
2
,
"直播加密ID的key"
),
;
shareSign
(
3
,
"分享参数shareSign"
);
private
Integer
key
;
private
String
desc
;
}
...
...
src/test/liveTestNG.xml
View file @
a6f97eba
...
...
@@ -18,6 +18,12 @@
<classes>
<class
name=
"com.kjj.cases.live.Procurator"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人分享直播间"
>
<classes>
<class
name=
"com.kjj.cases.live.Agent"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"访客券码领取"
>
...
...
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