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
65d13da5
Commit
65d13da5
authored
Jan 04, 2021
by
fangyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update testng.xml
parent
d10534de
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
273 additions
and
269 deletions
+273
-269
src/main/java/com/live/cases/apollo/TestChangeCourseState.java
+59
-57
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
+42
-42
src/main/java/com/live/cases/apollo/TestInitXmLive.java
+57
-57
src/main/java/com/live/cases/interactionLive/TestGetScheduleFileCount_C.java
+59
-59
src/main/java/com/live/cases/interactionLive/TestGetStudentInstLinkageList_C.java
+53
-53
testng.xml
+3
-1
No files found.
src/main/java/com/live/cases/apollo/TestChangeCourseState.java
View file @
65d13da5
//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.GetLiveCourseData;
//import com.xiaomai.utils.XMBaseTest;
//import org.testng.Assert;
//import org.testng.annotations.BeforeMethod;
//import org.testng.annotations.Test;
//
///**
// * Created by zhangying on 2020/11/27
// */
//
//public class TestChangeCourseState extends XMBaseTest {
//
// @BeforeMethod
// public void beforeTest() {
// xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
// .setApiName("api_changeCourseState") // API 名称 必传
// .setLoginUser("zhangy-b") // http 接口,测试账号 必传
// .setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
// super.beforeTest();
// }
//
// /**
// * 测试改变直播课次状态
// */
// @Test
// public void testChangeCourseState() {
// GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
// JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList();
//
// JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0);
// String liveCourseId= (String) liveCourse.get("liveCourseId");
// if (liveCourseId==null){
// largeClassCourse=getLiveCourseData.createLargeClassLive();
// liveCourseId= (String) largeClassCourse.get("liveCourseId");
// }
// System.out.println("liveCourseId ="+liveCourseId);
//
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("liveCourseId",liveCourseId);testInitXmLive
// jsonObject.put("courseState","STARTING");
//
// xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
// JSONObject jsonBody = xmAppApi.getBodyInJSON();
//
// Assert.assertEquals("true", jsonBody.getString("success"));
// Assert.assertEquals("操作成功!", jsonBody.getString("message"));
//
// }
//
//
//}
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.GetLiveCourseData
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* Created by zhangying on 2020/11/27
*/
public
class
TestChangeCourseState
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"api_changeCourseState"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
System
.
out
.
println
(
xmAppApi
);
}
/**
* 测试改变直播课次状态
*/
@Test
public
void
testChangeCourseState
()
{
GetLiveCourseData
getLiveCourseData
=
new
GetLiveCourseData
();
JSONObject
largeClassCourse
=
getLiveCourseData
.
getLargeClassLiveList
();
JSONObject
liveCourse
=
largeClassCourse
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
);
String
liveCourseId
=
(
String
)
liveCourse
.
get
(
"liveCourseId"
);
if
(
liveCourseId
==
null
){
largeClassCourse
=
getLiveCourseData
.
createLargeClassLive
();
liveCourseId
=
(
String
)
largeClassCourse
.
get
(
"liveCourseId"
);
}
System
.
out
.
println
(
"liveCourseId ="
+
liveCourseId
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
jsonObject
.
put
(
"courseState"
,
"STARTING"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/apollo/TestGetCourseDocList.java
View file @
65d13da5
//
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.utils.GetLiveCourseId;
//
import com.xiaomai.utils.XMBaseTest;
//
import org.testng.annotations.BeforeMethod;
//
import org.testng.annotations.Test;
//
//
/
//
**
//
* title B端获取直播课下转码后的文档列表
//
* by 张雨朦
//
*/
//
//
public class TestGetCourseDocList extends XMBaseTest {
//
//
GetLiveCourseId tools = new GetLiveCourseId();
//
//
@BeforeMethod
//
public void beforeTest() {
//
xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
//
.setApiName("API_getCourseDocList")
//
.setLoginUser("zhangYuM_b")
//
.setTerminal(Terminal.B);
//
super.beforeTest();
//
}
//
//
@Test
//
public void getCourseDocList() {
//
//
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();
//
}
//
}
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.utils.GetLiveCourseId
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* title B端获取直播课下转码后的文档列表
* by 张雨朦
*/
public
class
TestGetCourseDocList
extends
XMBaseTest
{
GetLiveCourseId
tools
=
new
GetLiveCourseId
();
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
.
setApiName
(
"API_getCourseDocList"
)
.
setLoginUser
(
"zhangYuM_b"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeTest
();
}
@Test
public
void
getCourseDocList
()
{
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/TestInitXmLive.java
View file @
65d13da5
//
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.GetLiveCourseData;
//
import com.xiaomai.utils.XMBaseTest;
//
import org.testng.Assert;
//
import org.testng.annotations.BeforeMethod;
//
import org.testng.annotations.Test;
//
//
/
//
**
//
* Created by zhangying on 2020/11/27
//
*/
//
//
public class TestInitXmLive extends XMBaseTest {
//
//
@BeforeMethod
//
public void beforeTest() {
//
xmAppApi.setApiModule(ApiModele.CloudClass_apollo) // API 所属模块 必传 读取配置文件config.properties配置的api地址
//
.setApiName("api_initXmLive") // API 名称 必传
//
.setLoginUser("zhangy-b") // http 接口,测试账号 必传
//
.setTerminal(Terminal.B); // 所属端位(B端,C端,M端等, 必传)
//
super.beforeTest();
//
}
//
//
/**
//
* 测试初始化直播间信息
//
*/
//
@Test
//
public void testInitXmLive() {
//
GetLiveCourseData getLiveCourseData=new GetLiveCourseData();
//
JSONObject largeClassCourse=getLiveCourseData.getLargeClassLiveList();
//
//
JSONObject liveCourse=largeClassCourse.getJSONObject("result").getJSONArray("records").getJSONObject(0);
//
String liveCourseId= (String) liveCourse.get("liveCourseId");
//
if (liveCourseId==null){
//
largeClassCourse=getLiveCourseData.createLargeClassLive();
//
liveCourseId= (String) largeClassCourse.get("liveCourseId");
//
}
//
System.out.println("liveCourseId ="+liveCourseId);
//
//
JSONObject jsonObject = new JSONObject();
//
jsonObject.put("liveCourseId",liveCourseId);
//
//
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
//
JSONObject jsonBody = xmAppApi.getBodyInJSON();
//
//
Assert.assertEquals("true", jsonBody.getString("success"));
//
Assert.assertEquals("操作成功!", jsonBody.getString("message"));
//
//
}
//
//
//
}
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.GetLiveCourseData
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* Created by zhangying on 2020/11/27
*/
public
class
TestInitXmLive
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"api_initXmLive"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 测试初始化直播间信息
*/
@Test
public
void
testInitXmLive
()
{
GetLiveCourseData
getLiveCourseData
=
new
GetLiveCourseData
();
JSONObject
largeClassCourse
=
getLiveCourseData
.
getLargeClassLiveList
();
JSONObject
liveCourse
=
largeClassCourse
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
);
String
liveCourseId
=
(
String
)
liveCourse
.
get
(
"liveCourseId"
);
if
(
liveCourseId
==
null
){
largeClassCourse
=
getLiveCourseData
.
createLargeClassLive
();
liveCourseId
=
(
String
)
largeClassCourse
.
get
(
"liveCourseId"
);
}
System
.
out
.
println
(
"liveCourseId ="
+
liveCourseId
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/interactionLive/TestGetScheduleFileCount_C.java
View file @
65d13da5
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.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author NHX
* @Function C端获取课表文件计数
* @Date 2020/11/19 15:01
*/
public
class
TestGetScheduleFileCount_C
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_customerLive
)
// API 所属模块
.
setApiName
(
"API_getScheduleFileCount"
)
// API 名称
.
setLoginUser
(
"NHX_c"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
C
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"C端获取课表文件计数:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"C端获取课表文件计数"
)
public
void
testLoadStudentListAPI
(){
List
list
=
new
ArrayList
();
list
.
add
(
"1145613399253643266"
);
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
bodyMap
.
put
(
"scheduleIds"
,
list
);
JSONObject
jsonBody
=
new
JSONObject
();
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"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.xiaomai.utils.XMBaseTest;
//
import org.testng.Assert;
//
import org.testng.annotations.BeforeMethod;
//
import org.testng.annotations.Test;
//
//
import java.util.ArrayList;
//
import java.util.HashMap;
//
import java.util.List;
//
import java.util.Map;
//
/
//
**
//
* @author NHX
//
* @Function C端获取课表文件计数
//
* @Date 2020/11/19 15:01
//
*/
//
public class TestGetScheduleFileCount_C extends XMBaseTest {
//
//
@BeforeMethod
//
public void beforeTest() {
//
xmAppApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块
//
.setApiName("API_getScheduleFileCount") // API 名称
//
.setLoginUser("NHX_c") // http 接口,测试账号
//
.setTerminal(Terminal.C); // 所属端位(B端,C端,M端等, 必传)
//
//
//
dal.setCase_owner("NHX")
//
.setCase_name("C端获取课表文件计数:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
//
//
super.beforeTest();
//
}
//
//
@Test(description = "C端获取课表文件计数")
//
public void testLoadStudentListAPI(){
//
//
List list = new ArrayList();
//
list.add("1145613399253643266");
//
//
Map<String,Object> bodyMap = new HashMap<>();
//
bodyMap.put("scheduleIds",list);
//
//
JSONObject jsonBody = new JSONObject();
//
String data = jsonBody.toJSONString();
//
//
System.out.println("请求参数==========="+data);
//
//
xmAppApi.doRequest(RequestType.JSON, params, data, headers);
//
JSONObject jsonResponseBody = xmAppApi.getBodyInJSON();
//
Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!");
//
//
//
}
//
//
}
src/main/java/com/live/cases/interactionLive/TestGetStudentInstLinkageList_C.java
View file @
65d13da5
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function C端获取学生信息列表
* @Date 2020/11/19 15:01
*/
public
class
TestGetStudentInstLinkageList_C
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_customerLive
)
// API 所属模块
.
setApiName
(
"API_getStudentInstLinkageList"
)
// API 名称
.
setLoginUser
(
"NHX_c"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
C
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"C端获取学生信息列表:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"C端获取学生信息列表"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
// "exception": "java.lang.IllegalArgumentException: userId不能为空; headers加userId
headers
.
put
(
"userId"
,
"1145612151844098049"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
//
package com.live.cases.interactionLive;
//
//
import com.alibaba.fastjson.JSONObject;
//
import com.live.enums.ApiModele;
//
import com.xiaomai.enums.RequestType;
//
import com.xiaomai.enums.Terminal;
//
import com.xiaomai.utils.XMBaseTest;
//
import org.testng.Assert;
//
import org.testng.annotations.BeforeMethod;
//
import org.testng.annotations.Test;
//
import java.util.HashMap;
//
import java.util.Map;
//
/
//
**
//
* @author NHX
//
* @Function C端获取学生信息列表
//
* @Date 2020/11/19 15:01
//
*/
//
public class TestGetStudentInstLinkageList_C extends XMBaseTest {
//
//
@BeforeMethod
//
public void beforeTest() {
//
xmAppApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块
//
.setApiName("API_getStudentInstLinkageList") // API 名称
//
.setLoginUser("NHX_c") // http 接口,测试账号
//
.setTerminal(Terminal.C); // 所属端位(B端,C端,M端等, 必传)
//
//
dal.setCase_owner("NHX")
//
.setCase_name("C端获取学生信息列表:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
//
//
super.beforeTest();
//
}
//
//
@Test(description = "C端获取学生信息列表")
//
public void testLoadStudentListAPI(){
//
//
Map<String,Object> bodyMap = new HashMap<>();
//
//
JSONObject jsonBody = new JSONObject(bodyMap);
//
String data = jsonBody.toJSONString();
//
//
System.out.println("请求参数==========="+data);
//
// "exception": "java.lang.IllegalArgumentException: userId不能为空; headers加userId
//
headers.put("userId","1145612151844098049");
//
//
xmAppApi.doRequest(RequestType.JSON, params, data, headers);
//
JSONObject jsonResponseBody = xmAppApi.getBodyInJSON();
//
Assert.assertEquals(jsonResponseBody.getString("success"), "true", "操作成功!");
//
//
//
}
//
//
}
testng.xml
View file @
65d13da5
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite
name=
"xm-autotest-live"
parallel=
"methods"
thread-count=
"20"
data-provider-thread-count=
"5"
>
<!--<suite name="xm-autotest-live" parallel="true" thread-count="20" data-provider-thread-count="5" >-->
<suite
name=
"xm-autotest-live"
parallel=
"false"
>
<listeners>
<listener
class-name=
"com.xiaomai.client.RetryListener"
/>
...
...
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