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
29b275b0
Commit
29b275b0
authored
Feb 21, 2021
by
fanyuanmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create:新增接口
parent
843621df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
11 deletions
+96
-11
src/main/java/com/live/cases/videoClass/TestRemoveLessonScheduleStu.java
+65
-0
src/main/java/com/live/xmutils/GetVideoClassData.java
+23
-11
src/main/resources/apicase/api-video-b.json
+8
-0
No files found.
src/main/java/com/live/cases/videoClass/TestRemoveLessonScheduleStu.java
0 → 100644
View file @
29b275b0
package
com
.
live
.
cases
.
videoClass
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.client.XMAppApi
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
com.live.xmutils.GetVideoClassData
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author fym
* @date 2021/2/21 4:32 下午
*/
public
class
TestRemoveLessonScheduleStu
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_Video
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_removeLessonScheduleStu"
)
// API 名称 必传
.
setLoginUser
(
"fym-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"樊圆梦"
);
super
.
beforeTest
();
}
@Test
public
void
testRemoveLessonScheduleStu
()
throws
InterruptedException
{
GetVideoClassData
getVideoClassData
=
new
GetVideoClassData
();
String
scheduleId
=
getVideoClassData
.
addLessonScheduleStu
();
List
studentIds
=
new
ArrayList
();
studentIds
.
add
(
"1308376918943268866"
);
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"scheduleId"
,
scheduleId
);
bodyMap
.
put
(
"instId"
,
xmAppApi
.
getLoginInfo
().
getInstId
());
bodyMap
.
put
(
"studentIds"
,
studentIds
);
org
.
json
.
JSONObject
jsonObject
=
new
org
.
json
.
JSONObject
(
bodyMap
);
String
bodyData
=
jsonObject
.
toString
();
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodyData
,
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody0
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
jsonBody0
);
Assert
.
assertEquals
(
"0"
,
getVideoClassData
.
VideoClassData
().
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"stuNum"
));
}
}
src/main/java/com/live/xmutils/GetVideoClassData.java
View file @
29b275b0
...
...
@@ -110,6 +110,8 @@ public class GetVideoClassData extends XMBaseTest {
//查询课次详情
public
JSONObject
classDetail
()
throws
InterruptedException
{
String
scheduleId
=
createVideoClass
();
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_Video
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getLessonScheduleDetail"
)
// API 名称 必传
.
setLoginUser
(
"fym-b"
)
// http 接口,测试账号 必传
...
...
@@ -117,7 +119,7 @@ public class GetVideoClassData extends XMBaseTest {
super
.
beforeDataRequest
();
String
scheduleId
=
createVideoClass
();
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"scheduleId"
,
scheduleId
);
...
...
@@ -134,32 +136,37 @@ public class GetVideoClassData extends XMBaseTest {
}
//查询视频课学员列表
public
JSONObject
getLessonStudentsPage
(){
//添加视频课学员
public
String
addLessonScheduleStu
()
throws
InterruptedException
{
String
scheduleId
=
createVideoClass
();
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_Video
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_
getLessonScheduleStuPage
"
)
// API 名称 必传
.
setApiName
(
"API_
addLessonScheduleStu
"
)
// API 名称 必传
.
setLoginUser
(
"fym-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeDataRequest
();
System
.
out
.
println
(
"this方法======="
+
dataApi
);
String
scheduleId
=
VideoClassData
().
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
List
studentIds
=
new
ArrayList
();
studentIds
.
add
(
"1308376918943268866"
);
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"size"
,
10
);
bodyMap
.
put
(
"instId"
,
dataApi
.
getLoginInfo
().
getInstId
());
bodyMap
.
put
(
"scheduleId"
,
scheduleId
);
bodyMap
.
put
(
"studentIds"
,
studentIds
);
org
.
json
.
JSONObject
jsonObject
=
new
org
.
json
.
JSONObject
(
bodyMap
);
String
bodyData
=
jsonObject
.
toString
();
dataApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodyData
,
headers
);
System
.
out
.
println
(
dataApi
);
JSONObject
jsonBodyStudentPage
=
dataApi
.
getBodyInJSON
();
return
jsonBodyStudentPage
;
JSONObject
jsonBody0
=
dataApi
.
getBodyInJSON
();
System
.
out
.
println
(
jsonBody0
);
return
scheduleId
;
}
...
...
@@ -172,4 +179,9 @@ public class GetVideoClassData extends XMBaseTest {
}
src/main/resources/apicase/api-video-b.json
View file @
29b275b0
...
...
@@ -74,5 +74,12 @@
"apiContentType"
:
""
,
"apiName"
:
"加入学习"
,
"desc"
:
"加入学习"
},
"API_removeLessonScheduleStu"
:
{
"apiPath"
:
"/apollo/public/apollo/removeLessonScheduleStu"
,
"apiContentType"
:
""
,
"apiName"
:
"移出视频课学员"
,
"desc"
:
"移出视频课学员"
}
}
\ No newline at end of file
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