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
566234c6
Commit
566234c6
authored
Feb 07, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
乐器陪练课添加扣课时学员
parent
efd300fb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
src/main/java/com/live/cases/musicPlay/TestAddCourseStu.java
+41
-2
src/main/java/com/live/xmutils/GetOnlyOneCourseData.java
+1
-1
No files found.
src/main/java/com/live/cases/musicPlay/TestAddCourseStu.java
View file @
566234c6
...
@@ -37,7 +37,6 @@ public class TestAddCourseStu extends XMBaseTest {
...
@@ -37,7 +37,6 @@ public class TestAddCourseStu extends XMBaseTest {
public
void
testAddCourseStu
()
{
public
void
testAddCourseStu
()
{
GetOnlyOneCourseData
onlyOneCourseData
=
new
GetOnlyOneCourseData
();
GetOnlyOneCourseData
onlyOneCourseData
=
new
GetOnlyOneCourseData
();
JSONObject
onlyOneClassCourse
=
onlyOneCourseData
.
creatOnlyOneCourse
();
JSONObject
onlyOneClassCourse
=
onlyOneCourseData
.
creatOnlyOneCourse
();
System
.
out
.
println
(
"onlyOneClassCourse = "
+
onlyOneClassCourse
);
String
liveCourseId
=
onlyOneClassCourse
.
getString
(
"result"
);
String
liveCourseId
=
onlyOneClassCourse
.
getString
(
"result"
);
...
@@ -56,7 +55,47 @@ public class TestAddCourseStu extends XMBaseTest {
...
@@ -56,7 +55,47 @@ public class TestAddCourseStu extends XMBaseTest {
JSONObject
onlyOneCourseList
=
onlyOneCourseData
.
getOnlyOneCourseList
();
JSONObject
onlyOneCourseList
=
onlyOneCourseData
.
getOnlyOneCourseList
();
String
studentId1
=
onlyOneCourseList
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getJSONArray
(
"liveStudentBaseVO"
).
getJSONObject
(
0
).
getString
(
"studentId"
);
String
studentId1
=
onlyOneCourseList
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getJSONArray
(
"liveStudentBaseVO"
).
getJSONObject
(
0
).
getString
(
"studentId"
);
System
.
out
.
println
(
"onlyOneCourseList = "
+
onlyOneCourseList
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
Assert
.
assertEquals
(
studentId
,
studentId1
);
}
/**
* 测试乐器陪练课-添加学员"扣课时学员(自动化测试)"
*/
@Test
public
void
testAddCourseStu1
()
{
GetOnlyOneCourseData
onlyOneCourseData
=
new
GetOnlyOneCourseData
();
JSONObject
onlyOneClassCourse
=
onlyOneCourseData
.
creatOnlyOneCourse
();
String
liveCourseId
=
onlyOneClassCourse
.
getString
(
"result"
);
String
studentId
=
"1358346398485405697"
;
JSONObject
jsondata
=
new
JSONObject
();
jsondata
.
put
(
"name"
,
"扣课时学员(自动化测试)"
);
jsondata
.
put
(
"phone"
,
"12300000003"
);
jsondata
.
put
(
"studentId"
,
studentId
);
jsondata
.
put
(
"classHourId"
,
"1235120275888328705"
);
jsondata
.
put
(
"consumeHourNum"
,
"100"
);
List
studentIds
=
new
ArrayList
();
studentIds
.
add
(
jsondata
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"liveCourseId"
,
liveCourseId
);
jsonObject
.
put
(
"consumeStudentIds"
,
studentIds
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
JSONObject
onlyOneCourseList
=
onlyOneCourseData
.
getOnlyOneCourseList
();
String
studentId1
=
onlyOneCourseList
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getJSONArray
(
"liveStudentBaseVO"
).
getJSONObject
(
0
).
getString
(
"studentId"
);
// System.out.println("onlyOneCourseList = "+onlyOneCourseList);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
...
...
src/main/java/com/live/xmutils/GetOnlyOneCourseData.java
View file @
566234c6
...
@@ -53,7 +53,7 @@ public class GetOnlyOneCourseData extends XMBaseTest {
...
@@ -53,7 +53,7 @@ public class GetOnlyOneCourseData extends XMBaseTest {
//组装乐器陪练直播新增的数据
//组装乐器陪练直播新增的数据
public
JSONObject
buildCreateLargeClassLiveParam
()
{
public
JSONObject
buildCreateLargeClassLiveParam
()
{
JSONObject
onlyOneClassLive
=
new
JSONObject
();
JSONObject
onlyOneClassLive
=
new
JSONObject
();
onlyOneClassLive
.
put
(
"courseName"
,
RandomStringUtil
.
randomNumber
(
14
,
"
onlyOne_
course_"
));
onlyOneClassLive
.
put
(
"courseName"
,
RandomStringUtil
.
randomNumber
(
14
,
"course_"
));
onlyOneClassLive
.
put
(
"teacherId"
,
xmAppApi
.
getLoginInfo
().
getTid
());
onlyOneClassLive
.
put
(
"teacherId"
,
xmAppApi
.
getLoginInfo
().
getTid
());
onlyOneClassLive
.
put
(
"startTime"
,
System
.
currentTimeMillis
()
+
60
*
1000
);
onlyOneClassLive
.
put
(
"startTime"
,
System
.
currentTimeMillis
()
+
60
*
1000
);
onlyOneClassLive
.
put
(
"endTime"
,
System
.
currentTimeMillis
()
+
60
*
60
*
1000
);
onlyOneClassLive
.
put
(
"endTime"
,
System
.
currentTimeMillis
()
+
60
*
60
*
1000
);
...
...
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