Commit f335cb62 by zhangying

review

parent cbe68e28
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
import com.live.enums.Terminal; import com.live.enums.Terminal;
import com.live.utils.XMBaseTest; import com.live.utils.XMBaseTest;
import com.live.xmutils.GetDayTime;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
...@@ -32,18 +33,20 @@ public class TestGetCourseList extends XMBaseTest { ...@@ -32,18 +33,20 @@ public class TestGetCourseList extends XMBaseTest {
} }
/** /**
* 测试资料云盘-新增保存文件夹 * 测试直播客户端查询课表
*/ */
@Test @Test
public void testGetCourseList() { public void testGetCourseList() {
GetDayTime getDayTime = new GetDayTime();
long zeroTime = getDayTime.getDayZeroTime();
Map bodyMap = new HashMap(); Map bodyMap = new HashMap();
bodyMap.put("adminId", "1235115979394306049"); bodyMap.put("adminId", xmAppApi.getLoginInfo().getAid());
bodyMap.put("channel", "XIAOMAI"); bodyMap.put("channel", "XIAOMAI");
bodyMap.put("endTime",System.currentTimeMillis() + 30 * 60 * 1000); bodyMap.put("endTime",zeroTime+24*60*60*1000-1000);
bodyMap.put("instId", "1235115978015883266"); bodyMap.put("instId", xmAppApi.getLoginInfo().getInstId());
bodyMap.put("startTime", System.currentTimeMillis() + 60 * 1000); bodyMap.put("startTime", zeroTime);
bodyMap.put("teacherId","1235115979473997826"); bodyMap.put("teacherId",xmAppApi.getLoginInfo().getTid());
String bodydata = JSONObject.toJSONString(bodyMap); String bodydata = JSONObject.toJSONString(bodyMap);
......
...@@ -38,7 +38,7 @@ public class TestQueryLiveAccount extends XMBaseTest { ...@@ -38,7 +38,7 @@ public class TestQueryLiveAccount extends XMBaseTest {
public void testQueryLiveAccount() { public void testQueryLiveAccount() {
Map bodyMap = new HashMap(); Map bodyMap = new HashMap();
bodyMap.put("instId", "1235115978015883266"); bodyMap.put("instId", xmAppApi.getLoginInfo().getInstId());
String bodydata = JSONObject.toJSONString(bodyMap); String bodydata = JSONObject.toJSONString(bodyMap);
......
//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;
//
//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);
//
// JSONObject responseRes = xmAppApi.getBodyInJSON();
// Assert.assertEquals("true",responseRes.getString("success"));
// }
//}
package com.live.xmutils;
import java.util.TimeZone;
/**
* @author zhangying
* @date 2021/3/3 11:00 上午
*/
public class GetDayTime {
// long current = System.currentTimeMillis();//当前时间毫秒数
// long zero = current/(1000*3600*24)*(1000*3600*24) - TimeZone.getDefault().getRawOffset();//今天零点零分零秒的毫秒数
//
// long twelve=zero+24*60*60*1000-1;//今天23点59分59秒的毫秒数
// long yesterday=System.currentTimeMillis()-24*60*60*1000;//昨天的这一时间的毫秒数
// System.out.println(new Timestamp(current));//当前时间
// System.out.println(new Timestamp(yesterday));//昨天这一时间点
// System.out.println(new Timestamp(zero));//今天零点零分零秒
// System.out.println(new Timestamp(twelve));//今天23点59分59秒
public long getDayZeroTime() {
long now = System.currentTimeMillis() / 1000l;
long daySecond = 60 * 60 * 24;
long getDayZeroTime = (now - (now + 8 * 3600) % daySecond) * 1000 ;
return getDayZeroTime;
}
}
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
{ {
"apiPath": "/apollo/public/customerLive/getStudentCourseDay", "apiPath": "/apollo/public/customerLive/getStudentCourseDay",
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "直播C端(每课学堂)课表", "apiName": "查询C端绑定学员有课的日期",
"desc": "直播C端(每课学堂)课表" "desc": "查询C端绑定学员有课的日期"
}, },
"API_getStudentInstLinkageList": "API_getStudentInstLinkageList":
{ {
......
...@@ -57,4 +57,9 @@ ...@@ -57,4 +57,9 @@
<package name="com.live.cases.seriesCourse"></package> <package name="com.live.cases.seriesCourse"></package>
</packages> </packages>
</test> </test>
<test name="myClassAPP" preserve-order="true" verbose="3">
<packages>
<package name="com.live.cases.myClassAPP"></package>
</packages>
</test>
</suite> </suite>
\ 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