Commit 930c0c82 by DuJunLi
parents d9dea080 c50bd316
......@@ -313,7 +313,7 @@ public class TestAddMemberReserve extends BaseTestImpl {
}
Assert.assertTrue(success,mes+"预约记录没有查询到相关信息");
// check 3:查询小程序预约详情
JSONObject getDetailById = reserveCTools.getDetailById(memberInfo.getString(2));
JSONObject getDetailById = reserveCTools.getReserveDetailById(memberInfo.getString(2));
for(int j = 0;j<result.length;j++){
String resultString = result[j].equals("reserveId")?"id":result[j];
Assert.assertEquals(getDetailById.getString(resultString),resultData[j],mes+"产生的数据与实际数据不符合"+result[j]+":"+resultData[j]);
......
......@@ -412,7 +412,7 @@ public class TestAddToQueue extends BaseTestImpl {
}
Assert.assertTrue(success,mes+"预约记录没有查询到相关信息");
// check 3:查询小程序预约详情
JSONObject getDetailById = reserveCTools.getDetailById(memberInfo.getString(2));
JSONObject getDetailById = reserveCTools.getReserveDetailById(memberInfo.getString(2));
for(int j = 0;j<result.length;j++){
String resultString = result[j].equals("reserveId")?"id":result[j];
Assert.assertEquals(getDetailById.getString(resultString),resultData[j],mes+"产生的数据与实际数据不符合"+result[j]+":"+resultData[j]);
......
......@@ -83,7 +83,7 @@ public class TestCreateSingleReserve extends BaseTestImpl {
}
@Test(description = "小程序单次团课预约")
public void testAddMemberReserve() {
public void testCreateSingleReserve() {
DataUserInfo dataUserInfo = new DataUserInfo();
dataUserInfo.setTerminal(Terminal.B);
dataUserInfo.setLoginUser(LoginAccount.GYM_PROD);
......@@ -285,8 +285,9 @@ public class TestCreateSingleReserve extends BaseTestImpl {
// 查询存量的约课课程
// 查询存量的课程分类
String categoryId = courseCategoryTools.getCourseCategoryPage("瑜伽");
courseId = courseTools.getPersonalOrGroupCourseId("GROUP", "单次付费团课", categoryId, "STUDIO", "", 2, 1,dataUserInfo).getString(0);
courseId = courseTools.getPersonalOrGroupCourseId("GROUP", "单次付费约课团课", categoryId, "STUDIO", "", 2, 1,dataUserInfo).getString(0);
// 修改课程支持单次约课
courseTools.editGroupCourse(categoryId,courseId,"单次付费约课团课",10,true,0,dataUserInfo);
// 创建排课
int[] minuteOffset = {60, 120, 180, 240, 300, 360, 420, 480, 540, 600, 660, 720, 780, 840, 900, 960, 1020, 1080, 1140, 1200, 1260};
Random random = new Random();
......@@ -316,8 +317,7 @@ public class TestCreateSingleReserve extends BaseTestImpl {
}
}
// 修改课程支持单次约课
courseTools.editGroupCourse(categoryId,courseId,"单次付费团课",10,true,0,dataUserInfo);
}
......
......@@ -80,7 +80,7 @@ public class TestSingleReserveSignIn extends BaseTestImpl {
}
@Test(description = "小程序单次团课预约")
public void testAddMemberReserve() {
public void testCreateSingleReserve() {
DataUserInfo dataUserInfo = new DataUserInfo();
dataUserInfo.setTerminal(Terminal.B);
dataUserInfo.setLoginUser(LoginAccount.GYM_PROD);
......@@ -234,7 +234,7 @@ public class TestSingleReserveSignIn extends BaseTestImpl {
JSONArray getGroupRuleScheduleList = groupScheduleTools.getGroupRuleScheduleList(courseId, dataApi.getLoginInfo().getAdminId(),dataUserInfo);
//统计查询到的目标日程数量
ruldId = XMJSONPath.readPath(getGroupRuleScheduleList.getJSONObject(0), "$.ruleId");
Long scheduleEndTime = TimeUtils.getTodayEndTime(1);
Long scheduleEndTime = TimeUtils.getTodayEndTime(0);
try {
Thread.sleep(2500);
} catch (InterruptedException e) {
......@@ -242,6 +242,7 @@ public class TestSingleReserveSignIn extends BaseTestImpl {
}
// 查询课次id
JSONArray memberTimetable = reserveCTools.memberTimetable(memberId,Long.valueOf(todayStartTimeTamp), scheduleEndTime);
for (int i = 0; i < memberTimetable.size(); i++){
if (memberTimetable.getJSONObject(i).containsKey("ruleId") && memberTimetable.getJSONObject(i).getString("ruleId").equals(ruldId)){
scheduleId = memberTimetable.getJSONObject(i).getString("scheduleId");
......
......@@ -332,7 +332,7 @@ public class TestXCXSignIn extends BaseTestImpl {
}
Assert.assertTrue(success,mes+"预约记录没有查询到相关信息");
// check 3:查询小程序预约详情
JSONObject getDetailById = reserveCTools.getDetailById(memberInfo.getString(2));
JSONObject getDetailById = reserveCTools.getReserveDetailById(memberInfo.getString(2));
for(int j = 0;j<result.length;j++){
String resultString = result[j].equals("reserveId")?"id":result[j];
Assert.assertEquals(getDetailById.getString(resultString),resultData[j],mes+"产生的数据与实际数据不符合"+result[j]+":"+resultData[j]);
......
......@@ -9,7 +9,7 @@ import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.annotation.Resource;
......@@ -30,7 +30,7 @@ public class TestCreateBatchNormalDate extends BaseTestImpl {
JSONArray coachIds = new JSONArray();
@BeforeClass
@BeforeMethod
@Override
public void beforeTest(){
setTestInfo(ApiModule.Polar_Reserve,"API_createBatchNormalDate", LoginAccount.GYM_PROD, Terminal.B,"xym");
......
......@@ -10,7 +10,6 @@ import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.TimeUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
......@@ -103,7 +102,25 @@ public class TestCreateBatchSpecialDate extends BaseTestImpl {
}
@Test(description = "设置特定日期全天休息",priority = 1)
@Test(description = "删除特殊日期",priority = 1)
public void testDeleteSpecialDate1() {
for (int j = 0; j < coachIds.size(); j++){
// 查询特殊可约时间列表
JSONArray specialTimeVOS = reserveTools.getPersonalCoachTime(coachIds.getString(j),"specialTimeVOS");
for (int i = 0; i < specialTimeVOS.size(); i++){
String id = specialTimeVOS.getJSONObject(i).getJSONArray("recordIds").getString(0);
// 删除查询到的特殊可约时间
reserveTools.deleteSpecialDate(id);
}
specialTimeVOS = reserveTools.getPersonalCoachTime(xmAppApi.getLoginInfo().getAdminId(),"specialTimeVOS");
Assert.assertEquals(specialTimeVOS.size(),0,"删除特殊日期后,特殊日期列表不为空");
}
}
@Test(description = "设置特定日期全天休息",priority = 2)
public void testCreateBatchSpecialDate2() {
// 获取教练列表
JSONObject pageStudioPersonalCoach = reserveTools.pageStudioPersonalCoach("");
......@@ -162,7 +179,7 @@ public class TestCreateBatchSpecialDate extends BaseTestImpl {
}
@Test(description = "删除特殊日期",priority = 2)
@Test(description = "删除特殊日期",priority = 3)
public void testDeleteSpecialDate() {
for (int j = 0; j < coachIds.size(); j++){
// 查询特殊可约时间列表
......
......@@ -44,9 +44,19 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
JSONObject pageStudioPersonalCoach = reserveTools.pageStudioPersonalCoach("");
int total = pageStudioPersonalCoach.getInteger("total");
Random rand = new Random();
// 随机取个教练
// 随机取1个教练
coachedId = pageStudioPersonalCoach.getJSONArray("records").getJSONObject(rand.nextInt(total>10?10:total)).getString("id");
// 获取教练后先清除特殊日期数据。避免重叠
// 查询特殊可约时间列表
JSONArray specialTimeVOS = reserveTools.getCoachHistorySpecialDate(coachedId);
for (int i = 0; i < specialTimeVOS.size(); i++){
String id = specialTimeVOS.getJSONObject(i).getJSONArray("recordIds").getString(0);
// 删除查询到的特殊可约时间
reserveTools.deleteSpecialDate(id);
}
Long date = TimeUtils.getBeforeDayDate(1);
JSONObject body = new JSONObject();
body.put("brandId", xmAppApi.getLoginInfo().getBrandId());
......@@ -65,7 +75,7 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
reserveTools.createSpecialDate(coachedId,"OFF_DUTY",specialTimeInfoRequest);
// 设置全天休息完成后检查个人时间是否有这条数据
JSONArray specialTimeVOS = reserveTools.getCoachHistorySpecialDate(coachedId);
specialTimeVOS = reserveTools.getCoachHistorySpecialDate(coachedId);
boolean flag = false;
for (int i = 0; i < specialTimeVOS.size(); i++){
JSONObject specialTimeVO = specialTimeVOS.getJSONObject(i);
......@@ -77,8 +87,23 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
Assert.assertTrue(flag,"设置特殊日期全天休息后在历史特定日期可约时间列表没有找到相关数据");
}
@Test(description = "删除特殊日期",priority = 1)
public void testDeleteSpecialDate() {
// 查询特殊可约时间列表
JSONArray specialTimeVOS = reserveTools.getCoachHistorySpecialDate(coachedId);
for (int i = 0; i < specialTimeVOS.size(); i++){
String id = specialTimeVOS.getJSONObject(i).getJSONArray("recordIds").getString(0);
// 删除查询到的特殊可约时间
reserveTools.deleteSpecialDate(id);
}
@Test(description = "设置特定日期可约",priority = 1)
specialTimeVOS = reserveTools.getCoachHistorySpecialDate(coachedId);
Assert.assertEquals(specialTimeVOS.size(),0,"删除特殊日期后,特殊日期列表不为空");
}
@Test(description = "设置特定日期可约",priority = 2)
public void testCreateSpecialDate_ON() {
Long date = TimeUtils.getBeforeDayDate(2);
......@@ -123,8 +148,8 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
Assert.assertTrue(flag,"设置特殊日期在历史特定日期可约时间列表没有找到相关数据");
}
@Test(description = "删除特殊日期",priority = 2)
public void testDeleteSpecialDate() {
@Test(description = "删除特殊日期",priority = 3)
public void testDeleteSpecialDate2() {
// 查询特殊可约时间列表
JSONArray specialTimeVOS = reserveTools.getCoachHistorySpecialDate(coachedId);
......
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