Commit 2540a3bc by zhangying

补充大班互动的case

parent c2bf4d9b
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.GetLiveCourseId; //import com.live.xmutils.GetLiveCourseId;
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;
//
public class TestQueryStudentVisitData extends XMBaseTest { //public class TestQueryStudentVisitData extends XMBaseTest {
GetLiveCourseId tools = new GetLiveCourseId(); // GetLiveCourseId tools = new GetLiveCourseId();
//
@BeforeMethod // @BeforeMethod
public void beforeTest(){ // public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B) // xmAppApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_queryStudentVisitData") // .setApiName("API_queryStudentVisitData")
.setLoginUser("zhangYuM_b") // .setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B); // .setTerminal(Terminal.B);
super.beforeTest(); // super.beforeTest();
} // }
//
//@Test // //@Test
public void queryStudentVisitData() { // 已重写
// public void queryStudentVisitData() {
String id = tools.createCourse(); //
// String id = tools.createCourse();
JSONObject jsonObject = new JSONObject(); //
jsonObject.put("liveCourseId","1334373001216823298"); // JSONObject jsonObject = new JSONObject();
// jsonObject.put("liveCourseId","1334373001216823298");
//
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers); //
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject responseRes = xmAppApi.getBodyInJSON(); //
Assert.assertEquals("true",responseRes.getString("success")); // JSONObject responseRes = xmAppApi.getBodyInJSON();
} // Assert.assertEquals("true",responseRes.getString("success"));
} // }
//}
package com.live.cases.interactionLive;
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","1356798987214893057");
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.getJSONObject("result"));
// Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("visitorInfoVOList").size(), 0);
Assert.assertEquals(jsonBody.getJSONObject("result").getString("courseName"),"zy大班互动自动化测试(勿删)" );
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.interactionLive;
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 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","1356798987214893057");
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(jsonBody.getJSONObject("result").getJSONArray("liveStudentBaseVO").size(), 0);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.interactionLive;
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 TestGetInteractionClassLiveList extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getInteractionClassLiveList") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 大班互动直播课列表数据
*/
@Test
public void testGetInteractionClassLiveList() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId","1235115978015883266");
jsonObject.put("current","1");
jsonObject.put("size","10");
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"));
}
/**
* 大班直播课列表数据-详细查询
*/
@Test
public void testGetInteractionClassLiveList1() {
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","1612367999999");
jsonObject.put("startTime","1612108800000");
jsonObject.put("teacherId","1235115979473997826");
jsonObject.put("teacherName","主账户老师");
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("1", jsonBody.getJSONObject("result").getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.interactionLive;
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 TestGetLiveCourseRecordInfos extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getLiveCourseRecordInfos") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 大班互动-查看直播回放
*/
@Test
public void testGetLiveCourseRecordInfos() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1356798987214893057");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("courseName ="+jsonBody);
System.out.println("courseName ="+jsonBody.getJSONObject("result").getString("liveCourseId"));
Assert.assertEquals(jsonBody.getJSONObject("result").getString("liveCourseId"),"1356798987214893057");
Assert.assertEquals(jsonBody.getJSONObject("result").getString("recordGenerate"), "true");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
package com.live.cases.interactionLive;
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","1356798987214893057");
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.interactionLive;
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 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","1356798987214893057");
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.getJSONObject("result"));
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.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 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","1356196461296828418");
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.getJSONObject("result"));
// Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("visitorInfoVOList").size(), 0);
Assert.assertEquals(jsonBody.getJSONObject("result").getString("courseName"),"zy直播测试1" );
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
...@@ -139,5 +139,17 @@ ...@@ -139,5 +139,17 @@
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "大班直播课列表", "apiName": "大班直播课列表",
"desc": "大班直播课列表数据" "desc": "大班直播课列表数据"
},
"API_getInteractionClassLiveList": {
"apiPath": "/apollo/public/businessLive/getInteractionClassLiveList",
"apiContentType": "application/json;charset=utf-8",
"apiName": "大班互动直播课列表",
"desc": "大班互动直播课列表数据"
},
"API_queryStudentVisitData": {
"apiPath": "/apollo/public/businessLive/queryStudentVisitData",
"apiContentType": "application/json;charset=utf-8",
"apiName": "查看学员直播课上课记录",
"desc": "查看学员上课记录"
} }
} }
\ 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