Commit 2349535d by zhangyumeng

获取课程id前增加创建课程链路

parent c4a2f029
......@@ -20,6 +20,7 @@ import java.util.List;
*/
public class TestCourseLaunch extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo)
......@@ -32,10 +33,8 @@ public class TestCourseLaunch extends XMBaseTest {
@Test
public void courseLaunch(){
GetLiveCourseId liveCourseId = new GetLiveCourseId();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId",liveCourseId.createCourse());
jsonObject.put("liveCourseId","1333692400423833602");
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
......
......@@ -9,8 +9,6 @@ import com.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* title B端获取直播课下转码后的文档列表
......@@ -18,6 +16,9 @@ import java.util.List;
*/
public class TestGetCourseDocList extends XMBaseTest {
GetLiveCourseId tools = new GetLiveCourseId();
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo)
......@@ -30,10 +31,10 @@ public class TestGetCourseDocList extends XMBaseTest {
@Test
public void getCourseDocList() {
GetLiveCourseId liveCourseId = new GetLiveCourseId();
String id = tools.createCourse();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", liveCourseId.createCourse());
jsonObject.put("liveCourseId", id);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
......
......@@ -9,15 +9,14 @@ import com.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* 直播课群发学生
* by 张雨朦
*/
public class TestSendNotify2Student extends XMBaseTest {
GetLiveCourseId tools = new GetLiveCourseId();
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo)
......@@ -30,11 +29,11 @@ public class TestSendNotify2Student extends XMBaseTest {
@Test
public void getCourseDocList() {
GetLiveCourseId liveCourseId = new GetLiveCourseId();
String id = tools.createCourse();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", liveCourseId.createCourse());
jsonObject.put("instId",dataApi.getLoginInfo().getInstId());
jsonObject.put("liveCourseId",id);
jsonObject.put("instId",xmAppApi.getLoginInfo().getInstId());
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
......
......@@ -3,7 +3,6 @@ package com.live.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
......@@ -16,18 +15,35 @@ import java.util.ArrayList;
public class GetLiveCourseId extends XMBaseTest {
/**
* 获取机构员工列表
* @return teacherId
*/
public String createCourse(){
dataApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_createBigLiveCourse")
.setApiName("API_getInstAdminExdOnePage")
.setTerminal(Terminal.B);
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();
TimeSetting startTime = new TimeSetting();
jsonObject.put("startTime", startTime.startTime());
TimeSetting endTime = new TimeSetting();
jsonObject.put("endTime", endTime.endTime());
jsonObject.put("teacherId","1323235986786807809");
jsonObject.put("teacherId",teacherID);
jsonObject.put("liveType", "LARGE_CLASS_LIVE");
jsonObject.put("adminIds", new ArrayList<>());
jsonObject.put("courseName", "自动化创建直播课");
......@@ -40,8 +56,8 @@ public class GetLiveCourseId extends XMBaseTest {
dataApi.doRequest(com.live.enums.RequestType.JSON,dataparams,jsonObject.toJSONString(),dataheadrs).assetsSuccess(true);
JSONObject responseRes = dataApi.getBodyInJSON();
String liveCourseID = responseRes.getString("result");
return liveCourseID;
String liveCourseID = responseRes.getString("result"); //获取课程id
return liveCourseID; //返回课程id
}
......
......@@ -100,5 +100,11 @@
"apiContentType": "application/json;charset=utf-8",
"apiName": "创建大班直播课",
"desc": "创建大班直播课"
},
"API_getInstAdminExdOnePage": {
"apiPath": "/business/public/admin/getInstAdminExdOnePage",
"apiContentType": "application/json;charset=utf-8",
"apiName": "获取机构老师id",
"desc": "获取机构老师id"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment