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
cb393199
Commit
cb393199
authored
Jan 11, 2021
by
zhangyumeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改断言
parent
bef2aa4a
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
282 additions
and
20 deletions
+282
-20
src/main/java/com/live/cases/apollo/TestCourseLaunch.java
+0
-5
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
+2
-2
src/main/java/com/live/cases/apollo/TestQueryStudentVisitData.java
+36
-0
src/main/java/com/live/cases/apollo/TestQueryTeacherVisitData.java
+41
-0
src/main/java/com/live/cases/apollo/TestSendNotify2Student.java
+1
-1
src/main/java/com/live/cases/classReport/TestGetClassReport.java
+40
-0
src/main/java/com/live/cases/classReport/TestGetStudentReport.java
+44
-0
src/main/java/com/live/cases/fileManage/testCommonFolderList.java
+3
-4
src/main/java/com/live/cases/fileManage/testDelCommonFolder.java
+6
-3
src/main/java/com/live/xmutils/GetFolderData.java
+0
-2
src/main/java/com/live/xmutils/GetLiveCourseId.java
+3
-1
src/main/java/com/live/xmutils/GetStudentId.java
+59
-0
src/main/resources/apicase/api-b.json
+32
-0
src/main/resources/parameter.json
+15
-2
No files found.
src/main/java/com/live/cases/apollo/TestCourseLaunch.java
View file @
cb393199
...
...
@@ -4,15 +4,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.GetLiveCourseId
;
import
com.sun.org.apache.xerces.internal.xs.StringList
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* title获取直播器启动协议
...
...
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
View file @
cb393199
...
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.GetLiveCourseId
;
import
com.live.
xm
utils.GetLiveCourseId
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
...
...
@@ -12,7 +12,7 @@ import org.testng.annotations.Test;
/**
* title
B
端获取直播课下转码后的文档列表
* title
客户
端获取直播课下转码后的文档列表
* by 张雨朦
*/
...
...
src/main/java/com/live/cases/apollo/TestQueryStudentVisitData.java
0 → 100644
View file @
cb393199
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.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
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
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
}
}
src/main/java/com/live/cases/apollo/TestQueryTeacherVisitData.java
0 → 100644
View file @
cb393199
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.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* 查询老师上课数据
* by 张雨朦
*/
public
class
TestQueryTeacherVisitData
extends
XMBaseTest
{
GetLiveCourseId
tools
=
new
GetLiveCourseId
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_queryTeacherVisitData"
)
.
setLoginUser
(
"zhangYuM_b"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeTest
();
}
@Test
public
void
queryTeacherVisitData
()
{
String
id
=
tools
.
createCourse
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
id
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
}
}
src/main/java/com/live/cases/apollo/TestSendNotify2Student.java
View file @
cb393199
...
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.GetLiveCourseId
;
import
com.live.
xm
utils.GetLiveCourseId
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
...
...
src/main/java/com/live/cases/classReport/TestGetClassReport.java
0 → 100644
View file @
cb393199
package
com
.
live
.
cases
.
classReport
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* 获取课次课堂报告(老师查看)
* by 张雨朦
*/
public
class
TestGetClassReport
extends
XMBaseTest
{
//GetLiveCourseId tools = new GetLiveCourseId();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_getClassReport"
)
.
setLoginUser
(
"zhangYuM_b"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeTest
();
}
@Test
public
void
getClassReport
()
{
//String id = tools.createCourse();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"courseId"
,
"1334393215933386754"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
}
}
src/main/java/com/live/cases/classReport/TestGetStudentReport.java
0 → 100644
View file @
cb393199
package
com
.
live
.
cases
.
classReport
;
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.xmutils.GetStudentId
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* 获取学生课堂报告
* by 张雨朦
*/
public
class
TestGetStudentReport
extends
XMBaseTest
{
GetStudentId
tools
=
new
GetStudentId
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_getStudentReport"
)
.
setLoginUser
(
"zhangYuM_b"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeTest
();
}
@Test
public
void
getStudentReport
()
{
String
id
=
tools
.
getFinishLiveCourseId
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"courseId"
,
"1334309884730617857"
);
jsonObject
.
put
(
"studentId"
,
id
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
}
}
src/main/java/com/live/cases/fileManage/testCommonFolderList.java
View file @
cb393199
...
...
@@ -34,15 +34,14 @@ public class testCommonFolderList extends XMBaseTest {
jsonObject
.
put
(
"current"
,
1
);
jsonObject
.
put
(
"disk"
,
"COMMON"
);
jsonObject
.
put
(
"folderIdType"
,
"FOLDER"
);
jsonObject
.
put
(
"instId"
,
"1300628703858597889"
);
jsonObject
.
put
(
"instId"
,
xmAppApi
.
getLoginInfo
().
getInstId
()
);
jsonObject
.
put
(
"searchName"
,
null
);
jsonObject
.
put
(
"size"
,
10
);
System
.
out
.
println
(
"请求"
+
jsonObject
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
)
.
assetsSuccess
(
true
)
;
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
//
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assert
NotNull
(
responseRes
);
Assert
.
assert
Equals
(
"true"
,
responseRes
.
getString
(
"success"
)
);
}
}
src/main/java/com/live/cases/fileManage/testDelCommonFolder.java
View file @
cb393199
...
...
@@ -6,6 +6,7 @@ import com.live.enums.ApiModele;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
...
...
@@ -27,11 +28,11 @@ public class testDelCommonFolder extends XMBaseTest {
super
.
beforeTest
();
}
@Test
(
enabled
=
false
)
//@Test
public
void
testDelCommonFolderList
(){
GetFolderData
testCommonFolderList
=
new
GetFolderData
();
String
id
=
testCommonFolderList
.
getCommonFolderListFirstId
();
System
.
out
.
println
(
"获取id"
+
id
);
//
System.out.println("获取id" + id);
JSONObject
jsonObject
=
new
JSONObject
();
List
StringList
=
new
ArrayList
();
...
...
@@ -40,9 +41,11 @@ public class testDelCommonFolder extends XMBaseTest {
jsonObject
.
put
(
"instId"
,
"1300628703858597889"
);
System
.
out
.
println
(
"请求"
+
jsonObject
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
)
.
assetsSuccess
(
true
)
;
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
"true"
,
responseRes
.
getString
(
"success"
));
}
}
src/main/java/com/live/xmutils/GetFolderData.java
View file @
cb393199
...
...
@@ -116,8 +116,6 @@ public class GetFolderData extends XMBaseTest {
String
id
=
responseRes
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
return
id
;
}
}
src/main/java/com/live/utils/GetLiveCourseId.java
→
src/main/java/com/live/
xm
utils/GetLiveCourseId.java
View file @
cb393199
package
com
.
live
.
utils
;
package
com
.
live
.
xm
utils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.utils.TimeSetting
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
...
...
@@ -61,4 +62,5 @@ public class GetLiveCourseId extends XMBaseTest {
}
}
src/main/java/com/live/xmutils/GetStudentId.java
0 → 100644
View file @
cb393199
package
com
.
live
.
xmutils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
public
class
GetStudentId
extends
XMBaseTest
{
//private Object JSONArray;
public
String
getFinishLiveCourseId
()
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_queryStudentVisitData"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
();
// JSONObject obj = new JSONObject();
// obj.put("courseState", "FINISH");
// obj.put("instId", dataApi.getLoginInfo().getInstId());
//
// dataApi.doRequest(com.live.enums.RequestType.JSON, dataparams, obj.toJSONString(), dataheadrs).assetsSuccess(true);
//
// String liveCourseId = dataApi.getBodyInJSON().getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("liveCourseId");
//dataApi.setApiName("API_queryStudentVisitData");
//super.beforeDataRequest();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
"1334309884730617857"
);
dataApi
.
doRequest
(
com
.
live
.
enums
.
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
responseRes
=
dataApi
.
getBodyInJSON
();
JSONArray
jsonArray
=
responseRes
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
);
System
.
out
.
println
(
"数组是"
+
jsonArray
);
String
liveSId
=
null
;
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
object
=
jsonArray
.
getJSONObject
(
i
);
String
createdReport
=
(
String
)
object
.
get
(
"createdReport"
);
String
liveStudentId
=
(
String
)
object
.
get
(
"liveStudentId"
);
// if (createdReport.equals("VALID")) {
// System.out.println("if语句");
// LiveSId = liveStudentId;
// break;
// }
//return liveStudentId;
System
.
out
.
println
(
liveStudentId
+
"学生id"
);
}
return
liveSId
;
}
}
src/main/resources/apicase/api-b.json
View file @
cb393199
...
...
@@ -106,5 +106,36 @@
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"获取机构老师id"
,
"desc"
:
"获取机构老师id"
},
"API_queryTeacherVisitData"
:
{
"apiPath"
:
"/apollo/public/businessLive/queryTeacherVisitData"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"查询老师上课数据"
,
"desc"
:
"查询老师上课数据"
},
"API_queryStudentVisitData"
:
{
"apiPath"
:
"/apollo/public/businessLive/queryStudentVisitData"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"查询学生上课数据"
,
"desc"
:
"查询学生上课数据"
},
"API_getClassReport"
:
{
"apiPath"
:
"/apollo/public/businessLive/getClassReport"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"获取课次课堂报告"
,
"desc"
:
"获取课次课堂报告"
},
"API_getStudentReport"
:
{
"apiPath"
:
"/apollo/anon/businessLive/getStudentReport"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"获取学生课堂报告"
,
"desc"
:
"获取学生课堂报告"
},
"API_getInteractionClassLiveList"
:
{
"apiPath"
:
"/apollo/public/businessLive/getInteractionClassLiveList"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"获取已结束课程列表"
,
"desc"
:
"获取已结束课程列表"
}
}
\ No newline at end of file
src/main/resources/parameter.json
View file @
cb393199
...
...
@@ -93,8 +93,7 @@
"userType"
:
"B"
,
"tid"
:
"1235818360728756225"
},
"rc_b"
:
{
"rc_b"
:
{
"instId"
:
"1214011838628593666"
,
"accountNo"
:
"15210636896"
,
"certificate"
:
"afdd0b4ad2ec172c586e2150770fbf9e"
,
...
...
@@ -271,8 +270,22 @@
"uid"
:
"1291264680439021569"
,
"userType"
:
"B"
,
"tid"
:
"1291264680405467138"
},
"zhangyumeng_sowplan_b"
:
{
"prod"
:
{
"storeId"
:
"1211601438838495868"
,
"storeUserId"
:
"1338693764895141890"
,
"userId"
:
"1338693764747345922"
,
"accountNo"
:
"15656960812"
,
"certificate"
:
"290112bfbde696fcb91284bba1e2655b"
,
"aid"
:
"1291264680405467138"
,
"uid"
:
"1291264680439021569"
,
"userType"
:
"B"
,
"tid"
:
"1291264680405467138"
}
}
}
}
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