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
2349535d
Commit
2349535d
authored
Dec 01, 2020
by
zhangyumeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取课程id前增加创建课程链路
parent
c4a2f029
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
18 deletions
+40
-18
src/main/java/com/live/cases/apollo/TestCourseLaunch.java
+2
-3
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
+5
-4
src/main/java/com/live/cases/apollo/TestSendNotify2Student.java
+5
-6
src/main/java/com/live/utils/GetLiveCourseId.java
+21
-5
src/main/resources/apicase/api-b.json
+7
-0
No files found.
src/main/java/com/live/cases/apollo/TestCourseLaunch.java
View file @
2349535d
...
@@ -20,6 +20,7 @@ import java.util.List;
...
@@ -20,6 +20,7 @@ import java.util.List;
*/
*/
public
class
TestCourseLaunch
extends
XMBaseTest
{
public
class
TestCourseLaunch
extends
XMBaseTest
{
@BeforeMethod
@BeforeMethod
public
void
beforeTest
(){
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B_Apollo
)
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B_Apollo
)
...
@@ -32,10 +33,8 @@ public class TestCourseLaunch extends XMBaseTest {
...
@@ -32,10 +33,8 @@ public class TestCourseLaunch extends XMBaseTest {
@Test
@Test
public
void
courseLaunch
(){
public
void
courseLaunch
(){
GetLiveCourseId
liveCourseId
=
new
GetLiveCourseId
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
.
createCourse
()
);
jsonObject
.
put
(
"liveCourseId"
,
"1333692400423833602"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
...
...
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
View file @
2349535d
...
@@ -9,8 +9,6 @@ import com.xiaomai.utils.XMBaseTest;
...
@@ -9,8 +9,6 @@ import com.xiaomai.utils.XMBaseTest;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* title B端获取直播课下转码后的文档列表
* title B端获取直播课下转码后的文档列表
...
@@ -18,6 +16,9 @@ import java.util.List;
...
@@ -18,6 +16,9 @@ import java.util.List;
*/
*/
public
class
TestGetCourseDocList
extends
XMBaseTest
{
public
class
TestGetCourseDocList
extends
XMBaseTest
{
GetLiveCourseId
tools
=
new
GetLiveCourseId
();
@BeforeMethod
@BeforeMethod
public
void
beforeTest
()
{
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B_Apollo
)
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B_Apollo
)
...
@@ -30,10 +31,10 @@ public class TestGetCourseDocList extends XMBaseTest {
...
@@ -30,10 +31,10 @@ public class TestGetCourseDocList extends XMBaseTest {
@Test
@Test
public
void
getCourseDocList
()
{
public
void
getCourseDocList
()
{
GetLiveCourseId
liveCourseId
=
new
GetLiveCourseId
();
String
id
=
tools
.
createCourse
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
.
createCourse
()
);
jsonObject
.
put
(
"liveCourseId"
,
id
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
...
...
src/main/java/com/live/cases/apollo/TestSendNotify2Student.java
View file @
2349535d
...
@@ -9,15 +9,14 @@ import com.xiaomai.utils.XMBaseTest;
...
@@ -9,15 +9,14 @@ import com.xiaomai.utils.XMBaseTest;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* 直播课群发学生
* 直播课群发学生
* by 张雨朦
* by 张雨朦
*/
*/
public
class
TestSendNotify2Student
extends
XMBaseTest
{
public
class
TestSendNotify2Student
extends
XMBaseTest
{
GetLiveCourseId
tools
=
new
GetLiveCourseId
();
@BeforeMethod
@BeforeMethod
public
void
beforeTest
()
{
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B_Apollo
)
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B_Apollo
)
...
@@ -30,11 +29,11 @@ public class TestSendNotify2Student extends XMBaseTest {
...
@@ -30,11 +29,11 @@ public class TestSendNotify2Student extends XMBaseTest {
@Test
@Test
public
void
getCourseDocList
()
{
public
void
getCourseDocList
()
{
GetLiveCourseId
liveCourseId
=
new
GetLiveCourseId
();
String
id
=
tools
.
createCourse
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
.
createCourse
()
);
jsonObject
.
put
(
"liveCourseId"
,
id
);
jsonObject
.
put
(
"instId"
,
data
Api
.
getLoginInfo
().
getInstId
());
jsonObject
.
put
(
"instId"
,
xmApp
Api
.
getLoginInfo
().
getInstId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
...
...
src/main/java/com/live/utils/GetLiveCourseId.java
View file @
2349535d
...
@@ -3,7 +3,6 @@ package com.live.utils;
...
@@ -3,7 +3,6 @@ package com.live.utils;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
com.xiaomai.utils.XMBaseTest
;
...
@@ -16,18 +15,35 @@ import java.util.ArrayList;
...
@@ -16,18 +15,35 @@ import java.util.ArrayList;
public
class
GetLiveCourseId
extends
XMBaseTest
{
public
class
GetLiveCourseId
extends
XMBaseTest
{
/**
* 获取机构员工列表
* @return teacherId
*/
public
String
createCourse
(){
public
String
createCourse
(){
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_
createBigLiveCours
e"
)
.
setApiName
(
"API_
getInstAdminExdOnePag
e"
)
.
setTerminal
(
Terminal
.
B
);
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
();
super
.
beforeDataRequest
();
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"state"
,
"VALID"
);
dataApi
.
doRequest
(
com
.
live
.
enums
.
RequestType
.
JSON
,
dataparams
,
obj
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
String
teacherID
=
dataApi
.
getBodyInJSON
().
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getJSONObject
(
"instAdmin"
).
getString
(
"teacherId"
);
/**
*请求创建大班直播课接口
*/
dataApi
.
setApiName
(
"API_createBigLiveCourse"
);
super
.
beforeDataRequest
();
//重置请求接口,否则会请求到上面API_getInstAdminExdOnePage
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
TimeSetting
startTime
=
new
TimeSetting
();
TimeSetting
startTime
=
new
TimeSetting
();
jsonObject
.
put
(
"startTime"
,
startTime
.
startTime
());
jsonObject
.
put
(
"startTime"
,
startTime
.
startTime
());
TimeSetting
endTime
=
new
TimeSetting
();
TimeSetting
endTime
=
new
TimeSetting
();
jsonObject
.
put
(
"endTime"
,
endTime
.
endTime
());
jsonObject
.
put
(
"endTime"
,
endTime
.
endTime
());
jsonObject
.
put
(
"teacherId"
,
"1323235986786807809"
);
jsonObject
.
put
(
"teacherId"
,
teacherID
);
jsonObject
.
put
(
"liveType"
,
"LARGE_CLASS_LIVE"
);
jsonObject
.
put
(
"liveType"
,
"LARGE_CLASS_LIVE"
);
jsonObject
.
put
(
"adminIds"
,
new
ArrayList
<>());
jsonObject
.
put
(
"adminIds"
,
new
ArrayList
<>());
jsonObject
.
put
(
"courseName"
,
"自动化创建直播课"
);
jsonObject
.
put
(
"courseName"
,
"自动化创建直播课"
);
...
@@ -40,8 +56,8 @@ public class GetLiveCourseId extends XMBaseTest {
...
@@ -40,8 +56,8 @@ public class GetLiveCourseId extends XMBaseTest {
dataApi
.
doRequest
(
com
.
live
.
enums
.
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
com
.
live
.
enums
.
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
dataApi
.
getBodyInJSON
();
JSONObject
responseRes
=
dataApi
.
getBodyInJSON
();
String
liveCourseID
=
responseRes
.
getString
(
"result"
);
String
liveCourseID
=
responseRes
.
getString
(
"result"
);
//获取课程id
return
liveCourseID
;
return
liveCourseID
;
//返回课程id
}
}
...
...
src/main/resources/apicase/api-b.json
View file @
2349535d
...
@@ -100,5 +100,11 @@
...
@@ -100,5 +100,11 @@
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"创建大班直播课"
,
"apiName"
:
"创建大班直播课"
,
"desc"
:
"创建大班直播课"
"desc"
:
"创建大班直播课"
},
"API_getInstAdminExdOnePage"
:
{
"apiPath"
:
"/business/public/admin/getInstAdminExdOnePage"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"获取机构老师id"
,
"desc"
:
"获取机构老师id"
}
}
}
}
\ 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