Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-autotest-live
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-autotest-live
Commits
2540a3bc
Commit
2540a3bc
authored
Feb 03, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充大班互动的case
parent
c2bf4d9b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
429 additions
and
38 deletions
+429
-38
src/main/java/com/live/cases/apollo/TestQueryStudentVisitData.java
+39
-38
src/main/java/com/live/cases/interactionLive/TestGetClassReport.java
+49
-0
src/main/java/com/live/cases/interactionLive/TestGetCourseDetail.java
+48
-0
src/main/java/com/live/cases/interactionLive/TestGetInteractionClassLiveList.java
+80
-0
src/main/java/com/live/cases/interactionLive/TestGetLiveCourseRecordInfos.java
+51
-0
src/main/java/com/live/cases/interactionLive/TestQueryStudentVisitData.java
+51
-0
src/main/java/com/live/cases/interactionLive/TestQueryTeacherVisitData.java
+49
-0
src/main/java/com/live/cases/largeClassLive/TestGetClassReport.java
+49
-0
src/main/resources/apicase/apollo.json
+13
-0
No files found.
src/main/java/com/live/cases/apollo/TestQueryStudentVisitData.java
View file @
2540a3bc
package
com
.
live
.
cases
.
apollo
;
//package com.live.cases.apollo;
//
import
com.alibaba.fastjson.JSONObject
;
//import com.alibaba.fastjson.JSONObject;
import
com.live.enums.ApiModele
;
//import com.live.enums.ApiModele;
import
com.live.enums.RequestType
;
//import com.live.enums.RequestType;
import
com.live.enums.Terminal
;
//import com.live.enums.Terminal;
import
com.live.xmutils.GetLiveCourseId
;
//import com.live.xmutils.GetLiveCourseId;
import
com.live.utils.XMBaseTest
;
//import com.live.utils.XMBaseTest;
import
org.testng.Assert
;
//import org.testng.Assert;
import
org.testng.annotations.BeforeMethod
;
//import org.testng.annotations.BeforeMethod;
//
public
class
TestQueryStudentVisitData
extends
XMBaseTest
{
//public class TestQueryStudentVisitData extends XMBaseTest {
GetLiveCourseId
tools
=
new
GetLiveCourseId
();
// GetLiveCourseId tools = new GetLiveCourseId();
//
@BeforeMethod
// @BeforeMethod
public
void
beforeTest
(){
// public void beforeTest(){
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// xmAppApi.setApiModule(ApiModele.CloudClass_B)
.
setApiName
(
"API_queryStudentVisitData"
)
// .setApiName("API_queryStudentVisitData")
.
setLoginUser
(
"zhangYuM_b"
)
// .setLoginUser("zhangYuM_b")
.
setTerminal
(
Terminal
.
B
);
// .setTerminal(Terminal.B);
super
.
beforeTest
();
// super.beforeTest();
}
// }
//
//@Test
// //@Test
public
void
queryStudentVisitData
()
{
// 已重写
// public void queryStudentVisitData() {
String
id
=
tools
.
createCourse
();
//
// String id = tools.createCourse();
JSONObject
jsonObject
=
new
JSONObject
();
//
jsonObject
.
put
(
"liveCourseId"
,
"1334373001216823298"
);
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("liveCourseId","1334373001216823298");
//
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
//
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
//
Assert
.
assertEquals
(
"true"
,
responseRes
.
getString
(
"success"
));
// JSONObject responseRes = xmAppApi.getBodyInJSON();
}
// Assert.assertEquals("true",responseRes.getString("success"));
}
// }
//}
src/main/java/com/live/cases/interactionLive/TestGetClassReport.java
0 → 100644
View file @
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
;
/**
* Created by zhangying on 2020/02/03
*/
public
class
TestGetClassReport
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getClassReport"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 大班互动-老师课堂报告
*/
@Test
public
void
testGetClassReport
()
{
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"
));
}
}
src/main/java/com/live/cases/interactionLive/TestGetCourseDetail.java
0 → 100644
View file @
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
;
/**
* Created by zhangying on 2020/02/03
*/
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"
,
"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
(
"jsonBody ="
+
jsonBody
);
Assert
.
assertNotEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getJSONArray
(
"liveStudentBaseVO"
).
size
(),
0
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/java/com/live/cases/interactionLive/TestGetInteractionClassLiveList.java
0 → 100644
View file @
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
;
/**
* Created by zhangying on 2020/02/03
*/
public
class
TestGetInteractionClassLiveList
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getInteractionClassLiveList"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 大班互动直播课列表数据
*/
@Test
public
void
testGetInteractionClassLiveList
()
{
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
testGetInteractionClassLiveList1
()
{
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"
,
"1612367999999"
);
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
.
getJSONObject
(
"result"
).
getString
(
"total"
));
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/java/com/live/cases/interactionLive/TestGetLiveCourseRecordInfos.java
0 → 100644
View file @
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
;
/**
* Created by zhangying on 2020/02/03
*/
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"
,
"1356798987214893057"
);
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"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/interactionLive/TestQueryStudentVisitData.java
0 → 100644
View file @
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
;
/**
* Created by zhangying on 2020/02/03
*/
public
class
TestQueryStudentVisitData
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_queryStudentVisitData"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 大班互动直播课-学员上课数据
*/
@Test
public
void
testQueryStudentVisitData
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
"1356798987214893057"
);
jsonObject
.
put
(
"nameOrPhone"
,
""
);
jsonObject
.
put
(
"current"
,
"1"
);
jsonObject
.
put
(
"size"
,
"10000"
);
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"
));
}
}
src/main/java/com/live/cases/interactionLive/TestQueryTeacherVisitData.java
0 → 100644
View file @
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
;
/**
* Created by zhangying on 2020/02/03
*/
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"
,
"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
(
"createdReport"
),
"VALID"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/java/com/live/cases/largeClassLive/TestGetClassReport.java
0 → 100644
View file @
2540a3bc
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
TestGetClassReport
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getClassReport"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 大班直播-老师课堂报告
*/
@Test
public
void
testGetClassReport
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"courseId"
,
"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
(
"courseName"
),
"zy直播测试1"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/resources/apicase/apollo.json
View file @
2540a3bc
...
@@ -139,5 +139,17 @@
...
@@ -139,5 +139,17 @@
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"大班直播课列表"
,
"apiName"
:
"大班直播课列表"
,
"desc"
:
"大班直播课列表数据"
"desc"
:
"大班直播课列表数据"
},
"API_getInteractionClassLiveList"
:
{
"apiPath"
:
"/apollo/public/businessLive/getInteractionClassLiveList"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"大班互动直播课列表"
,
"desc"
:
"大班互动直播课列表数据"
},
"API_queryStudentVisitData"
:
{
"apiPath"
:
"/apollo/public/businessLive/queryStudentVisitData"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"查看学员直播课上课记录"
,
"desc"
:
"查看学员上课记录"
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment