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
e8acdd4a
Commit
e8acdd4a
authored
Feb 04, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充乐器陪练的case
parent
0d487006
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
368 additions
and
42 deletions
+368
-42
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
+44
-40
src/main/java/com/live/cases/largeClassLive/TestGetCourseDetail.java
+0
-1
src/main/java/com/live/cases/largeClassLive/TestQueryStudentVisitData.java
+51
-0
src/main/java/com/live/cases/musicPlay/TestGetClassReport.java
+47
-0
src/main/java/com/live/cases/musicPlay/TestGetCourseDetail.java
+48
-0
src/main/java/com/live/cases/musicPlay/TestGetOnlyOneClassLiveList.java
+28
-1
src/main/java/com/live/cases/musicPlay/TestGetStudentReport.java
+50
-0
src/main/java/com/live/cases/musicPlay/TestQueryStudentVisitData.java
+51
-0
src/main/java/com/live/cases/musicPlay/TestQueryTeacherVisitData.java
+49
-0
No files found.
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
View file @
e8acdd4a
//
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
;
//
import org.testng.annotations.Test;
import
org.testng.annotations.Test
;
//
//
/
//
**
/**
//
* title 客户端获取直播课下转码后的文档列表
* title 客户端获取直播课下转码后的文档列表
// * by 张雨朦
* by 张雨朦-->zhangying
//
*/
*/
//
//
public class TestGetCourseDocList extends XMBaseTest {
public
class
TestGetCourseDocList
extends
XMBaseTest
{
//
//
//
@BeforeMethod
@BeforeMethod
//
public void beforeTest() {
public
void
beforeTest
()
{
//
xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
//
.setApiName("API_getCourseDocList")
.
setApiName
(
"API_getCourseDocList"
)
// .setLoginUser("zhangYuM_
b")
.
setLoginUser
(
"zhangy-
b"
)
//
.setTerminal(Terminal.B);
.
setTerminal
(
Terminal
.
B
);
//
super.beforeTest();
super
.
beforeTest
();
//
}
}
//
//
@Test
@Test
//
public void getCourseDocList() {
public
void
getCourseDocList
()
{
// GetLiveCourseId tools = new GetLiveCourseId();
// GetLiveCourseId tools = new GetLiveCourseId();
// String id = tools.createCourse();
// String id = tools.createCourse();
//
// JSONObject jsonObject = new JSONObject();
JSONObject
jsonObject
=
new
JSONObject
();
// jsonObject.put("liveCourseId", id);
jsonObject
.
put
(
"liveCourseId"
,
"1356798987214893057"
);
//
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
// JSONObject responseRes = xmAppApi.getBodyInJSON();
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"responseRes= "
+
responseRes
);
Assert
.
assertNotEquals
(
0
,
responseRes
.
getJSONArray
(
"result"
).
size
());
Assert
.
assertEquals
(
"true"
,
responseRes
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
responseRes
.
getString
(
"message"
));
// Assert.assertNotNull(responseRes);
// Assert.assertNotNull(responseRes);
//
}
}
//
}
}
src/main/java/com/live/cases/largeClassLive/TestGetCourseDetail.java
View file @
e8acdd4a
...
@@ -37,7 +37,6 @@ public class TestGetCourseDetail extends XMBaseTest {
...
@@ -37,7 +37,6 @@ public class TestGetCourseDetail extends XMBaseTest {
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"courseName ="
+
jsonBody
.
getJSONObject
(
"result"
));
Assert
.
assertNotEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getJSONArray
(
"liveStudentBaseVO"
).
size
(),
0
);
Assert
.
assertNotEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getJSONArray
(
"liveStudentBaseVO"
).
size
(),
0
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
...
...
src/main/java/com/live/cases/largeClassLive/TestQueryStudentVisitData.java
0 → 100644
View file @
e8acdd4a
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
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"
,
"1356196461296828418"
);
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/musicPlay/TestGetClassReport.java
0 → 100644
View file @
e8acdd4a
package
com
.
live
.
cases
.
musicPlay
;
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"
,
"1357211775460552705"
);
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
(
"courseName"
),
"zy乐器陪练自动化测试"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/java/com/live/cases/musicPlay/TestGetCourseDetail.java
0 → 100644
View file @
e8acdd4a
package
com
.
live
.
cases
.
musicPlay
;
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/04
*/
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"
,
"1357211775460552705"
);
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
);
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/musicPlay/TestGetOnlyOneClassLiveList.java
View file @
e8acdd4a
...
@@ -26,7 +26,7 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
...
@@ -26,7 +26,7 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
}
}
/**
/**
* 测试乐器陪练课列表
* 测试乐器陪练课列表
-默认查询条件
*/
*/
@Test
@Test
public
void
testGetOnlyOneClassLiveList
()
{
public
void
testGetOnlyOneClassLiveList
()
{
...
@@ -45,5 +45,32 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
...
@@ -45,5 +45,32 @@ public class TestGetOnlyOneClassLiveList extends XMBaseTest {
}
}
/**
* 测试乐器陪练课列表-全部查询条件
*/
@Test
public
void
testGetOnlyOneClassLiveList1
()
{
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"
,
"1612454399999"
);
jsonObject
.
put
(
"teacherId"
,
"1235115979473997826"
);
jsonObject
.
put
(
"teacherName"
,
"主账户老师"
);
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
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
}
src/main/java/com/live/cases/musicPlay/TestGetStudentReport.java
0 → 100644
View file @
e8acdd4a
package
com
.
live
.
cases
.
musicPlay
;
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"
));
}
}
src/main/java/com/live/cases/musicPlay/TestQueryStudentVisitData.java
0 → 100644
View file @
e8acdd4a
package
com
.
live
.
cases
.
musicPlay
;
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"
,
"1357211775460552705"
);
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/musicPlay/TestQueryTeacherVisitData.java
0 → 100644
View file @
e8acdd4a
package
com
.
live
.
cases
.
musicPlay
;
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/04
*/
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"
,
"1357211775460552705"
);
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
);
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"
));
}
}
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