Commit c49945c9 by fangyuan

Merge remote-tracking branch 'origin/master'

parents 84fbeaed 4b29f8dc
...@@ -24,8 +24,7 @@ public class TestAddRelation extends XMBaseTest { ...@@ -24,8 +24,7 @@ public class TestAddRelation extends XMBaseTest {
.setApiName("api_addRelation") // API 名称 必传 .setApiName("api_addRelation") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传 .setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传) .setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
// dal.setCase_owner("zhangying") dal.setCase_owner("zhangying");
// .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest(); super.beforeTest();
} }
......
package com.live.cases.apollo;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import com.live.xmutils.GetLiveCourseData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @author zhangying
* @date 2021/2/8 11:42
*/
public class TestAuthenticateMqtt extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_authenticateMqtt") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 测试直播客户端mqtt授权
*/
@Test
public void testAuthenticateMqtt() {
GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
JSONObject largeClassCourse = getLiveCourseData.getLargeClassLiveList();
String liveCourseId=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("liveCourseId");
System.out.println("liveCourseId ="+liveCourseId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId",liveCourseId);
jsonObject.put("userId",xmAppApi.getLoginInfo().getUid());
jsonObject.put("role","ANCHOR");
jsonObject.put("visitorType","PLAYBACK");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals("liveMessageTopic", jsonBody.getJSONObject("result").getString("mqttTopic"));
}
}
...@@ -32,14 +32,9 @@ public class TestChangeCourseState extends XMBaseTest { ...@@ -32,14 +32,9 @@ public class TestChangeCourseState extends XMBaseTest {
@Test @Test
public void testChangeCourseState() { public void testChangeCourseState() {
GetLiveCourseData getLiveCourseData=new GetLiveCourseData(); GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList(); JSONObject largeCourse=getLiveCourseData.createLargeClassLive();
JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0); String liveCourseId=largeCourse.getString("result");
String liveCourseId= (String) liveCourse.get("liveCourseId");
if (liveCourseId==null){
largeClassCourse=getLiveCourseData.createLargeClassLive();
liveCourseId= (String) largeClassCourse.get("liveCourseId");
}
System.out.println("liveCourseId ="+liveCourseId); System.out.println("liveCourseId ="+liveCourseId);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
...@@ -47,13 +42,15 @@ public class TestChangeCourseState extends XMBaseTest { ...@@ -47,13 +42,15 @@ public class TestChangeCourseState extends XMBaseTest {
jsonObject.put("courseState","STARTING"); jsonObject.put("courseState","STARTING");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON(); JSONObject jsonBody = xmAppApi.getBodyInJSON();
JSONObject classLiveList = getLiveCourseData.getLargeClassLiveList();
Assert.assertEquals("true", jsonBody.getString("success")); Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message")); Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals("STARTING", classLiveList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("courseState"));
Assert.assertEquals(liveCourseId,classLiveList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("liveCourseId"));
} }
} }
...@@ -13,7 +13,7 @@ import org.testng.annotations.Test; ...@@ -13,7 +13,7 @@ import org.testng.annotations.Test;
/** /**
* title 客户端获取直播课下转码后的文档列表 * title 客户端获取直播课下转码后的文档列表
* by 张雨朦 * by 张雨朦-->zhangying
*/ */
public class TestGetCourseDocList extends XMBaseTest { public class TestGetCourseDocList extends XMBaseTest {
...@@ -23,21 +23,25 @@ public class TestGetCourseDocList extends XMBaseTest { ...@@ -23,21 +23,25 @@ public class TestGetCourseDocList extends XMBaseTest {
public void beforeTest() { public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
.setApiName("API_getCourseDocList") .setApiName("API_getCourseDocList")
.setLoginUser("zhangYuM_b") .setLoginUser("zhangy-b")
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
super.beforeTest(); super.beforeTest();
} }
@Test @Test
public void getCourseDocList() { public void getCourseDocList() {
GetLiveCourseId tools = new GetLiveCourseId(); // GetLiveCourseId tools = new GetLiveCourseId();
String id = tools.createCourse(); // String id = tools.createCourse();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", id); jsonObject.put("liveCourseId", "1356798987214893057");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject responseRes = xmAppApi.getBodyInJSON(); JSONObject responseRes = xmAppApi.getBodyInJSON();
Assert.assertNotNull(responseRes); System.out.println("responseRes= "+responseRes);
Assert.assertNotEquals(0,responseRes.getJSONArray("result").size());
Assert.assertEquals("true", responseRes.getString("success"));
Assert.assertEquals("操作成功!", responseRes.getString("message"));
// Assert.assertNotNull(responseRes);
} }
} }
package com.live.cases.classReport;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* 获取课次课堂报告(老师查看)
* by 张雨朦
*/
public class TestGetClassReport extends XMBaseTest {
//GetLiveCourseId tools = new GetLiveCourseId();
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_getClassReport")
.setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B);
super.beforeTest();
}
@Test
public void getClassReport() {
//String id = tools.createCourse();
JSONObject jsonObject = new JSONObject();
jsonObject.put("courseId","1334393215933386754");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
}
}
//package com.live.cases.classReport;
//import com.alibaba.fastjson.JSONObject;
//import com.live.enums.ApiModele;
//import com.live.enums.RequestType;
//import com.live.enums.Terminal;
//import com.live.xmutils.GetStudentId;
//import com.live.utils.XMBaseTest;
//import org.testng.Assert;
//import org.testng.annotations.BeforeMethod;
//import org.testng.annotations.Test;
//
//
///**
// * 获取学生课堂报告
// * by 张雨朦
// */
//
//public class TestGetStudentReport extends XMBaseTest {
// GetStudentId tools = new GetStudentId();
//
// @BeforeMethod
// public void beforeTest(){
// xmAppApi.setApiModule(ApiModele.CloudClass_B)
// .setApiName("API_getStudentReport")
// .setLoginUser("zhangYuM_b")
// .setTerminal(Terminal.B);
// super.beforeTest();
// }
//
// //@Test
// public void getStudentReport() {
//
// String id = tools.getFinishLiveCourseId();
//
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("courseId","1334309884730617857");
// jsonObject.put("studentId","1330861588678483970");
//
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
// JSONObject responseRes = xmAppApi.getBodyInJSON();
// Assert.assertEquals("success",true);
// }
//
//
//}
package com.live.cases.fileManage.commonFolder;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest;
import com.live.xmutils.GetFolderData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangying
* @date 2021/2/8 3:23 下午
*/
public class TestAddFileUserAuthorityList extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_addFileUserAuthorityList") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 测试资料云盘-公共文件夹添加成员
*/
@Test
public void testAddFileUserAuthorityList() {
GetFolderData commonFolderList = new GetFolderData();
JSONObject FolderList = commonFolderList.getCommonFolderList();
System.out.println("FolderList= " + FolderList);
JSONObject rightsListObject = new JSONObject();
rightsListObject.put("rights","LOOK_DOWNLOAD");
rightsListObject.put("userId","1244920914395918338");
List rightsList = new ArrayList();
rightsList.add(rightsListObject);
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId", "1235115978015883266");
jsonObject.put("id", "1362659086265585665");
jsonObject.put("createId",xmAppApi.getLoginInfo().getAid());
jsonObject.put("disk", "COMMON");
jsonObject.put("rightsList", rightsList);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
Assert.assertEquals("true", jsonBody.getString("success"));
}
}
package com.live.cases.fileManage.commonFolder;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/11/16
*/
public class TestSaveFolder extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_saveFolder") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 测试资料云盘-新增保存文件夹
*/
@Test
public void testSaveFolder() {
String name = "测试文件夹新增"+ RandomStringUtil.randomString(6); //云盘文件名称
JSONObject jsonObject = new JSONObject();
jsonObject.put("createUser", "ADMIN");
jsonObject.put("disk", "COMMON");
jsonObject.put("folderTypeEnum", "FOLDER");
jsonObject.put("instId", "1235115978015883266");
jsonObject.put("name", name);
jsonObject.put("parentId", null);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
Assert.assertEquals("true", jsonBody.getString("success"));
// Assert.assertNotEquals(folderName1,folderName);
}
}
package com.live.cases.fileManage.employeeFolder;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2021/02/07
*/
public class TestEmployeeFolderList1 extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_employeeFolderList") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 测试资料云盘-员工文件列表
*/
@Test
public void testEmployeeFolderList1() {
String name = "测试文件夹新增"+ RandomStringUtil.randomString(6); //云盘文件名称
JSONObject jsonObject = new JSONObject();
jsonObject.put("current", "1");
jsonObject.put("disk", "EMPLOYEE");
jsonObject.put("folderIdType", "FOLDER");
jsonObject.put("instId", "1235115978015883266");
jsonObject.put("searchName", "测试文件夹新增");
jsonObject.put("size", "10");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("1", jsonBody.getJSONObject("result").getString("total"));
Assert.assertEquals(jsonBody.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("folderName"),"测试文件夹新增kl4SLg");
}
}
package com.live.cases.fileManage.myselfFolder;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import com.live.xmutils.GetFolderData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhangying on 2021/2/05
*/
public class TestMoveFolder extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_moveFolder") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试移动文件夹-移动到自身文件夹
*/
@Test
public void testMoveFolder() {
GetFolderData getFolderData = new GetFolderData();
JSONObject folderList = getFolderData.getFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
List moveIds = new ArrayList();
moveIds.add(folderId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("disk","MYSELF");
jsonObject.put("moveIds",moveIds);
jsonObject.put("newParentId",folderId);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
Assert.assertEquals("false", jsonBody.getString("success"));
Assert.assertEquals("不能将文件移动到自身或其子目录下", jsonBody.getString("message"));
}
/**
* 测试移动文件夹-移动到其他文件夹
*/
@Test
public void testMoveFolder1() {
GetFolderData getFolderData = new GetFolderData();
JSONObject folderList = getFolderData.getFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
String folderId1 = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(1).getString("id");
List moveIds = new ArrayList();
moveIds.add(folderId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("disk","MYSELF");
jsonObject.put("moveIds",moveIds);
jsonObject.put("newParentId",folderId1);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
package com.live.cases.fileManage.myselfFolder;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest;
import com.live.xmutils.GetFolderData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhangying on 2021/2/05
*/
public class TestRenameFolder extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_renameFolder") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试移动文件夹-重命名文件夹
*/
@Test
public void testRenameFolder() {
GetFolderData getFolderData = new GetFolderData();
JSONObject folderList = getFolderData.getFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
String folderName = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("folderName");
System.out.println("folderList = "+folderList);
String name = "测试文件夹新增"+ RandomStringUtil.randomString(6); //云盘文件名称
JSONObject jsonObject = new JSONObject();
jsonObject.put("name",name);
jsonObject.put("id",folderId);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody = "+jsonBody);
JSONObject folderList1 = getFolderData.getFolderList();
String folderName1 = folderList1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("folderName");
System.out.println("folderName1 = "+folderName1);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertNotEquals(folderName1,folderName);
}
}
...@@ -46,7 +46,6 @@ public class TestSaveFolder extends XMBaseTest { ...@@ -46,7 +46,6 @@ public class TestSaveFolder extends XMBaseTest {
bodyMap.put("name", name); bodyMap.put("name", name);
bodyMap.put("parentId", null); bodyMap.put("parentId", null);
String bodydata = JSONObject.toJSONString(bodyMap); String bodydata = JSONObject.toJSONString(bodyMap);
// 接口请求 返回responseBody // 接口请求 返回responseBody
......
package com.live.cases.classReport; package com.live.cases.largeClassLive;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
......
...@@ -37,7 +37,6 @@ public class TestGetCourseDetail extends XMBaseTest { ...@@ -37,7 +37,6 @@ public class TestGetCourseDetail extends XMBaseTest {
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi); System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON(); JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("courseName ="+jsonBody.getJSONObject("result"));
Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("liveStudentBaseVO").size(), 0); Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("liveStudentBaseVO").size(), 0);
Assert.assertEquals("true", jsonBody.getString("success")); Assert.assertEquals("true", jsonBody.getString("success"));
......
package com.live.cases.largeClassLive; package com.live.cases.largeClassLive;
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.live.enums.RequestType; import com.live.enums.RequestType;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.TimeSetting;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import org.springframework.transaction.TransactionUsageException;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import sun.font.TrueTypeFont;
import java.util.ArrayList;
/** /**
* Created by zhangying on 2020/02/01 * Created by zhangying on 2020/02/01
......
package com.live.cases.classReport; package com.live.cases.largeClassLive;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
......
package com.live.cases.largeClassLive;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/03
*/
public class TestQueryStudentVisitData extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_queryStudentVisitData") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 乐器陪练直播课-学员上课数据
*/
@Test
public void testQueryStudentVisitData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1356196461296828418");
jsonObject.put("nameOrPhone","");
jsonObject.put("current","1");
jsonObject.put("size","10000");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertNotEquals(0, jsonBody.getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
...@@ -9,9 +9,6 @@ import org.testng.Assert; ...@@ -9,9 +9,6 @@ import org.testng.Assert;
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;
/** /**
* Created by zhangying on 2020/02/02 * Created by zhangying on 2020/02/02
*/ */
......
...@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
import com.live.enums.RequestType; import com.live.enums.RequestType;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.AssertforJson;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
...@@ -49,5 +48,4 @@ public class TestLiveAssetsQuery extends XMBaseTest { ...@@ -49,5 +48,4 @@ public class TestLiveAssetsQuery extends XMBaseTest {
} }
} }
...@@ -5,7 +5,6 @@ import com.live.enums.ApiModele; ...@@ -5,7 +5,6 @@ import com.live.enums.ApiModele;
import com.live.enums.RequestType; import com.live.enums.RequestType;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import com.live.xmutils.GetLiveCourseData;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
......
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import com.live.xmutils.GetOnlyOneClassLiveListData;
import com.live.xmutils.GetOnlyOneCourseData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangying
* @date 2021/2/7 4:55 下午
*/
public class TestAddCourseStu extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_addCourseStu") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("zhangying");
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试乐器陪练课-添加学员"不扣课时学员(自动化测试)"
*/
// @Test
public void testAddCourseStu() {
GetOnlyOneCourseData onlyOneCourseData = new GetOnlyOneCourseData();
JSONObject onlyOneClassCourse = onlyOneCourseData.creatOnlyOneCourse();
String liveCourseId = onlyOneClassCourse.getString("result");
String studentId = "1358297612940660738";
List studentIds = new ArrayList();
studentIds.add(studentId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId",liveCourseId);
jsonObject.put("studentIds",studentIds);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody);
JSONObject onlyOneCourseList = onlyOneCourseData.getOnlyOneCourseList();
String studentId1 = onlyOneCourseList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getJSONArray("liveStudentBaseVO").getJSONObject(0).getString("studentId");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals(studentId, studentId1);
}
/**
* 测试乐器陪练课-添加学员"扣课时学员(自动化测试)"
*/
// @Test
public void testAddCourseStu1() {
GetOnlyOneCourseData onlyOneCourseData = new GetOnlyOneCourseData();
JSONObject onlyOneClassCourse = onlyOneCourseData.creatOnlyOneCourse();
String liveCourseId = onlyOneClassCourse.getString("result");
String studentId = "1358346398485405697";
JSONObject jsondata = new JSONObject();
jsondata.put("name","扣课时学员(自动化测试)");
jsondata.put("phone","12300000003");
jsondata.put("studentId",studentId);
jsondata.put("classHourId","1235120275888328705");
jsondata.put("consumeHourNum","100");
List studentIds = new ArrayList();
studentIds.add(jsondata);
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId",liveCourseId);
jsonObject.put("consumeStudentIds",studentIds);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody);
JSONObject onlyOneCourseList = onlyOneCourseData.getOnlyOneCourseList();
String studentId1 = onlyOneCourseList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getJSONArray("liveStudentBaseVO").getJSONObject(0).getString("studentId");
// System.out.println("onlyOneCourseList = "+onlyOneCourseList);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals(studentId, studentId1);
}
}
...@@ -31,7 +31,7 @@ public class TestCreateOnlyOneClassLive extends XMBaseTest { ...@@ -31,7 +31,7 @@ public class TestCreateOnlyOneClassLive extends XMBaseTest {
* 测试创建乐器陪练课 * 测试创建乐器陪练课
*/ */
@Test @Test
public void testGetOnlyOneClassLiveList() { public void testCreateOnlyOneClassLive() {
JSONObject onlyOneClassLive = new JSONObject(); JSONObject onlyOneClassLive = new JSONObject();
String courseName = RandomStringUtil.randomNumber(14, "live_course_"); String courseName = RandomStringUtil.randomNumber(14, "live_course_");
......
...@@ -5,7 +5,6 @@ import com.live.enums.ApiModele; ...@@ -5,7 +5,6 @@ import com.live.enums.ApiModele;
import com.live.enums.RequestType; import com.live.enums.RequestType;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import com.live.xmutils.GetOnlyOneClassLiveListData;
import com.live.xmutils.GetOnlyOneCourseData; import com.live.xmutils.GetOnlyOneCourseData;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
...@@ -28,25 +27,32 @@ public class TestDelOnlyOneClassLive extends XMBaseTest { ...@@ -28,25 +27,32 @@ public class TestDelOnlyOneClassLive extends XMBaseTest {
} }
/** /**
* 测试删除乐器陪练课 * 测试删除乐器陪练课-课程"zy乐器陪练课1"
*/ */
@Test @Test
public void testDelOnlyOneClassLive() { public void testDelOnlyOneClassLive() {
GetOnlyOneCourseData getOnlyOneCourseData=new GetOnlyOneCourseData();
JSONObject onlyOneClassCourse = getOnlyOneCourseData.getOnlyOneCourseList();
JSONObject liveCourse = onlyOneClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0); JSONObject jsonObject = new JSONObject();
String liveCourseId = (String) liveCourse.get("liveCourseId"); jsonObject.put("liveCourseId","1357508872072433666");
if (liveCourseId == null){
onlyOneClassCourse = getOnlyOneCourseData.creatOnlyOneCourse(); xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
liveCourseId = (String) onlyOneClassCourse.get("liveCourseId"); JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals("直播课已扣学员课时,不支持删除", jsonBody.getString("message"));
} }
System.out.println("liveCourseId ="+liveCourseId);
GetOnlyOneClassLiveListData getOnlyOneClassLiveListData = new GetOnlyOneClassLiveListData();
JSONObject liveList = getOnlyOneClassLiveListData.getOnlyOneClassLiveList() ; /**
JSONObject liveCourseData = liveList.getJSONObject("result").getJSONArray("records").getJSONObject(0); * 测试删除乐器陪练课-删除未成功开课的课程
String courseName = (String) liveCourseData.get("courseName"); */
@Test
public void testDelOnlyOneClassLive1() {
GetOnlyOneCourseData getOnlyOneCourseData=new GetOnlyOneCourseData();
JSONObject onlyOneClassCourse = getOnlyOneCourseData.getOnlyOneCourseList();
String liveCourseId = onlyOneClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("liveCourseId");
String courseName = onlyOneClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("courseName");
System.out.println("courseName ="+courseName); System.out.println("courseName ="+courseName);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
...@@ -55,11 +61,13 @@ public class TestDelOnlyOneClassLive extends XMBaseTest { ...@@ -55,11 +61,13 @@ public class TestDelOnlyOneClassLive extends XMBaseTest {
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON(); JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody);
JSONObject liveList1 = getOnlyOneClassLiveListData.getOnlyOneClassLiveList() ; GetOnlyOneCourseData getOnlyOneCourseData1=new GetOnlyOneCourseData();
JSONObject liveCourseData1 = liveList1.getJSONObject("result").getJSONArray("records").getJSONObject(0); JSONObject onlyOneClassCourse1 = getOnlyOneCourseData1.getOnlyOneCourseList();
String courseName1 = (String) liveCourseData1.get("courseName"); String courseName1 = onlyOneClassCourse1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("courseName");
System.out.println("courseName ="+courseName);
System.out.println("courseName1 ="+courseName1);
Assert.assertEquals("true", jsonBody.getString("success")); Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message")); Assert.assertEquals("操作成功!", jsonBody.getString("message"));
......
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/03
*/
public class TestGetClassReport extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getClassReport") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 乐器陪练-老师课堂报告
*/
@Test
public void testGetClassReport() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("courseId","1357211775460552705");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals(jsonBody.getJSONObject("result").getString("courseName"),"zy乐器陪练自动化测试" );
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/04
*/
public class TestGetCourseDetail extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getCourseDetail") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 查看直播课上课记录详情-乐器陪练课
*/
@Test
public void testGetCourseDetail() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1357211775460552705");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("courseName ="+jsonBody);
Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("liveStudentBaseVO").size(), 0);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
...@@ -5,7 +5,6 @@ import com.live.enums.ApiModele; ...@@ -5,7 +5,6 @@ import com.live.enums.ApiModele;
import com.live.enums.RequestType; import com.live.enums.RequestType;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import com.live.xmutils.GetLiveCourseData;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
...@@ -27,7 +26,7 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest { ...@@ -27,7 +26,7 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
} }
/** /**
* 测试乐器陪练课列表 * 测试乐器陪练课列表-默认查询条件
*/ */
@Test @Test
public void testGetOnlyOneClassLiveList() { public void testGetOnlyOneClassLiveList() {
...@@ -46,5 +45,32 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest { ...@@ -46,5 +45,32 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
} }
/**
* 测试乐器陪练课列表-全部查询条件
*/
@Test
public void testGetOnlyOneClassLiveList1() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId","1235115978015883266");
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("courseName","zy乐器陪练自动化测试");
jsonObject.put("courseState","FINISH");
jsonObject.put("endTime","1612454399999");
jsonObject.put("teacherId","1235115979473997826");
jsonObject.put("teacherName","主账户老师");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertEquals("1", jsonBody.getJSONObject("result").getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
} }
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/03
*/
public class TestGetStudentReport extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getStudentReport") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 乐器陪练直播-查看学员课堂报告
*/
@Test
public void testGetStudentReport() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("courseId","1356196461296828418");
jsonObject.put("studentId","1235119596803903489");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody);
Assert.assertEquals(jsonBody.getJSONObject("result").getString("studentId"), "1235119596803903489");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/04
*/
public class TestGetUseAbleAccountByStudentId extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getUseAbleAccountByStudentId") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 学员上课数据-修改扣课时数,查询学员课时账户
*/
@Test
public void testGetUseAbleAccountByStudentId() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("studentId","1235119596803903489");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertNotEquals(0, jsonBody.getJSONArray("result").size());
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/03
*/
public class TestQueryStudentVisitData extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_queryStudentVisitData") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 乐器陪练直播课-学员上课数据
*/
@Test
public void testQueryStudentVisitData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1357211775460552705");
jsonObject.put("nameOrPhone","");
jsonObject.put("current","1");
jsonObject.put("size","10000");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertNotEquals(0, jsonBody.getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/04
*/
public class TestQueryTeacherVisitData extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_queryTeacherVisitData") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 直播课上课记录-乐器陪练课
*/
@Test
public void testQueryTeacherVisitData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1357211775460552705");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("courseName ="+jsonBody);
Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("visitorInfoVOList").size(), 0);
Assert.assertEquals(jsonBody.getJSONObject("result").getString("createdReport"),"VALID" );
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/04
*/
public class TestUpdateStudentVisitCheckedData extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_updateStudentVisitCheckedData") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 乐器陪练-学员上课数据,学员课时清零之后,修改扣课时数为0
*/
@Test
public void testUpdateStudentVisitCheckedData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("consumeHourClassId","1237292779809337345");
jsonObject.put("consumeHourNum","0");
jsonObject.put("consumeUserId","1235115979394306049");
jsonObject.put("instId","1235115978015883266");
jsonObject.put("liveStudentId","1357211987609444353");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
/**
* 乐器陪练-学员上课数据,学员课时清零之后,修改扣课时数为1
*/
@Test
public void testUpdateStudentVisitCheckedData1() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("consumeHourClassId","1237292779809337345");
jsonObject.put("consumeHourNum","1");
jsonObject.put("consumeUserId","1235115979394306049");
jsonObject.put("instId","1235115978015883266");
jsonObject.put("liveStudentId","1357211987609444353");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertEquals("不能超过剩余课时数", jsonBody.getString("message"));
}
}
package com.live.cases.musicPlay;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/05
*/
public class TestUpdateStudentVisitCheckedData1 extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_updateStudentVisitCheckedData") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 乐器陪练-学员上课数据,学员课时账户有剩余课时,修改扣课时数为1
*/
@Test
public void testUpdateStudentVisitCheckedData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("consumeHourClassId","1237292786664587265");
jsonObject.put("consumeHourNum","1");
jsonObject.put("consumeUserId","1235115979394306049");
jsonObject.put("instId","1235115978015883266");
jsonObject.put("liveStudentId","1357508955417194498");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody );
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
package com.live.cases.videoClass;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
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;
/*
* fym
* 2021-02-07
* */
public class TestCreateLesson extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_createLesson") // API 名称 必传
.setLoginUser("fym-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("樊圆梦");
super.beforeTest();
}
//创建任何学员通过链接加入学习视频课
@Test
public void testCreateLesson(){
String scheduleName = RandomStringUtil.randomNumber(20,"VideoClass_");
List studentIds = new ArrayList();
studentIds.add("");
Map picMap = new HashMap();
picMap.put("size",1791124);
picMap.put("mediaName","微信截图_20190122110413.png");
picMap.put("mediaContent","1358261654633242626");
picMap.put("mediaType","PICTURE");
picMap.put("mediaUrl","blob:https://b.xiaomai5.com/6f8def48-3cc5-4b6b-8266-615ca9129523");
Map textMap = new HashMap();
textMap.put("mediaType","TEXT");
textMap.put("mediaContent","<p>这是视频课简介</p>");
textMap.put("key","XeaxxDS5NmSfjEpp");
textMap.put("mediaContentLength",7);
List scheduleMedia = new ArrayList();
scheduleMedia.add(picMap);
scheduleMedia.add(textMap);
Map bodyMap = new HashMap();
bodyMap.put("size",16341066);
bodyMap.put("instId",xmAppApi.getLoginInfo().getInstId());
bodyMap.put("videoName","胖胖的你悠然自得.mp4");
bodyMap.put("videoDuration",30.808644);
bodyMap.put("scheduleName",scheduleName);
bodyMap.put("scheduleVideoId","1357973439543160834");
bodyMap.put("joinType","ALL");
bodyMap.put("teacherId","1303609085537103873");
bodyMap.put("scheduleMedia",scheduleMedia);
bodyMap.put("studentIds",studentIds);
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();
GetVideoClassData getVideoClassData = new GetVideoClassData();
JSONObject jsonObject1 = getVideoClassData.VideoClassData();
String id = jsonObject1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
Assert.assertEquals(jsonBody.getString("result"),id);
}
}
package com.live.cases.videoClass;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
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/8 2:53 下午
*/
public class TestEditLessonSchedule extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_Video) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_editLessonSchedule") // API 名称 必传
.setLoginUser("fym-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("樊圆梦");
super.beforeTest();
}
@Test
public void testEditLessonSchedule(){
String scheduleName = RandomStringUtil.randomNumber(30,"editVideoClass_");
List studentIds = new ArrayList();
studentIds.add("");
Map picMap = new HashMap();
picMap.put("size",1791124);
picMap.put("mediaName","微信截图_20190122110413.png");
picMap.put("mediaContent","1358261654633242626");
picMap.put("mediaType","PICTURE");
picMap.put("mediaUrl","https://xm-prod-resource.oss-cn-hangzhou.aliyuncs.com/inst/1301797436402806785/live/course/20210207114948/PSrKzRihxMfKGifw.png?Expires=1612854029&OSSAccessKeyId=LTAI2rWiIxxdBo0w&Signature=Oa90KZ%2Bz8Wkm8%2FrZ6FygjcAIRBU%3D");
picMap.put("contentType","INTRO");
Map textMap = new HashMap();
textMap.put("mediaType","TEXT");
textMap.put("mediaContent","<p>这是视频课简介</p>");
textMap.put("contentType","INTRO");
textMap.put("mediaContentLength",7);
List scheduleMedia = new ArrayList();
scheduleMedia.add(picMap);
scheduleMedia.add(textMap);
GetVideoClassData getVideoClassData = new GetVideoClassData();
JSONObject jsonBody = getVideoClassData.VideoClassData();
String id = jsonBody.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
Map bodyMap = new HashMap();
bodyMap.put("id",id);
bodyMap.put("instId",xmAppApi.getLoginInfo().getInstId());
bodyMap.put("videoName","胖胖的你悠然自得.mp4");
bodyMap.put("videoDuration",30);
bodyMap.put("scheduleName",scheduleName);
bodyMap.put("scheduleVideoId","1357973439543160834");
bodyMap.put("joinType","ALL");
bodyMap.put("teacherId","1303609085537103873");
bodyMap.put("scheduleMedia",scheduleMedia);
bodyMap.put("studentIds",studentIds);
JSONObject jsonObject = new JSONObject(bodyMap);
String bodyData = jsonObject.toString();
xmAppApi.doRequest(RequestType.JSON, params, bodyData, headers);
System.out.println(xmAppApi);
com.alibaba.fastjson.JSONObject jsonBody0 = xmAppApi.getBodyInJSON();
JSONObject jsonObject1 = getVideoClassData.VideoClassData();
Assert.assertEquals(scheduleName,jsonObject1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("scheduleName"));
}
}
package com.live.cases.videoClass;
import com.alibaba.fastjson.JSONObject;
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 sun.awt.X11FontManager;
import java.util.HashMap;
import java.util.Map;
/**
* @author fym
* @date 2021/2/8 11:53 上午
*/
public class TestGetLessonScheduleDetail extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_Video) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getLessonScheduleDetail") // API 名称 必传
.setLoginUser("fym-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("樊圆梦");
super.beforeTest();
}
@Test
public void testGetLessonScheduleDetail(){
GetVideoClassData getVideoClassData = new GetVideoClassData();
JSONObject jsonBody = getVideoClassData.VideoClassData();
String scheduleId = jsonBody.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
Map bodyMap = new HashMap();
bodyMap.put("scheduleId",scheduleId);
JSONObject jsonObject = new JSONObject(bodyMap);
String bodyData = jsonObject.toString();
xmAppApi.doRequest(RequestType.JSON, params, bodyData, headers);
System.out.println(xmAppApi);
com.alibaba.fastjson.JSONObject jsonBody0 = xmAppApi.getBodyInJSON();
JSONObject jsonObject1 = getVideoClassData.VideoClassData();
String scheduleId0 = jsonObject1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
Assert.assertEquals(scheduleId0,jsonBody0.getJSONObject("result").getString("id"));//与列表第一个视频课id比对
}
}
package com.live.cases.videoClass;
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端等, 必传)
dal.setCase_owner("樊圆梦");
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"));
}
}
...@@ -57,7 +57,10 @@ public class GetFolderData extends XMBaseTest { ...@@ -57,7 +57,10 @@ public class GetFolderData extends XMBaseTest {
return response; return response;
} }
public List getFolderList() { /**
* 资料云盘-我的文件
*/
public JSONObject getFolderList() {
dataApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址 dataApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_folderList") // API 名称 必传 .setApiName("API_folderList") // API 名称 必传
...@@ -68,28 +71,49 @@ public class GetFolderData extends XMBaseTest { ...@@ -68,28 +71,49 @@ public class GetFolderData extends XMBaseTest {
super.beforeDataRequest(); super.beforeDataRequest();
Map bodyMap = new HashMap(); JSONObject jsonObject = new JSONObject();
bodyMap.put("current", 1); jsonObject.put("current", 1);
bodyMap.put("size", 10); jsonObject.put("size", 10);
bodyMap.put("disk", "MYSELF"); jsonObject.put("disk", "MYSELF");
String bodydata = JSONObject.toJSONString(bodyMap); // String jsonObject = JSONObject.toJSONString(jsonObject);
dataApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(dataApi);
JSONObject jsonBody = dataApi.getBodyInJSON();
return jsonBody;
}
/**
* 资料云盘-公共文件
*/
public JSONObject getCommonFolderList() {
dataApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_folderList") // API 名称 必传
.setEnv("prod") // 运行环境 测试时可指定自己要运行的环境。 不穿默认取系统指定的允许环境
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeDataRequest();
JSONObject jsonObject = new JSONObject();
jsonObject.put("current", 1);
jsonObject.put("size", 10);
jsonObject.put("disk", "COMMON");
jsonObject.put("folderIdType", "FOLDER");
jsonObject.put("instId", "1235115978015883266");
// jsonObject.put("searchName", "null");
// String jsonObject = JSONObject.toJSONString(jsonObject);
// 接口请求 返回responseBody
Response response = given()
.header("Content-Type", "application/json")
.queryParams(params)
.headers(headers)
.body(bodydata)
.when()
.post(dataApi.getUrl())
.then().log().all()
.extract()
.response();
List folderList = new ArrayList(); dataApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
folderList.add(response.path("result.records")); System.out.println(dataApi);
JSONObject jsonBody = dataApi.getBodyInJSON();
return folderList; return jsonBody;
} }
......
...@@ -26,10 +26,11 @@ public class GetOnlyOneCourseData extends XMBaseTest { ...@@ -26,10 +26,11 @@ public class GetOnlyOneCourseData extends XMBaseTest {
bodyMap.put("current", 1); bodyMap.put("current", 1);
bodyMap.put("instId", "1235115978015883266"); bodyMap.put("instId", "1235115978015883266");
bodyMap.put("size", 10); bodyMap.put("size", 10);
// bodyMap.put("courseState","EXPIRED");
String bodydata = JSONObject.toJSONString(bodyMap); String bodydata = JSONObject.toJSONString(bodyMap);
dataApi.doRequest(RequestType.JSON, params, bodydata, dataheadrs); // dataApi.doRequest(RequestType.JSON, params, bodydata, dataheadrs);
dataApi.doRequest(RequestType.JSON, params, bodydata, headers);
JSONObject liveCourseList=dataApi.getBodyInJSON(); JSONObject liveCourseList=dataApi.getBodyInJSON();
return liveCourseList; return liveCourseList;
...@@ -42,8 +43,8 @@ public class GetOnlyOneCourseData extends XMBaseTest { ...@@ -42,8 +43,8 @@ public class GetOnlyOneCourseData extends XMBaseTest {
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
super.beforeDataRequest(); super.beforeDataRequest();
dataApi.doRequest(RequestType.JSON, params, buildCreateLargeClassLiveParam().toJSONString(), headers);
dataApi.doRequest(RequestType.JSON, params, buildCreateLargeClassLiveParam().toJSONString(), dataheadrs); // dataApi.doRequest(RequestType.JSON, params, buildCreateLargeClassLiveParam().toJSONString(), dataheadrs);
JSONObject liveCourse=dataApi.getBodyInJSON(); JSONObject liveCourse=dataApi.getBodyInJSON();
return liveCourse; return liveCourse;
...@@ -52,10 +53,10 @@ public class GetOnlyOneCourseData extends XMBaseTest { ...@@ -52,10 +53,10 @@ public class GetOnlyOneCourseData extends XMBaseTest {
//组装乐器陪练直播新增的数据 //组装乐器陪练直播新增的数据
public JSONObject buildCreateLargeClassLiveParam() { public JSONObject buildCreateLargeClassLiveParam() {
JSONObject onlyOneClassLive = new JSONObject(); JSONObject onlyOneClassLive = new JSONObject();
onlyOneClassLive.put("courseName", RandomStringUtil.randomNumber(14, "onlyOne_course_")); onlyOneClassLive.put("courseName", RandomStringUtil.randomNumber(14, "course_"));
onlyOneClassLive.put("teacherId",xmAppApi.getLoginInfo().getTid()); onlyOneClassLive.put("teacherId",xmAppApi.getLoginInfo().getTid());
onlyOneClassLive.put("startTime",System.currentTimeMillis() + 60 * 1000); onlyOneClassLive.put("startTime",System.currentTimeMillis() + 60 * 1000);
onlyOneClassLive.put("endTime",System.currentTimeMillis() + 30 * 60 * 1000); onlyOneClassLive.put("endTime",System.currentTimeMillis() + 60 * 60 * 1000);
onlyOneClassLive.put("needRecord","YES"); onlyOneClassLive.put("needRecord","YES");
onlyOneClassLive.put("liveType","SMALL_CLASS_ONLY_ONE"); onlyOneClassLive.put("liveType","SMALL_CLASS_ONLY_ONE");
onlyOneClassLive.put("consumeHourNum",1); onlyOneClassLive.put("consumeHourNum",1);
......
package com.live.xmutils;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author fym
* @date 2021/2/6 6:31 下午
*/
public class GetVideoClassData extends XMBaseTest {
//查询视频课次列表
public JSONObject VideoClassData(){
dataApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_lessonScheduleListPage") // API 名称 必传
.setLoginUser("fym-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeDataRequest();
Map bodyMap = new HashMap();
bodyMap.put("current",1);
bodyMap.put("instId",dataApi.getLoginInfo().getInstId());
bodyMap.put("size",10);
JSONObject jsonObject = new JSONObject(bodyMap);
String bodyData = jsonObject.toString();
dataApi.doRequest(RequestType.JSON, params,bodyData, headers);
JSONObject jsonBody = dataApi.getBodyInJSON();
return jsonBody;
}
//创建视频课(任何人)
public String createVideoClass(){
dataApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_createLesson") // API 名称 必传
.setLoginUser("fym-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeDataRequest();
String scheduleName = RandomStringUtil.randomNumber(20,"VideoClass");
List studentIds = new ArrayList();
studentIds.add("");
Map picMap = new HashMap();
picMap.put("size",1791124);
picMap.put("mediaName","微信截图_20190122110413.png");
picMap.put("mediaContent","1358261654633242626");
picMap.put("mediaType","PICTURE");
picMap.put("mediaUrl","blob:https://b.xiaomai5.com/6f8def48-3cc5-4b6b-8266-615ca9129523");
Map textMap = new HashMap();
textMap.put("mediaType","TEXT");
textMap.put("mediaContent","<p>这是视频课简介</p>");
textMap.put("key","XeaxxDS5NmSfjEpp");
textMap.put("mediaContentLength",7);
List scheduleMedia = new ArrayList();
scheduleMedia.add(picMap);
scheduleMedia.add(textMap);
Map bodyMap = new HashMap();
bodyMap.put("size",16341066);
bodyMap.put("instId",dataApi.getLoginInfo().getInstId());
bodyMap.put("videoName","胖胖的你悠然自得.mp4");
bodyMap.put("videoDuration",30.808644);
bodyMap.put("scheduleName",scheduleName);
bodyMap.put("scheduleVideoId","1357973439543160834");
bodyMap.put("joinType","ALL");
bodyMap.put("teacherId","1303609085537103873");
bodyMap.put("scheduleMedia",scheduleMedia);
bodyMap.put("studentIds",studentIds);
JSONObject jsonObject = new JSONObject(bodyMap);
String bodyData = jsonObject.toString();
dataApi.doRequest(RequestType.JSON, params, bodyData, headers);
System.out.println(dataApi);
com.alibaba.fastjson.JSONObject jsonBody = dataApi.getBodyInJSON();
String scheduleId = jsonBody.getString("result");
return scheduleId;
}
//查询课次详情
public JSONObject classDetail(){
dataApi.setApiModule(ApiModele.CloudClass_Video) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getLessonScheduleDetail") // API 名称 必传
.setLoginUser("fym-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeDataRequest();
String scheduleId = createVideoClass();
Map bodyMap = new HashMap();
bodyMap.put("scheduleId",scheduleId);
JSONObject jsonObject = new JSONObject(bodyMap);
String bodyData = jsonObject.toString();
dataApi.doRequest(RequestType.JSON, params, bodyData, headers);
System.out.println(dataApi);
com.alibaba.fastjson.JSONObject jsonBody = dataApi.getBodyInJSON();
return jsonBody;
}
}
...@@ -33,11 +33,8 @@ public abstract class ApiBaseTestFile extends BaseTest { ...@@ -33,11 +33,8 @@ public abstract class ApiBaseTestFile extends BaseTest {
//设置测试信息:env、Apimodule、Apiname、接口账号信息、端口位 //设置测试信息:env、Apimodule、Apiname、接口账号信息、端口位
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块 xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块
.setApiName(getApiName()) // API 名称 .setApiName(getApiName()) // API 名称
// .setEnv("prod") // 运行环境
.setLoginUser("zhangy-b") // 测试账号 .setLoginUser("zhangy-b") // 测试账号
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传) .setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest(); super.beforeTest();
} }
......
...@@ -154,5 +154,23 @@ ...@@ -154,5 +154,23 @@
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "转成短链接", "apiName": "转成短链接",
"desc": "转成短链接" "desc": "转成短链接"
},
"API_getUseAbleAccountByStudentId": {
"apiPath": "/business/public/classHour/getUseAbleAccountByStudentId",
"apiContentType": "application/json;charset=utf-8",
"apiName": "查询学员课时账户",
"desc": "查询学员课时账户"
},
"API_updateStudentVisitCheckedData": {
"apiPath": "/apollo/public/businessLive/updateStudentVisitCheckedData",
"apiContentType": "application/json;charset=utf-8",
"apiName": "修改学员扣课时",
"desc": "修改学员扣课时"
},
"API_lessonScheduleListPage": {
"apiPath": "/apollo/public/apollo/lessonScheduleListPage",
"apiContentType": "application/json;charset=utf-8",
"apiName": "视频课次列表",
"desc": "视频课次列表"
} }
} }
\ No newline at end of file
...@@ -82,5 +82,26 @@ ...@@ -82,5 +82,26 @@
"apiContentType": "application/json;charset=UTF-8", "apiContentType": "application/json;charset=UTF-8",
"apiName": "删除公共文件", "apiName": "删除公共文件",
"desc": "删除公共文件" "desc": "删除公共文件"
},
"API_renameFolder":
{
"apiPath": "/apollo/public/apollo/renameFolder",
"apiContentType": "application/json;charset=UTF-8",
"apiName": "重命名文件夹",
"desc": "重命名文件夹"
},
"API_addFileUserAuthorityList":
{
"apiPath": "/apollo/public/apollo/addFileUserAuthorityList",
"apiContentType": "application/json;charset=UTF-8",
"apiName": "文件夹添加成员",
"desc": "文件夹添加成员"
},
"API_updateFileUserAuthority":
{
"apiPath": "/apollo/public/apollo/updateFileUserAuthority",
"apiContentType": "application/json;charset=UTF-8",
"apiName": "修改文件夹成员权限",
"desc": "修改文件夹成员权限"
} }
} }
{ {
"api_getLastedVersion": "api_getLastedVersion": {
{
"apiPath": "/apollo/public/version/getLastedVersion", "apiPath": "/apollo/public/version/getLastedVersion",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "获取最新版本号", "apiName": "获取最新版本号",
"desc": "获取最新版本号" "desc": "获取最新版本号"
}, },
"api_addRelation": "api_addRelation": {
{
"apiPath": "/apollo/public/apollo/addRelation", "apiPath": "/apollo/public/apollo/addRelation",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "添加关联文件", "apiName": "添加关联文件",
"desc": "添加关联文件" "desc": "添加关联文件"
}, },
"api_getCourseList": "api_getCourseList": {
{
"apiPath": "/apollo/public/businessLive/getCourseList", "apiPath": "/apollo/public/businessLive/getCourseList",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "获取直播课列表", "apiName": "获取直播课列表",
"desc": "获取直播课列表" "desc": "获取直播课列表"
}, },
"api_queryLiveAccount": "api_queryLiveAccount": {
{
"apiPath": "/apollo/public/businessLive/queryLiveAccount", "apiPath": "/apollo/public/businessLive/queryLiveAccount",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "查询直播账号", "apiName": "查询直播账号",
"desc": "查询直播账号" "desc": "查询直播账号"
}, },
"api_initXmLive": "api_initXmLive": {
{
"apiPath": "/apollo/public/businessLive/initXmLive", "apiPath": "/apollo/public/businessLive/initXmLive",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "初始化直播间数据", "apiName": "初始化直播间数据",
"desc": "初始化直播间数据" "desc": "初始化直播间数据"
}, },
"api_queryStudentByCourseId": "api_queryStudentByCourseId": {
{
"apiPath": "/apollo/public/businessLive/queryStudentByCourseId", "apiPath": "/apollo/public/businessLive/queryStudentByCourseId",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "通过课次查询直播学员", "apiName": "通过课次查询直播学员",
"desc": "通过课次查询直播学员" "desc": "通过课次查询直播学员"
}, },
"api_changeCourseState": "api_changeCourseState": {
{
"apiPath": "/apollo/public/businessLive/changeCourseState", "apiPath": "/apollo/public/businessLive/changeCourseState",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "改变课程状态", "apiName": "改变课程状态",
"desc": "改变课程状态" "desc": "改变课程状态"
}, },
"api_clientLaunch": "api_clientLaunch": {
{
"apiPath": "/apollo/public/businessLive/clientLaunch", "apiPath": "/apollo/public/businessLive/clientLaunch",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "启动直播客户端", "apiName": "启动直播客户端",
"desc": "启动直播客户端" "desc": "启动直播客户端"
}, },
"api_judgeLessonPermission": "api_judgeLessonPermission": {
{
"apiPath": "/public/apollo/judgeLessonPermission", "apiPath": "/public/apollo/judgeLessonPermission",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "判断是否有备课本权限", "apiName": "判断是否有备课本权限",
...@@ -68,7 +59,7 @@ ...@@ -68,7 +59,7 @@
"apiName": "获取直播器启动协议", "apiName": "获取直播器启动协议",
"desc": "获取直播器启动协议" "desc": "获取直播器启动协议"
}, },
"API_getLargeClassLiveList":{ "API_getLargeClassLiveList": {
"apiPath": "/apollo/public/businessLive/getLargeClassLiveList", "apiPath": "/apollo/public/businessLive/getLargeClassLiveList",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "获取大班直播课列表", "apiName": "获取大班直播课列表",
...@@ -81,13 +72,13 @@ ...@@ -81,13 +72,13 @@
"desc": "获取直播课下转码后的文档列表" "desc": "获取直播课下转码后的文档列表"
}, },
"API_sendNotify2Student": { "API_sendNotify2Student": {
"apiPath":"/apollo/public/businessLive/sendNotify2Student", "apiPath": "/apollo/public/businessLive/sendNotify2Student",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "直播课群发学生", "apiName": "直播课群发学生",
"desc": "直播课群发学生" "desc": "直播课群发学生"
}, },
"API_getOnlyOneClassLiveList": { "API_getOnlyOneClassLiveList": {
"apiPath":"/apollo/public/businessLive/getOnlyOneClassLiveList", "apiPath": "/apollo/public/businessLive/getOnlyOneClassLiveList",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "查询乐器陪练课列表", "apiName": "查询乐器陪练课列表",
"desc": "查询乐器陪练课列表" "desc": "查询乐器陪练课列表"
...@@ -181,4 +172,23 @@ ...@@ -181,4 +172,23 @@
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "删除文件", "apiName": "删除文件",
"desc": "删除文件" "desc": "删除文件"
}, },
\ No newline at end of file "API_moveFolder": {
"apiPath": "/apollo/public/apollo/moveFolder",
"apiContentType": "application/json;charset=utf-8",
"apiName": "移动文件",
"desc": "移动文件"
},
"API_addCourseStu": {
"apiPath": "/apollo/public/businessLive/addCourseStu",
"apiContentType": "application/json;charset=utf-8",
"apiName": "课次添加学员",
"desc": "课次添加学员"
},
"API_authenticateMqtt": {
"apiPath": "/apollo/anon/customerLive/authenticateMqtt",
"apiContentType": "application/json;charset=utf-8",
"apiName": "客户端MQTT授权",
"desc": "客户端MQTT授权"
}
}
\ No newline at end of file
...@@ -284,6 +284,29 @@ ...@@ -284,6 +284,29 @@
"tid": "1291264680405467138" "tid": "1291264680405467138"
} }
} }
},
"fym-b": {
"gary": {
"instId": "1301797436402806785",
"instName": "",
"accountNo": "19941192167",
"certificate": "bb426cdfa72944e46068858aca0509ea",
"aid": "1303609085537103873",
"uid": "1303609085558075394",
"userType": "B",
"tid": "1303609085537103873"
},
"prod": {
"instId": "1301797436402806785",
"instName": "",
"accountNo": "19941192167",
"certificate": "bb426cdfa72944e46068858aca0509ea",
"aid": "1303609085537103873",
"uid": "1303609085558075394",
"userType": "B",
"tid": "1303609085537103873"
}
} }
} }
......
...@@ -22,14 +22,9 @@ ...@@ -22,14 +22,9 @@
<package name="com.live.cases.apollo"></package> <package name="com.live.cases.apollo"></package>
</packages> </packages>
</test> </test>
<test name="classReport" preserve-order="true" verbose="3">
<packages>
<package name="com.live.cases.classReport"></package>
</packages>
</test>
<test name="fileManage" preserve-order="true" verbose="3"> <test name="fileManage" preserve-order="true" verbose="3">
<packages> <packages>
<package name="com.live.cases.fileManage"></package> <package name="com.live.cases.fileManage.*"></package>
</packages> </packages>
</test> </test>
<test name="interactionLive" preserve-order="true" verbose="3"> <test name="interactionLive" preserve-order="true" verbose="3">
...@@ -42,4 +37,19 @@ ...@@ -42,4 +37,19 @@
<package name="com.live.cases.largeClassLive"></package> <package name="com.live.cases.largeClassLive"></package>
</packages> </packages>
</test> </test>
<test name="liveAssets" preserve-order="true" verbose="3">
<packages>
<package name="com.live.cases.liveAssets"></package>
</packages>
</test>
<test name="musicPlay" preserve-order="true" verbose="3">
<packages>
<package name="com.live.cases.musicPlay"></package>
</packages>
</test>
<test name="videoClass" preserve-order="true" verbose="3">
<packages>
<package name="com.live.cases.videoClass"></package>
</packages>
</test>
</suite> </suite>
\ 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