Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-autotest-live
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-autotest-live
Commits
c507bff1
Commit
c507bff1
authored
Feb 07, 2021
by
fanyuanmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增视频课次列表接口
parent
e23bd98e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
src/main/java/com/live/cases/apollo/TestLessonScheduleListPage.java
+79
-0
No files found.
src/main/java/com/live/cases/apollo/TestLessonScheduleListPage.java
0 → 100644
View file @
c507bff1
package
com
.
live
.
cases
.
apollo
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
jdk.nashorn.internal.runtime.options.LoggingOption
;
import
org.json.JSONObject
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/*
* fym
* 2021-2-6
* */
public
class
TestLessonScheduleListPage
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_lessonScheduleListPage"
)
// API 名称 必传
.
setLoginUser
(
"fym-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
//默认视频课次列表
@Test
public
void
testLessonScheduleListPage
(){
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"instId"
,
xmAppApi
.
getLoginInfo
().
getInstId
());
bodyMap
.
put
(
"size"
,
10
);
JSONObject
jsonObject
=
new
JSONObject
(
bodyMap
);
String
bodyData
=
jsonObject
.
toString
();
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodyData
,
headers
);
System
.
out
.
println
(
xmAppApi
);
com
.
alibaba
.
fastjson
.
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
//按条件查询
@Test
public
void
testLessonScheduleListPageOrder
(){
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"instId"
,
xmAppApi
.
getLoginInfo
().
getInstId
());
bodyMap
.
put
(
"size"
,
10
);
bodyMap
.
put
(
"beginTime"
,
"1612627200000"
);
bodyMap
.
put
(
"endTime"
,
"1612713599999"
);
bodyMap
.
put
(
"teacherId"
,
"1303609085537103873"
);
bodyMap
.
put
(
"scheduleName"
,
"小王老师视频课接口测试"
);
JSONObject
jsonObject
=
new
JSONObject
(
bodyMap
);
String
bodyData
=
jsonObject
.
toString
();
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodyData
,
headers
);
System
.
out
.
println
(
xmAppApi
);
com
.
alibaba
.
fastjson
.
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
"1"
,
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"total"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
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