Commit 566234c6 by zhangying

乐器陪练课添加扣课时学员

parent efd300fb
......@@ -37,7 +37,6 @@ public class TestAddCourseStu extends XMBaseTest {
public void testAddCourseStu() {
GetOnlyOneCourseData onlyOneCourseData = new GetOnlyOneCourseData();
JSONObject onlyOneClassCourse = onlyOneCourseData.creatOnlyOneCourse();
System.out.println("onlyOneClassCourse = "+onlyOneClassCourse);
String liveCourseId = onlyOneClassCourse.getString("result");
......@@ -56,7 +55,47 @@ public class TestAddCourseStu extends XMBaseTest {
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("操作成功!", 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("操作成功!", jsonBody.getString("message"));
......
......@@ -53,7 +53,7 @@ public class GetOnlyOneCourseData extends XMBaseTest {
//组装乐器陪练直播新增的数据
public JSONObject buildCreateLargeClassLiveParam() {
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("startTime",System.currentTimeMillis() + 60 * 1000);
onlyOneClassLive.put("endTime",System.currentTimeMillis() + 60 * 60 * 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment