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
a9433cc1
Commit
a9433cc1
authored
May 22, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改报告报错(开课后10min之内结束直播课避免扣费导致报错)
parent
b487ce65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
src/main/java/com/live/cases/interactionLive/TestLargeInteractionDelCourse.java
+6
-4
src/main/java/com/live/cases/liveClientT/cloundClass/TestChangeCourseState.java
+29
-1
src/main/java/com/live/xmutils/GetLiveCourseData.java
+20
-0
No files found.
src/main/java/com/live/cases/interactionLive/TestLargeInteractionDelCourse.java
View file @
a9433cc1
...
...
@@ -26,15 +26,15 @@ public class TestLargeInteractionDelCourse extends XMBaseTest {
}
/**
* 大班互动直播课-删除
上课中
的课程
* 大班互动直播课-删除
未成功开课
的课程
*/
@Test
(
description
=
"大班互动直播课-删除未成功开课的课程"
)
public
void
testGetCourseDetail
()
{
GetLiveCourseData
getLiveCourseData
=
new
GetLiveCourseData
();
JSONObject
get
Large
CourseData
=
getLiveCourseData
.
getInteractionClassLiveListWithStatus
(
"EXPIRED"
);
System
.
out
.
println
(
"get
LargeCourseData =="
+
getLarge
CourseData
);
JSONObject
get
Interaction
CourseData
=
getLiveCourseData
.
getInteractionClassLiveListWithStatus
(
"EXPIRED"
);
System
.
out
.
println
(
"get
InteractionCourseData =="
+
getInteraction
CourseData
);
String
liveCourseId
=
get
Large
CourseData
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
String
liveCourseId
=
get
Interaction
CourseData
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
System
.
out
.
println
(
"liveCourseId ="
+
liveCourseId
);
JSONObject
jsonObject
=
new
JSONObject
();
...
...
@@ -149,6 +149,8 @@ public class TestLargeInteractionDelCourse extends XMBaseTest {
String
liveCourseId1
=
getLargeCourseData1
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
System
.
out
.
println
(
"liveCourseId1 =="
+
liveCourseId1
);
JSONObject
finishCourse
=
getLiveCourseData
.
changeCourseStateToFinish
(
liveCourseId1
);
Assert
.
assertEquals
(
"false"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"删除课程处于上课中状态"
,
jsonBody
.
getString
(
"message"
));
}
...
...
src/main/java/com/live/cases/liveClientT/cloundClass/TestChangeCourseState.java
View file @
a9433cc1
...
...
@@ -28,7 +28,7 @@ public class TestChangeCourseState extends XMBaseTest {
}
/**
* 测试改变直播课次状态
* 测试改变直播课次状态
-开始直播
*/
@Test
public
void
testChangeCourseState
()
throws
InterruptedException
{
...
...
@@ -54,4 +54,32 @@ public class TestChangeCourseState extends XMBaseTest {
}
/**
* 测试改变直播课次状态-结束直播
*/
@Test
(
description
=
"修改课程状态为结束"
)
public
void
testChangeCourseState1
()
throws
InterruptedException
{
GetLiveCourseData
getLiveCourseData
=
new
GetLiveCourseData
();
JSONObject
getInteractionCourseData
=
getLiveCourseData
.
getInteractionClassLiveListWithStatus
(
"STARTING"
);
String
liveCourseId
=
getInteractionCourseData
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
);
System
.
out
.
println
(
"liveCourseId ="
+
liveCourseId
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
jsonObject
.
put
(
"courseState"
,
"FINISH"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
JSONObject
classLiveList
=
getLiveCourseData
.
getLargeClassLiveList
();
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
Assert
.
assertEquals
(
"STARTING"
,
classLiveList
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"courseState"
));
Assert
.
assertEquals
(
liveCourseId
,
classLiveList
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"liveCourseId"
));
}
}
src/main/java/com/live/xmutils/GetLiveCourseData.java
View file @
a9433cc1
...
...
@@ -126,6 +126,26 @@ public class GetLiveCourseData extends XMBaseTest {
return
liveCourseList
;
}
public
JSONObject
changeCourseStateToFinish
(
String
liveCourseId
)
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"api_changeCourseState"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeDataRequest
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
jsonObject
.
put
(
"courseState"
,
"FINISH"
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
dataheadrs
);
System
.
out
.
println
(
dataApi
);
JSONObject
liveCourseList
=
dataApi
.
getBodyInJSON
();
return
liveCourseList
;
}
public
JSONObject
createLargeClassLive
()
throws
InterruptedException
{
dataApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
.
setApiName
(
"API_createLargeClassLive"
)
...
...
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