Commit 171c4ff0 by zhangying

补充互动班课和资料云盘的case

parent 64ed6e19
......@@ -9,7 +9,6 @@ import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
//import com.live.utils.TimeSetting;
/**
* @Description 文件列表,公共文件
......@@ -22,14 +21,14 @@ public class TestCommonFolderList extends XMBaseTest {
public void beforeTest(){
xmAppApi.setApiModule(ApiModele.CloudClass_B )
.setApiName("API_commonFolderList")
.setLoginUser("zhangYuM_b")
.setLoginUser("zhangy-b") //张莹的账号下数据比较多
.setTerminal(Terminal.B);
dal.setCase_owner("张莹");
dal.setCase_owner("张莹/张雨朦");
super.beforeTest();
}
@Test
@Test(description = "获取公共文件列表")
public void testCommonFolderList(){
JSONObject jsonObject = new JSONObject();
//jsonObject.put("bizAccountId","1323235986786807809");
......@@ -42,8 +41,29 @@ public class TestCommonFolderList extends XMBaseTest {
System.out.println("请求" + jsonObject);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers);
//
JSONObject responseRes = xmAppApi.getBodyInJSON();
Assert.assertEquals("true",responseRes.getString("success"));
}
@Test(description = "公共文件列表,按名称排序")
public void testCommonFolderList1(){
JSONObject jsonObject = new JSONObject();
jsonObject.put("current",1);
jsonObject.put("disk", "COMMON");
jsonObject.put("folderIdType", "FOLDER");
jsonObject.put("instId",xmAppApi.getLoginInfo().getInstId());
jsonObject.put("searchName", null);
jsonObject.put("size", 10);
jsonObject.put("sort", "NAME_DESC");
jsonObject.put("parentId", null);
System.out.println("请求" + jsonObject);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers);
JSONObject responseRes = xmAppApi.getBodyInJSON();
System.out.println("responseRes =="+responseRes );
Assert.assertEquals("true",responseRes.getString("success"));
Assert.assertNotNull(responseRes.getJSONObject("result").getString("total"));
}
}
......@@ -28,11 +28,11 @@ public class TestDelCommonFolder extends XMBaseTest {
super.beforeTest();
}
@Test
@Test(description = "删除单个文件")
public void testDelCommonFolderList() throws InterruptedException {
GetFolderData testCommonFolderList = new GetFolderData();
JSONObject folderList = testCommonFolderList.saveFolder();
String id = folderList.getJSONObject("result").getString("id");
JSONObject folderList = testCommonFolderList.getFolderList();
String id = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
System.out.println("获取id" + id);
JSONObject jsonObject = new JSONObject();
......@@ -54,4 +54,33 @@ public class TestDelCommonFolder extends XMBaseTest {
Assert.assertNotEquals(id1, id);
}
@Test(description = "批量删除多个文件")
public void testDelCommonFolderList1() throws InterruptedException {
GetFolderData testCommonFolderList = new GetFolderData();
JSONObject folderList = testCommonFolderList.getFolderList();
String folderId = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
String folderId1 = folderList.getJSONObject("result").getJSONArray("records").getJSONObject(1).getString("id");
JSONObject jsonObject = new JSONObject();
List StringList = new ArrayList();
StringList.add(folderId);
StringList.add(folderId1);
jsonObject.put("ids", StringList);
jsonObject.put("instId","1300628703858597889");
System.out.println("请求" + jsonObject);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
JSONObject folderList1 = testCommonFolderList.getCommonFolderList();
String id = folderList1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
String id1 = folderList1.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
System.out.println("id1 == "+id1);
Assert.assertEquals("true", responseRes.getString("success"));
Assert.assertEquals("200", responseRes.getString("code"));
Assert.assertNotEquals(folderId, id);
Assert.assertNotEquals(folderId1, id1);
}
}
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;
/**
* @author zhangying
* @date 2021/3/19 1:44 下午
*/
public class TestExportClassInteractionLiveSync extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_exportLargeClassLiveAsync") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("zhangying");
super.beforeTest();
}
/**
* 大班互动直播课回放记录-导出
*/
@Test(description = "上课记录导出")
public void testExportLargeClassLiveAsync() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("exportLiveType","VISITOR");
jsonObject.put("liveCourseId","1356798987214893057"); //zy大班互动自动化测试(勿删)--固定直播课
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("bizType"), "EXPORT_LIVE_VISITOR");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
/**
* 大班互动直播课回放记录-导出
*/
@Test(description = "回放记录导出")
public void testExportLargeClassLiveAsync1() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("exportLiveType","0");
jsonObject.put("liveCourseId","1356798987214893057"); //zy大班互动自动化测试(勿删)--固定直播课
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("bizType"), "EXPORT_LIVE_PLAY_BACK");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
......@@ -83,6 +83,7 @@ public class TestLargeInteractionDelCourse extends XMBaseTest {
Assert.assertNotEquals("直播课已扣学员课时,不支持删除", "message");
Assert.assertEquals("false", jsonBody.getString("success"));
Assert.assertEquals(liveCourseId1, liveCourseId);
}
......
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;
/**
* @author zhangying
* @date 2021/3/19 2:04 下午
*/
public class TestQueryUserReplayRecordPage extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_queryUserReplayRecordPage") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("张莹");
super.beforeTest();
}
/**
* 直播课回放记录
*/
@Test
public void testQueryUserReplayRecordPage() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("liveCourseId","1356798987214893057"); //zy大班互动自动化测试(勿删)--固定直播课
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotEquals(jsonBody.getJSONObject("result").getString("total"), 0);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
......@@ -28,7 +28,7 @@ public class TestExportLargeClassLiveAsync extends XMBaseTest {
/**
* 直播课回放记录-导出
*/
@Test
@Test(description = "回放记录导出")
public void testExportLargeClassLiveAsync() {
JSONObject jsonObject = new JSONObject();
......@@ -46,4 +46,26 @@ public class TestExportLargeClassLiveAsync extends XMBaseTest {
}
/**
* 直播课回放记录-导出
*/
@Test(description = "上课记录导出")
public void testExportLargeClassLiveAsync1() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("exportLiveType","VISITOR");
jsonObject.put("liveCourseId","1356196461296828418"); //zy大班直播自动化测试(勿删)--固定直播课
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("bizType"), "EXPORT_LIVE_VISITOR");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.liveAssets;
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 com.live.xmutils.GetLiveAssetsData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangying
* @date 2021/3/19 4:54 下午
*/
public class TestExportLiveAssetsOrder extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_exportLiveAssetsOrder") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("张莹");
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试账户管理-订单导出
*/
@Test(description = "测试全部导出订单")
public void testExportLiveAssetsOrder() {
List orderStates = new ArrayList();
List orderTypes = new ArrayList();
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("sort","DEFAULT");
jsonObject.put("orderStates",orderStates);
jsonObject.put("orderTypes",orderTypes);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotNull(jsonBody.getString("result")); //result返回的是一个URL
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
/**
* 测试账户管理-订单导出
*/
@Test(description = "测试查看已完成订单导出")
public void testExportLiveAssetsOrder1() {
List orderStates = new ArrayList();
orderStates.add("PAY_SUCCESS");
List orderTypes = new ArrayList();
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("sort","DEFAULT");
jsonObject.put("orderStates",orderStates);
jsonObject.put("orderTypes",orderTypes);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotNull(jsonBody.getString("result")); //result返回的是一个URL
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
/**
* 测试账户管理-订单导出
*/
@Test(description = "测试查看已失效订单导出")
public void testExportLiveAssetsOrder2() {
List orderStates = new ArrayList();
orderStates.add("PAY_UNDO");
List orderTypes = new ArrayList();
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("sort","DEFAULT");
jsonObject.put("orderStates",orderStates);
jsonObject.put("orderTypes",orderTypes);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotNull(jsonBody.getString("result")); //result返回的是一个URL
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
/**
* 测试账户管理-订单导出
*/
@Test(description = "测试查看已完成的录制扣费订单导出")
public void testExportLiveAssetsOrder3() {
List orderStates = new ArrayList();
orderStates.add("PAY_SUCCESS");
List orderTypes = new ArrayList();
orderTypes.add("RECORD");
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("sort","DEFAULT");
jsonObject.put("orderStates",orderStates);
jsonObject.put("orderTypes",orderTypes);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotNull(jsonBody.getString("result")); //result返回的是一个URL
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
/**
* 测试账户管理-订单导出
*/
@Test(description = "测试查看已完成的上课扣费订单导出")
public void testExportLiveAssetsOrder4() {
List orderStates = new ArrayList();
orderStates.add("PAY_SUCCESS");
List orderTypes = new ArrayList();
orderTypes.add("CLASS");
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("sort","DEFAULT");
jsonObject.put("orderStates",orderStates);
jsonObject.put("orderTyoes",orderTypes);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotNull(jsonBody.getString("result")); //result返回的是一个URL
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
package com.live.cases.liveAssets;
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 com.live.xmutils.GetLiveAssetsData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @author zhangying
* @date 2021/3/19 2:59 下午
*/
public class TestOrderDetail extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_orderDetail") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
dal.setCase_owner("张莹");
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试账户管理-订单详情
*/
@Test(description = "测试查看已完成订单详情")
public void testOrderDetail() {
GetLiveAssetsData getLiveAssetsData = new GetLiveAssetsData();
JSONObject getLiveAssetsOrder = getLiveAssetsData.getLiveAssetsPageList();
System.out.println("getLiveAssetsOrder ==" + getLiveAssetsOrder);
String orderId = getLiveAssetsOrder.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("orderId");
System.out.println("orderId =="+ orderId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderId",orderId);
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals(orderId, jsonBody.getJSONObject("result").getString("orderId"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
......@@ -29,7 +29,7 @@ public class TestOrderPage extends XMBaseTest {
/**
* 测试账户管理-订单列表
*/
@Test
@Test(description = "测试翻页第1页")
public void testOrderPage() {
JSONObject jsonObject = new JSONObject();
......@@ -48,4 +48,26 @@ public class TestOrderPage extends XMBaseTest {
}
/**
* 测试账户管理-订单列表
*/
@Test(description = "测试翻页翻到第2页")
public void testOrderPage1() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("current",2);
jsonObject.put("size",10);
jsonObject.put("instId","1235115978015883266");
jsonObject.put("sort","DEFAULT");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertNotEquals("0", jsonBody.getJSONObject("result").getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
package com.live.xmutils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.RandomStringUtil;
import com.live.utils.XMBaseTest;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangying
* @date 2021/3/19 2:56 下午
*/
public class GetLiveAssetsData extends XMBaseTest {
public JSONObject getLiveAssetsPageList() {
dataApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_liveAssets/orderPage") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeDataRequest();
List orderStatesArray = new ArrayList();
List orderTypesArray = new ArrayList();
JSONObject jsonObject = new JSONObject();
jsonObject.put("current",1);
jsonObject.put("size",10);
jsonObject.put("instId","1235115978015883266");
jsonObject.put("sort","DEFAULT");
jsonObject.put("orderTypes",orderStatesArray);
jsonObject.put("orderStates",orderTypesArray);
dataApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(dataApi);
JSONObject jsonBody = dataApi.getBodyInJSON();
return jsonBody;
}
}
......@@ -191,5 +191,19 @@
"apiContentType": "application/json;charset=utf-8",
"apiName": "编辑直播课",
"desc": "编辑直播课"
},
"API_orderDetail":
{
"apiPath": "/business/public/liveAssets/orderDetail",
"apiContentType": "application/json;charset=UTF-8",
"apiName": "直播订单详情",
"desc": "直播订单详情"
},
"API_exportLiveAssetsOrder":
{
"apiPath": "/business/public/liveAssets/exportLiveAssetsOrder",
"apiContentType": "application/json;charset=UTF-8",
"apiName": "导出云课堂账户订单",
"desc": "导出云课堂账户订单"
}
}
\ No newline at end of file
......@@ -222,5 +222,12 @@
"apiContentType": "application/json;charset=UTF-8",
"apiName": "客户端开启回放录制",
"desc": "客户端开启回放录制"
},
"API_exportClassInteractionLiveSync":
{
"apiPath": "/apollo/public/businessLive/exportClassInteractionLiveSync",
"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