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
d70f90d8
Commit
d70f90d8
authored
Aug 23, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gifeature/20210819-gj' into 'master'
预告页接口用例 See merge request test-group/kejiji!105
parents
91f894f3
fa696d74
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletion
+70
-1
Preview.java
src/test/java/com/kjj/cases/live/preview/Preview.java
+60
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+4
-1
liveTestNG.xml
src/test/liveTestNG.xml
+6
-0
No files found.
src/test/java/com/kjj/cases/live/preview/Preview.java
0 → 100644
View file @
d70f90d8
package
com
.
kjj
.
cases
.
live
.
preview
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.ThreadSleepUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.*
;
public
class
Preview
implements
Authorization
{
//***************** A类用户使用新版预告页***************
@Test
(
description
=
"查看预告页标题配图"
,
priority
=
1
)
public
void
查看预告页标题配图
(){
visitorAuth22
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//params.put("liveId","Kj21NDM3OTE");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
ANCHOR_previewTitleImg
);
String
titleImg
=
response
.
jsonPath
().
getString
(
"data.titleImg"
);
System
.
out
.
println
(
titleImg
);
Assert
.
assertNotNull
(
titleImg
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_previewTitleImg
,
"获取标题配图失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看抽奖码百分比"
,
priority
=
2
)
public
void
查看抽奖码百分比
(){
visitorAuth22
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//params.put("liveId","Kj21NDM3OTE");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
ANCHOR_overPercent
);
Object
percentMap
=
response
.
jsonPath
().
getJsonObject
(
"data.percentMap"
);
Assert
.
assertNotNull
(
percentMap
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_overPercent
,
"获取抽奖码对应的百分比失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客观看视频的抽奖码"
,
priority
=
3
)
public
void
访客观看视频的抽奖码
(){
visitorAuth22
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
"Kj21NDM3OTE"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
ANCHOR_watchVideo
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_watchVideo
,
"访客观看视频的抽奖码失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"大奖展示"
,
priority
=
4
)
//ANCHOR_mainWelfare
public
void
访客大奖展示
(){
visitorAuth22
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
//params.put("liveId","Kj21NDM3OTE");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
ANCHOR_mainWelfare
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
ANCHOR_mainWelfare
,
"未获取到大奖"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
d70f90d8
...
...
@@ -111,7 +111,10 @@ public class BasicConfig {
public
static
final
String
MANAGER_preViewWelfareList
=
MANAGER_HOST
+
"/kjy/manager/preView/conf/welfareList"
;
public
static
final
String
MANAGER_confMainWelfare
=
MANAGER_HOST
+
"/kjy/manager/preView/conf/confMainWelfare"
;
public
static
final
String
MANAGER_getMainWelfare
=
MANAGER_HOST
+
"/kjy/manager/preView/conf/getMainWelfare"
;
public
static
final
String
ANCHOR_previewTitleImg
=
MOBILE_HOST
+
"/kjy/live/user/preview/titleImg"
;
public
static
final
String
ANCHOR_overPercent
=
MOBILE_HOST
+
"/kjy/live/overPercent"
;
public
static
final
String
ANCHOR_watchVideo
=
MOBILE_HOST
+
"/kjy/live/watchVideo"
;
public
static
final
String
ANCHOR_mainWelfare
=
MOBILE_HOST
+
"/kjy/live/user/preview/mainWelfare"
;
// *************** 好运红包 ***************
public
static
final
String
MANAGER_redSaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/fortune/red/saveOrUpdate"
;
public
static
final
String
MANAGER_redConfDetail
=
MANAGER_HOST
+
"/kjy/manager/live/fortune/red/confDetail"
;
...
...
src/test/liveTestNG.xml
View file @
d70f90d8
...
...
@@ -55,6 +55,12 @@
</classes>
</test>
<test
preserve-order=
"false"
name=
"预告页"
>
<classes>
<class
name=
"com.kjj.cases.live.preview.Preview"
/>
</classes>
</test>
<test
preserve-order=
"false"
name=
"翻牌集字红包"
>
<classes>
<class
name=
"com.kjj.cases.live.flipCard.FlipCard"
/>
...
...
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