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
b9e6208d
Commit
b9e6208d
authored
Mar 05, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充删除乐器陪练课的case
parent
3ff66686
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
49 deletions
+90
-49
src/main/java/com/live/cases/musicPlay/TestDelOnlyOneClassLive.java
+37
-4
src/main/java/com/live/xmutils/GetCustomerLiveXMToken.java
+0
-45
src/main/java/com/live/xmutils/GetOnlyOneCourseData.java
+53
-0
No files found.
src/main/java/com/live/cases/musicPlay/TestDelOnlyOneClassLive.java
View file @
b9e6208d
...
...
@@ -30,7 +30,7 @@ public class TestDelOnlyOneClassLive extends XMBaseTest {
/**
* 测试删除乐器陪练课-课程"zy乐器陪练课1"
*/
@Test
@Test
(
description
=
"删除已完成的课程"
)
public
void
testDelOnlyOneClassLive
()
{
JSONObject
jsonObject
=
new
JSONObject
();
...
...
@@ -47,10 +47,10 @@ public class TestDelOnlyOneClassLive extends XMBaseTest {
/**
* 测试删除乐器陪练课-删除未成功开课的课程
*/
@Test
@Test
(
description
=
"删除未成功开课的课程"
)
public
void
testDelOnlyOneClassLive1
()
{
GetOnlyOneCourseData
getOnlyOneCourseData
=
new
GetOnlyOneCourseData
();
JSONObject
onlyOneClassCourse
=
getOnlyOneCourseData
.
getOnlyOneCourseList
();
JSONObject
onlyOneClassCourse
=
getOnlyOneCourseData
.
getOnlyOneCourseList
Expired
();
String
liveCourseId
=
onlyOneClassCourse
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
String
courseName
=
onlyOneClassCourse
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"courseName"
);
...
...
@@ -65,7 +65,7 @@ public class TestDelOnlyOneClassLive extends XMBaseTest {
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
GetOnlyOneCourseData
getOnlyOneCourseData1
=
new
GetOnlyOneCourseData
();
JSONObject
onlyOneClassCourse1
=
getOnlyOneCourseData1
.
getOnlyOneCourseList
();
JSONObject
onlyOneClassCourse1
=
getOnlyOneCourseData1
.
getOnlyOneCourseList
Expired
();
String
courseName1
=
onlyOneClassCourse1
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"courseName"
);
System
.
out
.
println
(
"courseName1 ="
+
courseName1
);
...
...
@@ -76,5 +76,38 @@ public class TestDelOnlyOneClassLive extends XMBaseTest {
}
/**
* 测试删除乐器陪练课-删除待开课的课程
*/
@Test
(
description
=
"删除待开课的课程"
)
public
void
testDelOnlyOneClassLive2
()
{
GetOnlyOneCourseData
getOnlyOneCourseData
=
new
GetOnlyOneCourseData
();
JSONObject
onlyOneClassCourse
=
getOnlyOneCourseData
.
getOnlyOneCourseListUnstart
();
String
liveCourseId
=
onlyOneClassCourse
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
String
courseName
=
onlyOneClassCourse
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"courseName"
);
System
.
out
.
println
(
"courseName ="
+
courseName
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
GetOnlyOneCourseData
getOnlyOneCourseData1
=
new
GetOnlyOneCourseData
();
JSONObject
onlyOneClassCourse1
=
getOnlyOneCourseData1
.
getOnlyOneCourseListExpired
();
String
courseName1
=
onlyOneClassCourse1
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"courseName"
);
System
.
out
.
println
(
"courseName1 ="
+
courseName1
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
Assert
.
assertNotEquals
(
courseName
,
courseName1
);
}
}
src/main/java/com/live/xmutils/GetCustomerLiveXMToken.java
deleted
100644 → 0
View file @
3ff66686
package
com
.
live
.
xmutils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.utils.XMBaseTest
;
/**
* Created by zhangying on 2020/11/20
*/
public
class
GetCustomerLiveXMToken
extends
XMBaseTest
{
public
void
getMsgAuthCode
(){
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_customerLive
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"api_login"
);
super
.
beforeTest
();
JSONObject
jsonObject
=
new
JSONObject
();
// {
// "accountNo": "15068165765",
// "certificate": "0000",
// "loginType": "PHONE_AUTH_CODE",
// "appTerm": "IOS",
// "userType": "C"
// }
jsonObject
.
put
(
"accountNo"
,
"15068165765"
);
jsonObject
.
put
(
"certificate"
,
"0000"
);
jsonObject
.
put
(
"loginType"
,
"PHONE_AUTH_CODE"
);
jsonObject
.
put
(
"appTerm"
,
"IOS"
);
jsonObject
.
put
(
"userType"
,
"C"
);
System
.
out
.
println
(
"jsonObject= "
+
jsonObject
);
okHttpClient
.
doPostRequest
(
dataApi
.
getUrl
(),
jsonObject
.
toJSONString
(),
headers
);
// xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
// //
JSONObject
responseRes
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"responseRes= "
+
responseRes
);
}
}
src/main/java/com/live/xmutils/GetOnlyOneCourseData.java
View file @
b9e6208d
...
...
@@ -40,6 +40,59 @@ public class GetOnlyOneCourseData extends XMBaseTest {
return
liveCourseList
;
}
//获取未成功开课的直播课
public
JSONObject
getOnlyOneCourseListExpired
()
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getOnlyOneClassLiveList"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeDataRequest
();
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"instId"
,
"1235115978015883266"
);
bodyMap
.
put
(
"size"
,
10
);
bodyMap
.
put
(
"courseState"
,
"EXPIRED"
);
String
bodydata
=
JSONObject
.
toJSONString
(
bodyMap
);
// dataApi.doRequest(RequestType.JSON, params, bodydata, dataheadrs);
dataApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodydata
,
headers
);
System
.
out
.
println
(
"dataApi ="
+
dataApi
);
JSONObject
liveCourseList
=
dataApi
.
getBodyInJSON
();
return
liveCourseList
;
}
//获取未成功开课的直播课
public
JSONObject
getOnlyOneCourseListUnstart
()
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getOnlyOneClassLiveList"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeDataRequest
();
Map
bodyMap
=
new
HashMap
();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"instId"
,
"1235115978015883266"
);
bodyMap
.
put
(
"size"
,
10
);
bodyMap
.
put
(
"courseState"
,
"UN_START"
);
String
bodydata
=
JSONObject
.
toJSONString
(
bodyMap
);
// dataApi.doRequest(RequestType.JSON, params, bodydata, dataheadrs);
dataApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodydata
,
headers
);
System
.
out
.
println
(
"dataApi ="
+
dataApi
);
JSONObject
liveCourseList
=
dataApi
.
getBodyInJSON
();
return
liveCourseList
;
}
public
JSONObject
creatOnlyOneCourse
()
throws
InterruptedException
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
.
setApiName
(
"API_createCourse"
)
...
...
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