Commit cb393199 by zhangyumeng

修改断言

parent bef2aa4a
......@@ -4,15 +4,10 @@ import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.GetLiveCourseId;
import com.sun.org.apache.xerces.internal.xs.StringList;
import com.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* title获取直播器启动协议
......
......@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.GetLiveCourseId;
import com.live.xmutils.GetLiveCourseId;
import com.xiaomai.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
......@@ -12,7 +12,7 @@ import org.testng.annotations.Test;
/**
* title B端获取直播课下转码后的文档列表
* title 客户端获取直播课下转码后的文档列表
* by 张雨朦
*/
......
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.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class TestQueryStudentVisitData extends XMBaseTest {
GetLiveCourseId tools = new GetLiveCourseId();
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_queryStudentVisitData")
.setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B);
super.beforeTest();
}
@Test
public void queryStudentVisitData() {
String id = tools.createCourse();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1334373001216823298");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
}
}
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.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* 查询老师上课数据
* by 张雨朦
*/
public class TestQueryTeacherVisitData extends XMBaseTest {
GetLiveCourseId tools = new GetLiveCourseId();
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_queryTeacherVisitData")
.setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B);
super.beforeTest();
}
@Test
public void queryTeacherVisitData() {
String id = tools.createCourse();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId",id);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
}
}
......@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.GetLiveCourseId;
import com.live.xmutils.GetLiveCourseId;
import com.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
......
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.xiaomai.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.GetLiveCourseId;
import com.live.xmutils.GetStudentId;
import com.xiaomai.utils.XMBaseTest;
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",id);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
}
}
......@@ -34,15 +34,14 @@ public class testCommonFolderList extends XMBaseTest {
jsonObject.put("current",1);
jsonObject.put("disk", "COMMON");
jsonObject.put("folderIdType", "FOLDER");
jsonObject.put("instId","1300628703858597889");
jsonObject.put("instId",xmAppApi.getLoginInfo().getInstId());
jsonObject.put("searchName", null);
jsonObject.put("size", 10);
System.out.println("请求" + jsonObject);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers);
//
JSONObject responseRes = xmAppApi.getBodyInJSON();
Assert.assertNotNull(responseRes);
Assert.assertEquals("true",responseRes.getString("success"));
}
}
......@@ -6,6 +6,7 @@ import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
......@@ -27,11 +28,11 @@ public class testDelCommonFolder extends XMBaseTest {
super.beforeTest();
}
@Test(enabled = false)
//@Test
public void testDelCommonFolderList(){
GetFolderData testCommonFolderList = new GetFolderData();
String id = testCommonFolderList.getCommonFolderListFirstId();
System.out.println("获取id" + id);
//System.out.println("获取id" + id);
JSONObject jsonObject = new JSONObject();
List StringList = new ArrayList();
......@@ -40,9 +41,11 @@ public class testDelCommonFolder extends XMBaseTest {
jsonObject.put("instId","1300628703858597889");
System.out.println("请求" + jsonObject);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers);
JSONObject responseRes = xmAppApi.getBodyInJSON();
Assert.assertEquals("true",responseRes.getString("success"));
}
}
......@@ -116,8 +116,6 @@ public class GetFolderData extends XMBaseTest {
String id = responseRes.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
return id;
}
}
package com.live.utils;
package com.live.xmutils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.utils.TimeSetting;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
......@@ -61,4 +62,5 @@ public class GetLiveCourseId extends XMBaseTest {
}
}
package com.live.xmutils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
public class GetStudentId extends XMBaseTest {
//private Object JSONArray;
public String getFinishLiveCourseId() {
dataApi.setApiModule(ApiModele.CloudClass_B)
.setApiName("API_queryStudentVisitData")
.setTerminal(Terminal.B);
super.beforeDataRequest();
// JSONObject obj = new JSONObject();
// obj.put("courseState", "FINISH");
// obj.put("instId", dataApi.getLoginInfo().getInstId());
//
// dataApi.doRequest(com.live.enums.RequestType.JSON, dataparams, obj.toJSONString(), dataheadrs).assetsSuccess(true);
//
// String liveCourseId = dataApi.getBodyInJSON().getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("liveCourseId");
//dataApi.setApiName("API_queryStudentVisitData");
//super.beforeDataRequest();
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", "1334309884730617857");
dataApi.doRequest(com.live.enums.RequestType.JSON, dataparams, jsonObject.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject responseRes = dataApi.getBodyInJSON();
JSONArray jsonArray =responseRes.getJSONObject("result").getJSONArray("records");
System.out.println("数组是"+jsonArray);
String liveSId = null;
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject object = jsonArray.getJSONObject(i);
String createdReport = (String) object.get("createdReport");
String liveStudentId = (String) object.get("liveStudentId");
// if (createdReport.equals("VALID")) {
// System.out.println("if语句");
// LiveSId = liveStudentId;
// break;
// }
//return liveStudentId;
System.out.println(liveStudentId+"学生id");
}
return liveSId;
}
}
......@@ -106,5 +106,36 @@
"apiContentType": "application/json;charset=utf-8",
"apiName": "获取机构老师id",
"desc": "获取机构老师id"
},
"API_queryTeacherVisitData": {
"apiPath": "/apollo/public/businessLive/queryTeacherVisitData",
"apiContentType": "application/json;charset=utf-8",
"apiName": "查询老师上课数据",
"desc": "查询老师上课数据"
},
"API_queryStudentVisitData": {
"apiPath": "/apollo/public/businessLive/queryStudentVisitData",
"apiContentType": "application/json;charset=utf-8",
"apiName": "查询学生上课数据",
"desc": "查询学生上课数据"
},
"API_getClassReport": {
"apiPath": "/apollo/public/businessLive/getClassReport",
"apiContentType": "application/json;charset=utf-8",
"apiName": "获取课次课堂报告",
"desc": "获取课次课堂报告"
},
"API_getStudentReport": {
"apiPath": "/apollo/anon/businessLive/getStudentReport",
"apiContentType": "application/json;charset=utf-8",
"apiName": "获取学生课堂报告",
"desc": "获取学生课堂报告"
},
"API_getInteractionClassLiveList": {
"apiPath": "/apollo/public/businessLive/getInteractionClassLiveList",
"apiContentType": "application/json;charset=utf-8",
"apiName": "获取已结束课程列表",
"desc": "获取已结束课程列表"
}
}
\ No newline at end of file
......@@ -93,8 +93,7 @@
"userType": "B",
"tid": "1235818360728756225"
},
"rc_b":
{
"rc_b": {
"instId": "1214011838628593666",
"accountNo": "15210636896",
"certificate": "afdd0b4ad2ec172c586e2150770fbf9e",
......@@ -271,8 +270,22 @@
"uid": "1291264680439021569",
"userType": "B",
"tid": "1291264680405467138"
},
"zhangyumeng_sowplan_b": {
"prod": {
"storeId":"1211601438838495868",
"storeUserId":"1338693764895141890",
"userId":"1338693764747345922",
"accountNo": "15656960812",
"certificate": "290112bfbde696fcb91284bba1e2655b",
"aid": "1291264680405467138",
"uid": "1291264680439021569",
"userType": "B",
"tid": "1291264680405467138"
}
}
}
}
}
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