Commit e8acdd4a by zhangying

补充乐器陪练的case

parent 0d487006
//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.xmutils.GetLiveCourseId;
//import com.live.utils.XMBaseTest;
//import org.testng.Assert;
//import org.testng.annotations.BeforeMethod;
//import org.testng.annotations.Test;
//
//
///**
// * title 客户端获取直播课下转码后的文档列表
// * by 张雨朦
// */
//
//public class TestGetCourseDocList extends XMBaseTest {
//
//
// @BeforeMethod
// public void beforeTest() {
// xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
// .setApiName("API_getCourseDocList")
// .setLoginUser("zhangYuM_b")
// .setTerminal(Terminal.B);
// super.beforeTest();
// }
//
// @Test
// public void getCourseDocList() {
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.xmutils.GetLiveCourseId;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* title 客户端获取直播课下转码后的文档列表
* by 张雨朦-->zhangying
*/
public class TestGetCourseDocList extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
.setApiName("API_getCourseDocList")
.setLoginUser("zhangy-b")
.setTerminal(Terminal.B);
super.beforeTest();
}
@Test
public void getCourseDocList() {
// GetLiveCourseId tools = new GetLiveCourseId();
// String id = tools.createCourse();
//
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("liveCourseId", id);
//
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
// JSONObject responseRes = xmAppApi.getBodyInJSON();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", "1356798987214893057");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject responseRes = xmAppApi.getBodyInJSON();
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);
// }
//}
}
}
......@@ -37,7 +37,6 @@ public class TestGetCourseDetail extends XMBaseTest {
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("courseName ="+jsonBody.getJSONObject("result"));
Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("liveStudentBaseVO").size(), 0);
Assert.assertEquals("true", jsonBody.getString("success"));
......
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"));
}
}
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"));
}
}
......@@ -26,7 +26,7 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
}
/**
* 测试乐器陪练课列表
* 测试乐器陪练课列表-默认查询条件
*/
@Test
public void testGetOnlyOneClassLiveList() {
......@@ -45,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/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"));
}
}
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