Commit 65d13da5 by fangyuan

update testng.xml

parent d10534de
//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.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();
// } System.out.println(xmAppApi);
// }
// /**
// * 测试改变直播课次状态 /**
// */ * 测试改变直播课次状态
// @Test */
// public void testChangeCourseState() { @Test
// GetLiveCourseData getLiveCourseData=new GetLiveCourseData(); public void testChangeCourseState() {
// JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList(); GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
// JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList();
// JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0);
// String liveCourseId= (String) liveCourse.get("liveCourseId"); JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0);
// if (liveCourseId==null){ String liveCourseId= (String) liveCourse.get("liveCourseId");
// largeClassCourse=getLiveCourseData.createLargeClassLive(); if (liveCourseId==null){
// liveCourseId= (String) largeClassCourse.get("liveCourseId"); largeClassCourse=getLiveCourseData.createLargeClassLive();
// } liveCourseId= (String) largeClassCourse.get("liveCourseId");
// System.out.println("liveCourseId ="+liveCourseId); }
// System.out.println("liveCourseId ="+liveCourseId);
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("liveCourseId",liveCourseId);testInitXmLive JSONObject jsonObject = new JSONObject();
// jsonObject.put("courseState","STARTING"); jsonObject.put("liveCourseId",liveCourseId);
// jsonObject.put("courseState","STARTING");
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
// JSONObject jsonBody = xmAppApi.getBodyInJSON(); xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
// System.out.println(xmAppApi);
// Assert.assertEquals("true", jsonBody.getString("success")); JSONObject jsonBody = xmAppApi.getBodyInJSON();
// Assert.assertEquals("操作成功!", jsonBody.getString("message"));
// Assert.assertEquals("true", jsonBody.getString("success"));
// } Assert.assertEquals("操作成功!", jsonBody.getString("message"));
//
// }
//}
}
//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_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.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"));
//
// } }
//
//
//} }
package com.live.cases.interactionLive; //package com.live.cases.interactionLive;
//
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.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;
//
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.HashMap; //import java.util.HashMap;
import java.util.List; //import java.util.List;
import java.util.Map; //import java.util.Map;
//
/** ///**
* @author NHX // * @author NHX
* @Function C端获取课表文件计数 // * @Function C端获取课表文件计数
* @Date 2020/11/19 15:01 // * @Date 2020/11/19 15:01
*/ // */
public class TestGetScheduleFileCount_C extends XMBaseTest { //public class TestGetScheduleFileCount_C extends XMBaseTest {
//
@BeforeMethod // @BeforeMethod
public void beforeTest() { // public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块 // xmAppApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块
.setApiName("API_getScheduleFileCount") // API 名称 // .setApiName("API_getScheduleFileCount") // API 名称
.setLoginUser("NHX_c") // http 接口,测试账号 // .setLoginUser("NHX_c") // http 接口,测试账号
.setTerminal(Terminal.C); // 所属端位(B端,C端,M端等, 必传) // .setTerminal(Terminal.C); // 所属端位(B端,C端,M端等, 必传)
//
//
dal.setCase_owner("NHX") // dal.setCase_owner("NHX")
.setCase_name("C端获取课表文件计数:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); // .setCase_name("C端获取课表文件计数:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
//
super.beforeTest(); // super.beforeTest();
} // }
//
@Test(description = "C端获取课表文件计数") // @Test(description = "C端获取课表文件计数")
public void testLoadStudentListAPI(){ // public void testLoadStudentListAPI(){
//
List list = new ArrayList(); // List list = new ArrayList();
list.add("1145613399253643266"); // list.add("1145613399253643266");
//
Map<String,Object> bodyMap = new HashMap<>(); // Map<String,Object> bodyMap = new HashMap<>();
bodyMap.put("scheduleIds",list); // bodyMap.put("scheduleIds",list);
//
JSONObject jsonBody = new JSONObject(); // JSONObject jsonBody = new JSONObject();
String data = jsonBody.toJSONString(); // String data = jsonBody.toJSONString();
//
System.out.println("请求参数==========="+data); // System.out.println("请求参数==========="+data);
//
xmAppApi.doRequest(RequestType.JSON, params, data, headers); // xmAppApi.doRequest(RequestType.JSON, params, data, headers);
JSONObject jsonResponseBody = xmAppApi.getBodyInJSON(); // JSONObject jsonResponseBody = xmAppApi.getBodyInJSON();
Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!"); // Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!");
//
//
} // }
//
} //}
package com.live.cases.interactionLive; //package com.live.cases.interactionLive;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; //import com.live.enums.ApiModele;
import com.xiaomai.enums.RequestType; //import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal; //import com.xiaomai.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; //import org.testng.annotations.Test;
import java.util.HashMap; //import java.util.HashMap;
import java.util.Map; //import java.util.Map;
//
/** ///**
* @author NHX // * @author NHX
* @Function C端获取学生信息列表 // * @Function C端获取学生信息列表
* @Date 2020/11/19 15:01 // * @Date 2020/11/19 15:01
*/ // */
public class TestGetStudentInstLinkageList_C extends XMBaseTest { //public class TestGetStudentInstLinkageList_C extends XMBaseTest {
//
@BeforeMethod // @BeforeMethod
public void beforeTest() { // public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块 // xmAppApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块
.setApiName("API_getStudentInstLinkageList") // API 名称 // .setApiName("API_getStudentInstLinkageList") // API 名称
.setLoginUser("NHX_c") // http 接口,测试账号 // .setLoginUser("NHX_c") // http 接口,测试账号
.setTerminal(Terminal.C); // 所属端位(B端,C端,M端等, 必传) // .setTerminal(Terminal.C); // 所属端位(B端,C端,M端等, 必传)
//
dal.setCase_owner("NHX") // dal.setCase_owner("NHX")
.setCase_name("C端获取学生信息列表:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); // .setCase_name("C端获取学生信息列表:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
//
super.beforeTest(); // super.beforeTest();
} // }
//
@Test(description = "C端获取学生信息列表") // @Test(description = "C端获取学生信息列表")
public void testLoadStudentListAPI(){ // public void testLoadStudentListAPI(){
//
Map<String,Object> bodyMap = new HashMap<>(); // Map<String,Object> bodyMap = new HashMap<>();
//
JSONObject jsonBody = new JSONObject(bodyMap); // JSONObject jsonBody = new JSONObject(bodyMap);
String data = jsonBody.toJSONString(); // String data = jsonBody.toJSONString();
//
System.out.println("请求参数==========="+data); // System.out.println("请求参数==========="+data);
// "exception": "java.lang.IllegalArgumentException: userId不能为空; headers加userId // // "exception": "java.lang.IllegalArgumentException: userId不能为空; headers加userId
headers.put("userId","1145612151844098049"); // headers.put("userId","1145612151844098049");
//
xmAppApi.doRequest(RequestType.JSON, params, data, headers); // xmAppApi.doRequest(RequestType.JSON, params, data, headers);
JSONObject jsonResponseBody = xmAppApi.getBodyInJSON(); // JSONObject jsonResponseBody = xmAppApi.getBodyInJSON();
Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!"); // Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!");
//
//
} // }
//
} //}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="xm-autotest-live" parallel="methods" thread-count="20" data-provider-thread-count="5" > <!--<suite name="xm-autotest-live" parallel="true" thread-count="20" data-provider-thread-count="5" >-->
<suite name="xm-autotest-live" parallel="false" >
<listeners> <listeners>
<listener class-name="com.xiaomai.client.RetryListener" /> <listener class-name="com.xiaomai.client.RetryListener" />
......
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