Commit d751f72e by fangyuan

add update cases

parent 33a31e6e
package com.live.cases.apollo; //package com.live.cases.apollo;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.live.cases.largeClassLive.LargeClassLiveTools; //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.xmutils.GetLiveCourseData;
import com.live.xmutils.GetLiveCourseData; //import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMBaseTest; //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; //
///**
/** // * Created by zhangying on 2020/11/27
* Created by zhangying on 2020/11/27 // */
*/ //
//public class TestChangeCourseState extends XMBaseTest {
public class TestChangeCourseState extends XMBaseTest { //
// @BeforeMethod
@BeforeMethod // public void beforeTest() {
public void beforeTest() { // xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址 // .setApiName("api_changeCourseState") // API 名称 必传
.setApiName("api_changeCourseState") // API 名称 必传 // .setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传 // .setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传) // super.beforeTest();
super.beforeTest(); // }
} //
// /**
/** // * 测试改变直播课次状态
* 测试改变直播课次状态 // */
*/ // @Test
@Test // public void testChangeCourseState() {
public void testChangeCourseState() { // GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
GetLiveCourseData getLiveCourseData=new GetLiveCourseData(); // JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList();
JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList(); //
// JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0);
JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0); // String liveCourseId= (String) liveCourse.get("liveCourseId");
String liveCourseId= (String) liveCourse.get("liveCourseId"); // if (liveCourseId==null){
if (liveCourseId==null){ // largeClassCourse=getLiveCourseData.createLargeClassLive();
largeClassCourse=getLiveCourseData.createLargeClassLive(); // liveCourseId= (String) largeClassCourse.get("liveCourseId");
liveCourseId= (String) largeClassCourse.get("liveCourseId"); // }
} // System.out.println("liveCourseId ="+liveCourseId);
System.out.println("liveCourseId ="+liveCourseId); //
// JSONObject jsonObject = new JSONObject();
JSONObject jsonObject = new JSONObject(); // jsonObject.put("liveCourseId",liveCourseId);testInitXmLive
jsonObject.put("liveCourseId",liveCourseId); // jsonObject.put("courseState","STARTING");
jsonObject.put("courseState","STARTING"); //
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); // JSONObject jsonBody = xmAppApi.getBodyInJSON();
JSONObject jsonBody = xmAppApi.getBodyInJSON(); //
// Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("true", jsonBody.getString("success")); // Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals("操作成功!", jsonBody.getString("message")); //
// }
} //
//
//}
}
...@@ -23,7 +23,7 @@ public class TestCourseLaunch extends XMBaseTest { ...@@ -23,7 +23,7 @@ public class TestCourseLaunch extends XMBaseTest {
@BeforeMethod @BeforeMethod
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo) xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
.setApiName("API_courseLaunch") .setApiName("API_courseLaunch")
.setLoginUser("zhangyumeng_huantuo") .setLoginUser("zhangyumeng_huantuo")
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
......
package com.live.cases.apollo; //package com.live.cases.apollo;
//
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.GetLiveCourseId; //import com.live.utils.GetLiveCourseId;
import com.xiaomai.utils.XMBaseTest; //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;
//
//
/** ///**
* title B端获取直播课下转码后的文档列表 // * title B端获取直播课下转码后的文档列表
* by 张雨朦 // * by 张雨朦
*/ // */
//
public class TestGetCourseDocList extends XMBaseTest { //public class TestGetCourseDocList extends XMBaseTest {
//
GetLiveCourseId tools = new GetLiveCourseId(); // GetLiveCourseId tools = new GetLiveCourseId();
//
@BeforeMethod // @BeforeMethod
public void beforeTest() { // public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo) // xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
.setApiName("API_getCourseDocList") // .setApiName("API_getCourseDocList")
.setLoginUser("zhangYuM_b") // .setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B); // .setTerminal(Terminal.B);
super.beforeTest(); // super.beforeTest();
} // }
//
@Test // @Test
public void getCourseDocList() { // public void getCourseDocList() {
//
String id = tools.createCourse(); // String id = tools.createCourse();
//
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", id); // 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();
} // }
} //}
package com.live.cases.apollo; //package com.live.cases.apollo;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.live.cases.largeClassLive.LargeClassLiveTools; //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.xmutils.GetLiveCourseData;
import com.live.xmutils.GetLiveCourseData; //import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMBaseTest; //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; //
//
///**
/** // * Created by zhangying on 2020/11/27
* Created by zhangying on 2020/11/27 // */
*/ //
//public class TestInitXmLive extends XMBaseTest {
public class TestInitXmLive extends XMBaseTest { //
// @BeforeMethod
@BeforeMethod // public void beforeTest() {
public void beforeTest() { // xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址 // .setApiName("api_initXmLive") // API 名称 必传
.setApiName("api_initXmLive") // API 名称 必传 // .setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传 // .setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传) // super.beforeTest();
super.beforeTest(); // }
} //
// /**
/** // * 测试初始化直播间信息
* 测试初始化直播间信息 // */
*/ // @Test
@Test // public void testInitXmLive() {
public void testInitXmLive() { // GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
GetLiveCourseData getLiveCourseData=new GetLiveCourseData(); // JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList();
JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList(); //
// JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0);
JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0); // String liveCourseId= (String) liveCourse.get("liveCourseId");
String liveCourseId= (String) liveCourse.get("liveCourseId"); // if (liveCourseId==null){
if (liveCourseId==null){ // largeClassCourse=getLiveCourseData.createLargeClassLive();
largeClassCourse=getLiveCourseData.createLargeClassLive(); // liveCourseId= (String) largeClassCourse.get("liveCourseId");
liveCourseId= (String) largeClassCourse.get("liveCourseId"); // }
} // System.out.println("liveCourseId ="+liveCourseId);
System.out.println("liveCourseId ="+liveCourseId); //
// JSONObject jsonObject = new JSONObject();
JSONObject jsonObject = new JSONObject(); // jsonObject.put("liveCourseId",liveCourseId);
jsonObject.put("liveCourseId",liveCourseId); //
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); // JSONObject jsonBody = xmAppApi.getBodyInJSON();
JSONObject jsonBody = xmAppApi.getBodyInJSON(); //
// Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("true", jsonBody.getString("success")); // Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals("操作成功!", jsonBody.getString("message")); //
// }
} //
//
//}
}
...@@ -2,14 +2,12 @@ package com.live.cases.apollo; ...@@ -2,14 +2,12 @@ package com.live.cases.apollo;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.cases.largeClassLive.LargeClassLiveTools;
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.xiaomai.utils.XMBaseTest; import com.xiaomai.utils.XMBaseTest;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** /**
* Created by zhangying on 2020/11/28 * Created by zhangying on 2020/11/28
......
package com.live.cases.apollo; package com.live.cases.apollo;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.cases.largeClassLive.LargeClassLiveTools;
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;
...@@ -12,10 +10,6 @@ import org.testng.Assert; ...@@ -12,10 +10,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.awt.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created by zhangying on 2020/11/27 * Created by zhangying on 2020/11/27
*/ */
......
...@@ -19,7 +19,7 @@ public class TestSendNotify2Student extends XMBaseTest { ...@@ -19,7 +19,7 @@ public class TestSendNotify2Student extends XMBaseTest {
@BeforeMethod @BeforeMethod
public void beforeTest() { public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo) xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
.setApiName("API_sendNotify2Student") .setApiName("API_sendNotify2Student")
.setLoginUser("zhangYuM_b") .setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
......
package com.live.cases.fileManage; //package com.live.cases.fileManage;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.live.xmutils.CloudClassBaseTest; //import com.live.xmutils.CloudClassBaseTest;
import com.live.enums.RequestType; //import com.live.enums.RequestType;
import org.testng.Assert; //import org.testng.Assert;
import org.testng.annotations.Test; //import org.testng.annotations.Test;
//
/** ///**
* 文件列表,自行判断用户id // * 文件列表,自行判断用户id
* // *
* @author xue.w // * @author xue.w
* @since 2020/09/16 at 6:03 下午 // * @since 2020/09/16 at 6:03 下午
**/ // **/
public class TestFolderList extends CloudClassBaseTest { //public class TestFolderList extends CloudClassBaseTest {
@Override // @Override
public String getApiName() { // public String getApiName() {
return "API_folderList"; // return "API_folderList";
} // }
//
@Test(description = "获取文件列表") // @Test(description = "获取文件列表")
public void testFolderList(){ // public void testFolderList(){
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1"); // jsonObject.put("current","1");
jsonObject.put("disk", "MYSELF"); // jsonObject.put("disk", "MYSELF");
jsonObject.put("size", Integer.toString(Integer.MAX_VALUE)); // jsonObject.put("size", Integer.toString(Integer.MAX_VALUE));
//
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); // System.out.println(jsonBody);
Assert.assertEquals("true", jsonBody.getString("success")); // Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message")); // Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals(jsonBody.getJSONObject("result").getString("total"), Integer.toString(jsonBody.getJSONObject("result").getJSONArray("records").size())); // Assert.assertEquals(jsonBody.getJSONObject("result").getString("total"), Integer.toString(jsonBody.getJSONObject("result").getJSONArray("records").size()));
//
} // }
} //}
package com.live.cases.fileManage; //package com.live.cases.fileManage;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.live.xmutils.CloudClassBaseTest; //import com.live.xmutils.CloudClassBaseTest;
import com.live.enums.RequestType; //import com.live.enums.RequestType;
import org.testng.Assert; //import org.testng.Assert;
import org.testng.annotations.Test; //import org.testng.annotations.Test;
//
/** ///**
* 获取用户具有权限的盘符,自行判断用户id // * 获取用户具有权限的盘符,自行判断用户id
* // *
* @author xue.w // * @author xue.w
* @since 2020/09/16 at 4:09 下午 // * @since 2020/09/16 at 4:09 下午
**/ // **/
public class TestGetUserDisk extends CloudClassBaseTest { //public class TestGetUserDisk extends CloudClassBaseTest {
@Override // @Override
public String getApiName() { // public String getApiName() {
return "API_getUserDisk"; // return "API_getUserDisk";
} // }
//
@Test // @Test
public void testGetUserDisk() { // public void testGetUserDisk() {
xmAppApi.doRequest(RequestType.JSON,params,"{}",headers); // xmAppApi.doRequest(RequestType.JSON,params,"{}",headers);
JSONObject jsonBody = xmAppApi.getBodyInJSON(); // JSONObject jsonBody = xmAppApi.getBodyInJSON();
//
Assert.assertEquals("true", jsonBody.getString("success")); // Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message")); // Assert.assertEquals("操作成功!", jsonBody.getString("message"));
Assert.assertEquals(3, jsonBody.getJSONArray("result").size()); // Assert.assertEquals(3, jsonBody.getJSONArray("result").size());
} // }
} //}
...@@ -19,7 +19,7 @@ public class testCommonFolderList extends XMBaseTest { ...@@ -19,7 +19,7 @@ public class testCommonFolderList extends XMBaseTest {
@BeforeMethod @BeforeMethod
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B_commonFolderList ) xmAppApi.setApiModule(ApiModele.CloudClass_B_createbiglivecourse )
.setApiName("API_commonFolderList") .setApiName("API_commonFolderList")
.setLoginUser("zhangYuM_b") .setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
......
...@@ -9,6 +9,7 @@ public class ApiModele { ...@@ -9,6 +9,7 @@ public class ApiModele {
// 云课堂B端 接口模块名称 // 云课堂B端 接口模块名称
public static String CloudClass_B = "apiCaseData_b_cloudclass"; public static String CloudClass_B = "apiCaseData_b_cloudclass";
public static String CloudClass_B_createbiglivecourse = "cloudclass_createBigLiveCourse"; public static String CloudClass_B_createbiglivecourse = "cloudclass_createBigLiveCourse";
public static String CloudClass_apollo = "cloudclass_apollo_api";
//云课堂接口模块名称 //云课堂接口模块名称
//云课堂B端接口模块 //云课堂B端接口模块
...@@ -19,12 +20,7 @@ public class ApiModele { ...@@ -19,12 +20,7 @@ public class ApiModele {
public static String CloudClass_VideoC = "cloudclass_video_c"; public static String CloudClass_VideoC = "cloudclass_video_c";
public static String CloudClass_FileC = "cloudclass_file_c"; public static String CloudClass_FileC = "cloudclass_file_c";
public static String CloudClass_customerLive = "cloudclass_customerLive_api"; public static String CloudClass_customerLive = "cloudclass_customerLive_api";
public static String CloudClass_apollo = "cloudclass_apollo_api";
public static String CloudClass_C_CheckAuthorize = "CloudClass_C_CheckAuthorize"; public static String CloudClass_C_CheckAuthorize = "CloudClass_C_CheckAuthorize";
public static String CloudClass_B_commonFolderList = "cloudClass_B_commonFolderList";
public static String CloudClass_B_Apollo = "cloudclass_apollo_api";
} }
...@@ -34,6 +34,7 @@ public class GetLiveCourseData extends XMBaseTest { ...@@ -34,6 +34,7 @@ public class GetLiveCourseData extends XMBaseTest {
return liveCourseList; return liveCourseList;
} }
public JSONObject createLargeClassLive() { public JSONObject createLargeClassLive() {
dataApi.setApiModule(ApiModele.CloudClass_B) dataApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_createLargeClassLive") .setApiName("API_createLargeClassLive")
......
...@@ -7,15 +7,13 @@ gray=https://gray-heimdall.xiaomai5.com ...@@ -7,15 +7,13 @@ gray=https://gray-heimdall.xiaomai5.com
#prod #prod
prod=https://heimdall.xiaomai5.com prod=https://heimdall.xiaomai5.com
# 测试运行环境 本地调试时,可指定调试环境。完成本地调试后,请注释此变量 # 测试运行环境 本地调试时,可指定调试环境。完成本地调试后,请注释此变量
#runningEnv = rc
testData = \\src\\main\\resources\\dataprovider\\APIcase.xls testData = \\src\\main\\resources\\dataprovider\\APIcase.xls
# �����˺� # 账号
testAccount = /src/main/resources/parameter.json testAccount = /src/main/resources/parameter.json
#B端创建课程
#�ƿ���B��api�ӿ� cloudclass_createBigLiveCourse = /src/main/resources/apicase/api-b.json
apiCaseData_b_cloudclass = /src/main/resources/apicase/api-b.json
# cloudclass api # cloudclass api
cloudclass_video_b = /src/main/resources/apicase/api-video-b.json cloudclass_video_b = /src/main/resources/apicase/api-video-b.json
...@@ -25,15 +23,9 @@ cloudclass_file_c = /src/main/resources/apicase/api-file-c.json ...@@ -25,15 +23,9 @@ cloudclass_file_c = /src/main/resources/apicase/api-file-c.json
cloudclass_customerLive_api = /src/main/resources/apicase/customerLive.json cloudclass_customerLive_api = /src/main/resources/apicase/customerLive.json
cloudclass_apollo_api = /src/main/resources/apicase/apollo.json cloudclass_apollo_api = /src/main/resources/apicase/apollo.json
b_web_login_param = p=w&v=v5.4.0&userType=B
b_app_login_paran = p=iOS&xmversion=5.0&b=552595&userType=B&saasV=5.0&vn=5.4.3&deviceVersion=13.4.1&v=5.4.3
//cloudclass api
#B端创建课程
cloudclass_createBigLiveCourse = /src/main/resources/apicase/api-b.json
#c端校验直播课程和学员是否有观看的权限
cloudClass_B_commonFolderList = /src/main/resources/apicase/api-b.json
......
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