Commit 574c9eaa by fangyuan

Merge remote-tracking branch 'origin/master'

parents 09d36e59 9cb2daf4
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;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhangying on 2020/02/02
*/
public class TestConvertShortUrls extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_convertShortUrls") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 直播课分享
*/
@Test
public void testConvertShortUrls() {
String urls="https://prod.xiaomai5.com/share/show?appid=wxdd6b458500d4c224&redirect_uri=https%3A%2F%2Fres" +
".xiaomai5.com%2Fxiaomai-live-share%2Findex.html%23%2FliveShare%3Fid%3D1356196461296828418%26saasVersio" +
"n%3DV_50%26appid%3Dwxdd6b458500d4c224&response_type=code&scope=snsapi_base&state=state#wechat_redirect";
List urlsList = new ArrayList();
urlsList.add(urls);
System.out.println("urlsList ="+urlsList );
JSONObject jsonObject = new JSONObject();
jsonObject.put("urls",urlsList);
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.getJSONArray("result").getJSONObject(0));
Assert.assertEquals(jsonBody.getJSONArray("result").getJSONObject(0).getString("shortUrl"),"http://ixm5.cn/593wP");
Assert.assertEquals(jsonBody.getJSONArray("result").getJSONObject(0).getString("url"), urls);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
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/02
*/
public class TestExportLargeClassLiveAsync 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端等, 必传)
super.beforeTest();
}
/**
* 直播课回放记录-导出
*/
@Test
public void testExportLargeClassLiveAsync() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("exportLiveType","0");
jsonObject.put("liveCourseId","1356196461296828418");
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"));
}
}
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/02
*/
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","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("liveStudentBaseVO").size(), 0);
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/02
*/
public class TestGetLargeClassLiveList extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getLargeClassLiveList") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 大班直播课列表数据
*/
@Test
public void testGetLargeClassLiveList() {
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 testGetLargeClassLiveList1() {
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","1612281599999");
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.getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
}
}
package com.live.cases.largeClassLive;
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.TimeSetting;
import com.live.utils.XMBaseTest;
import org.springframework.transaction.TransactionUsageException;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import sun.font.TrueTypeFont;
import java.util.ArrayList;
/**
* Created by zhangying on 2020/02/01
*/
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","1356196461296828418");
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"),"1356196461296828418");
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.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;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhangying on 2020/02/02
*/
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","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("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/02
*/
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端等, 必传)
super.beforeTest();
}
/**
* 直播课回放记录
*/
@Test
public void testQueryUserReplayRecordPage() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("current","1");
jsonObject.put("size","10");
jsonObject.put("liveCourseId","1356196461296828418");
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"));
}
}
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/02
*/
public class TestTransformRecordUrl extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_transformRecordUrl") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
}
/**
* 直播课回放视频转码
*/
@Test
public void testTransformRecordUrl() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId","1356196461296828418");
System.out.println("jsonObject ="+jsonObject );
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
Assert.assertEquals(jsonBody.getString("message"), "该回放已转码");
Assert.assertEquals("false", jsonBody.getString("success"));
Assert.assertEquals("PARAM_ERROR", 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.AssertforJson;
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/01
*/
public class TestLiveAssetsQuery extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_liveAssets/query") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试账户管理-余额查询
*/
@Test
public void testLiveAssetsQuery() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("instId","1235115978015883266");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
String assetsId = jsonBody.getJSONObject("result").getString("assetsId");
String balance = jsonBody.getJSONObject("result").getString("balance");
Assert.assertEquals("500.00", balance);
Assert.assertEquals("1283684042748010497", assetsId);
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
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.GetLiveCourseData;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Created by zhangying on 2020/02/01
*/
public class TestOrderPage extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_liveAssets/orderPage") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 测试账户管理-订单列表
*/
@Test
public void testOrderPage() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("current",1);
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.assertEquals("2", jsonBody.getJSONObject("result").getString("total"));
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
...@@ -131,11 +131,28 @@ ...@@ -131,11 +131,28 @@
"apiName": "获取学生课堂报告", "apiName": "获取学生课堂报告",
"desc": "获取学生课堂报告" "desc": "获取学生课堂报告"
}, },
"API_getInteractionClassLiveList": { "API_getInteractionClassLiveList": {
"apiPath": "/apollo/public/businessLive/getInteractionClassLiveList", "apiPath": "/apollo/public/businessLive/getInteractionClassLiveList",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "获取已结束课程列表", "apiName": "获取已结束课程列表",
"desc": "获取已结束课程列表" "desc": "获取已结束课程列表"
},
"API_liveAssets/orderPage": {
"apiPath": "/business/public/liveAssets/orderPage",
"apiContentType": "application/json;charset=utf-8",
"apiName": "订单列表",
"desc": "获取账户管理中订单信息"
},
"API_liveAssets/query": {
"apiPath": "/business/public/liveAssets/query",
"apiContentType": "application/json;charset=utf-8",
"apiName": "查询账户信息",
"desc": "获取账户余额"
},
"API_convertShortUrls": {
"apiPath": "/sales/public/businessShow/convertShortUrls",
"apiContentType": "application/json;charset=utf-8",
"apiName": "直播课分享",
"desc": "直播课分享"
} }
} }
\ No newline at end of file
...@@ -103,5 +103,41 @@ ...@@ -103,5 +103,41 @@
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "删除直播课", "apiName": "删除直播课",
"desc": "删除直播课" "desc": "删除直播课"
},
"API_getLiveCourseRecordInfos": {
"apiPath": "/apollo/anon/businessLive/getLiveCourseRecordInfos",
"apiContentType": "application/json;charset=utf-8",
"apiName": "直播课回放详情",
"desc": "查看直播课回放"
},
"API_getCourseDetail": {
"apiPath": "/apollo/public/businessLive/getCourseDetail",
"apiContentType": "application/json;charset=utf-8",
"apiName": "上课详情",
"desc": "查看上课详情"
},
"API_queryUserReplayRecordPage": {
"apiPath": "/apollo/public/businessLive/queryUserReplayRecordPage",
"apiContentType": "application/json;charset=utf-8",
"apiName": "回放记录",
"desc": "查看回放记录"
},
"API_exportLargeClassLiveAsync": {
"apiPath": "/apollo/public/businessLive/exportLargeClassLiveAsync",
"apiContentType": "application/json;charset=utf-8",
"apiName": "导出回放记录",
"desc": "导出回放记录"
},
"API_transformRecordUrl": {
"apiPath": "/apollo/public/businessLive/transformRecordUrl",
"apiContentType": "application/json;charset=utf-8",
"apiName": "回放视频转码",
"desc": "大班直播回放视频修复"
},
"API_getLargeClassLiveList": {
"apiPath": "/apollo/public/businessLive/getLargeClassLiveList",
"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