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
e5d6798b
Commit
e5d6798b
authored
Feb 23, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加case
parent
633ffb0f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
0 deletions
+98
-0
src/main/java/com/live/cases/largeClassLive/TestLargeClassDelCourse.java
+24
-0
src/main/java/com/live/cases/liveAssets/TestRechargeProtocol.java
+44
-0
src/main/java/com/live/xmutils/GetLiveCourseData.java
+23
-0
src/main/resources/apicase/api-b.json
+7
-0
No files found.
src/main/java/com/live/cases/largeClassLive/TestLargeClassDelCourse.java
View file @
e5d6798b
...
...
@@ -108,4 +108,28 @@ public class TestLargeClassDelCourse extends XMBaseTest {
}
/**
* 大班直播课-删除课程(上课中)
*/
@Test
public
void
testLargeClassDelCourse3
()
{
GetLiveCourseData
getLiveCourseData
=
new
GetLiveCourseData
();
JSONObject
getLargeCourseData
=
getLiveCourseData
.
getLargeClassLiveListStarting
();
String
liveCourseId
=
getLargeCourseData
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
System
.
out
.
println
(
"liveCourseId =="
+
liveCourseId
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
Assert
.
assertEquals
(
"删除课程处于上课中状态"
,
jsonBody
.
getString
(
"message"
));
Assert
.
assertEquals
(
"false"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"10000"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/java/com/live/cases/liveAssets/TestRechargeProtocol.java
0 → 100644
View file @
e5d6798b
package
com
.
live
.
cases
.
liveAssets
;
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
com.live.xmutils.GetLiveCourseData
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* @author zhangying
* @date 2021/2/23 6:08 下午
*/
public
class
TestRechargeProtocol
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_rechargeProtocol"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 互动班课-账户管理-服务协议签订记录
*/
@Test
public
void
testRechargeProtocol
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"instId"
,
xmAppApi
.
getLoginInfo
().
getInstId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
}
}
src/main/java/com/live/xmutils/GetLiveCourseData.java
View file @
e5d6798b
...
...
@@ -81,6 +81,29 @@ public class GetLiveCourseData extends XMBaseTest {
return
liveCourseList
;
}
public
JSONObject
getLargeClassLiveListStarting
()
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getLargeClassLiveList"
)
// 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"
,
"STARTING"
);
String
bodydata
=
JSONObject
.
toJSONString
(
bodyMap
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
params
,
bodydata
,
dataheadrs
);
JSONObject
liveCourseList
=
dataApi
.
getBodyInJSON
();
return
liveCourseList
;
}
public
JSONObject
createLargeClassLive
()
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_createLargeClassLive"
)
...
...
src/main/resources/apicase/api-b.json
View file @
e5d6798b
...
...
@@ -172,5 +172,11 @@
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"视频课次列表"
,
"desc"
:
"视频课次列表"
},
"API_rechargeProtocol"
:
{
"apiPath"
:
"/business/public/liveAssets/rechargeProtocol"
,
"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