Commit 4284c380 by zhangying

大班直播/大班互动-课堂报告

parent 2540a3bc
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;
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://res.xiaomai5.com/h5/index.html#/live/cloud-class-report?courseId=1356798987214893057&" +
"studentId=1235119596803903489&courseType=LARGE_CLASS_INTERACTION";
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/59Dii");
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"));
}
}
......@@ -32,14 +32,11 @@ public class TestGetClassReport extends XMBaseTest {
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"));
......
......@@ -37,8 +37,6 @@ public class TestGetLiveCourseRecordInfos extends XMBaseTest {
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");
......
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 TestGetStudentReport extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getStudentReport") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 大班互动-查看学员课堂报告
*/
@Test
public void testGetStudentReport() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("courseId","1356798987214893057");
jsonObject.put("studentId","1235119596803903489");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody);
Assert.assertEquals(jsonBody.getJSONObject("result").getString("studentId"), "1235119596803903489");
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/03
*/
public class TestConvertShortUrls_C 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://res.xiaomai5.com/h5/index.html#/live/cloud-class-report?courseId=1356196461296828418&" +
"studentId=1235119596803903489&courseType=LARGE_CLASS_LIVE";
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/59DkD");
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"));
}
}
......@@ -43,8 +43,6 @@ public class TestGetLiveCourseRecordInfos extends XMBaseTest {
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");
......
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 TestGetStudentReport extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
.setApiName("API_getStudentReport") // API 名称 必传
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
super.beforeTest();
System.out.println(xmAppApi);
}
/**
* 大班直播-查看学员课堂报告
*/
@Test
public void testGetStudentReport() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("courseId","1356196461296828418");
jsonObject.put("studentId","1235119596803903489");
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
System.out.println(xmAppApi);
JSONObject jsonBody = xmAppApi.getBodyInJSON();
System.out.println("jsonBody ="+jsonBody);
Assert.assertEquals(jsonBody.getJSONObject("result").getString("studentId"), "1235119596803903489");
Assert.assertEquals("true", jsonBody.getString("success"));
Assert.assertEquals("200", jsonBody.getString("code"));
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
}
}
......@@ -152,7 +152,7 @@
"API_convertShortUrls": {
"apiPath": "/sales/public/businessShow/convertShortUrls",
"apiContentType": "application/json;charset=utf-8",
"apiName": "直播课分享",
"desc": "直播课分享"
"apiName": "转成短链接",
"desc": "转成短链接"
}
}
\ No newline at end of file
......@@ -151,5 +151,11 @@
"apiContentType": "application/json;charset=utf-8",
"apiName": "查看学员直播课上课记录",
"desc": "查看学员上课记录"
},
"API_getStudentReport": {
"apiPath": "/apollo/anon/businessLive/getStudentReport",
"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