Commit b7a6cf20 by yangfangfang

Merge remote-tracking branch 'origin/master'

parents f4df222d ebed1a63
...@@ -80,7 +80,7 @@ public class TestPurchaseByDeposit extends BaseTestImpl { ...@@ -80,7 +80,7 @@ public class TestPurchaseByDeposit extends BaseTestImpl {
info.setLoginUser(LoginAccount.GYM_PROD); info.setLoginUser(LoginAccount.GYM_PROD);
//查询启用中的储值卡,获取储值卡id //查询启用中的储值卡,获取储值卡id
String cardId = XMJSONPath.readPath(cardTools.fetchPageOfMemberCard("DEPOSIT_CARD",info), "$.result.records[0].id"); String cardId = XMJSONPath.readPath(cardTools.fetchPageOfMemberCardByTitle("DEPOSIT_CARD","0元储值卡",info), "$.result.records[0].id");
String latestSnapshotId = XMJSONPath.readPath(cardTools.fetchDetailById(cardId,info), "$.result.latestSnapshotId"); String latestSnapshotId = XMJSONPath.readPath(cardTools.fetchDetailById(cardId,info), "$.result.latestSnapshotId");
//购买1张储值卡 //购买1张储值卡
cardTools.signOrderDeposit(cardId,latestSnapshotId,memberId,"0.00","1000.00",info); cardTools.signOrderDeposit(cardId,latestSnapshotId,memberId,"0.00","1000.00",info);
......
...@@ -231,7 +231,7 @@ public class TestAddToQueue extends BaseTestImpl { ...@@ -231,7 +231,7 @@ public class TestAddToQueue extends BaseTestImpl {
groupScheduleTools.editGroupSchedule(scheduleId,startTime,chiefCoachId,1,2,dataUserInfo); groupScheduleTools.editGroupSchedule(scheduleId,startTime,chiefCoachId,1,2,dataUserInfo);
try { try {
Thread.sleep(5000); Thread.sleep(10000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
......
...@@ -77,7 +77,7 @@ public class TestSingleReserveByDeposit extends BaseTestImpl { ...@@ -77,7 +77,7 @@ public class TestSingleReserveByDeposit extends BaseTestImpl {
info.setLoginUser(LoginAccount.GYM_PROD); info.setLoginUser(LoginAccount.GYM_PROD);
//查询启用中的储值卡,获取储值卡id //查询启用中的储值卡,获取储值卡id
String cardId = XMJSONPath.readPath(cardTools.fetchPageOfMemberCard("DEPOSIT_CARD",info), "$.result.records[0].id"); String cardId = XMJSONPath.readPath(cardTools.fetchPageOfMemberCardByTitle("DEPOSIT_CARD","0元储值卡",info), "$.result.records[0].id");
String latestSnapshotId = XMJSONPath.readPath(cardTools.fetchDetailById(cardId,info), "$.result.latestSnapshotId"); String latestSnapshotId = XMJSONPath.readPath(cardTools.fetchDetailById(cardId,info), "$.result.latestSnapshotId");
//购买1张储值卡 //购买1张储值卡
cardTools.signOrderDeposit(cardId,latestSnapshotId,memberId,"0.00","1000.00",info); cardTools.signOrderDeposit(cardId,latestSnapshotId,memberId,"0.00","1000.00",info);
......
...@@ -37,7 +37,7 @@ public class TestReinStateStudioAdmin extends BaseTestImpl { ...@@ -37,7 +37,7 @@ public class TestReinStateStudioAdmin extends BaseTestImpl {
@Test @Test
public void testReinStateStudioAdmin() { public void testReinStateStudioAdmin() {
// 获取离职员工 // 获取离职员工
String body = "{\"size\":10,\"current\":0,\"state\":\"LEFT\"}"; String body = "{\"size\":20,\"current\":0,\"state\":\"LEFT\"}";
JSONObject adminPage = adminTools.pageStudioAdmin(body); JSONObject adminPage = adminTools.pageStudioAdmin(body);
int total = Integer.parseInt(adminPage.getJSONObject("result").getString("total")); int total = Integer.parseInt(adminPage.getJSONObject("result").getString("total"));
if (total>1){ if (total>1){
...@@ -57,23 +57,23 @@ public class TestReinStateStudioAdmin extends BaseTestImpl { ...@@ -57,23 +57,23 @@ public class TestReinStateStudioAdmin extends BaseTestImpl {
body = "{\"id\":\""+adminId+"\"}"; body = "{\"id\":\""+adminId+"\"}";
xmAppApi.doRequest(RequestType.JSON,params,body,headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,body,headers).assetsSuccess(true);
try { try {
Thread.sleep(1000); Thread.sleep(2000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
// check 1:用手机号查询离职员工是否有这个员工 // check 1:用手机号查询离职员工是否有这个员工
body = "{\"size\":10,\"current\":0,\"state\":\"DUTY\",\"searchContext\":\""+phone+"\"}"; body = "{\"size\":20,\"current\":0,\"state\":\"DUTY\",\"searchContext\":\""+phone+"\"}";
adminPage = adminTools.pageStudioAdmin(body); adminPage = adminTools.pageStudioAdmin(body);
total = Integer.parseInt(adminPage.getJSONObject("result").getString("total")); total = Integer.parseInt(adminPage.getJSONObject("result").getString("total"));
Assert.assertEquals(total,1,"员工离职失败,用手机号查询离职员工未返回数据"); Assert.assertEquals(total,1,"员工离职失败,用手机号查询离职员工未返回数据");
try { try {
Thread.sleep(12000); Thread.sleep(15000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
// check 2: 生成对应的操作日志 // check 2: 生成对应的操作日志
body = "{\"current\":0,\"size\":10,\"domainId\":\""+xmAppApi.getLoginInfo().getStudioId()+"\",\"content\": \""+name+"\",\"brandId\":\""+xmAppApi.getLoginInfo().getBrandId()+"\",\"studioId\": \""+xmAppApi.getLoginInfo().getStudioId()+"\",\"opEventKey\":\"RESTORE_ADMIN\"}"; body = "{\"current\":0,\"size\":20,\"domainId\":\""+xmAppApi.getLoginInfo().getStudioId()+"\",\"content\": \""+name+"\",\"brandId\":\""+xmAppApi.getLoginInfo().getBrandId()+"\",\"studioId\": \""+xmAppApi.getLoginInfo().getStudioId()+"\",\"opEventKey\":\"RESTORE_ADMIN\"}";
JSONObject response = configTools.getOpauditPage(body); JSONObject response = configTools.getOpauditPage(body);
Assert.assertEquals(response.getJSONObject("result").getJSONArray("records").getJSONObject(0).getJSONObject("target").getString("targetId"),adminId,"员工离职未生成操作日志"); Assert.assertEquals(response.getJSONObject("result").getJSONArray("records").getJSONObject(0).getJSONObject("target").getString("targetId"),adminId,"员工离职未生成操作日志");
......
...@@ -6,11 +6,11 @@ import com.xiaomai.enums.LoginAccount; ...@@ -6,11 +6,11 @@ import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType; import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal; import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.RandomStringUtil; import com.xiaomai.utils.RandomStringUtil;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath; import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.xiaomai.utils.XMBaseTest;
/** /**
* @Author: xyy * @Author: xyy
...@@ -44,9 +44,13 @@ public class TestGetSmsRechargeOrderStatus extends XMBaseTest { ...@@ -44,9 +44,13 @@ public class TestGetSmsRechargeOrderStatus extends XMBaseTest {
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId()); object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
//调用请求 //调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(false); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers);
JSONObject response = xmAppApi.getBodyInJSON(); boolean flag = Boolean.parseBoolean(XMJSONPath.readPath(xmAppApi.getBodyInJSON(),"$.success"));
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"充值订单不存在"); if(flag==false){
Assert.assertEquals(XMJSONPath.readPath(xmAppApi.getBodyInJSON(),"$.message"),"充值订单不存在");
}else {
Assert.assertEquals(XMJSONPath.readPath(xmAppApi.getBodyInJSON(),"$.result.status"),"0");
}
} }
} }
......
...@@ -303,7 +303,7 @@ public class LuckyDrawTools extends BaseTestImpl { ...@@ -303,7 +303,7 @@ public class LuckyDrawTools extends BaseTestImpl {
body.put("noWinName", "谢谢惠顾"); body.put("noWinName", "谢谢惠顾");
body.put("publish",publish);//是否发布 body.put("publish",publish);//是否发布
body.put("actDescribe","自动化脚本edit幸运抽奖"); body.put("actDescribe","自动化脚本edit幸运抽奖");
body.put("startTime",System.currentTimeMillis());//活动开始时间:当前时间 body.put("startTime",TimeUtils.getTodayTime());//活动开始时间:获取当天0点
body.put("prizeList",prizeList); body.put("prizeList",prizeList);
body.put("id",activityId); body.put("id",activityId);
body.put("brandId", dataApi.getLoginInfo().getBrandId()); body.put("brandId", dataApi.getLoginInfo().getBrandId());
......
...@@ -218,6 +218,7 @@ public class CardTools extends XMBaseTest { ...@@ -218,6 +218,7 @@ public class CardTools extends XMBaseTest {
jsonObject.put("objectId", UUID.randomUUID().toString()); jsonObject.put("objectId", UUID.randomUUID().toString());
jsonObject.put("studioId", dataApi.getLoginInfo().getStudioId()); jsonObject.put("studioId", dataApi.getLoginInfo().getStudioId());
jsonObject.put("memberId", memberId); jsonObject.put("memberId", memberId);
jsonObject.put("directReceive", null);
jsonObject.put("receivableAmount",rechargeAmount);//应收金额 jsonObject.put("receivableAmount",rechargeAmount);//应收金额
jsonObject.put("operatorId", dataApi.getLoginInfo().getAdminId()); jsonObject.put("operatorId", dataApi.getLoginInfo().getAdminId());
jsonObject.put("brandId",dataApi.getLoginInfo().getBrandId()); jsonObject.put("brandId",dataApi.getLoginInfo().getBrandId());
...@@ -307,6 +308,27 @@ public class CardTools extends XMBaseTest { ...@@ -307,6 +308,27 @@ public class CardTools extends XMBaseTest {
dataApi.doRequest(RequestType.JSON, dataparams, jsonObject.toJSONString(), dataheadrs).assetsSuccess(true); dataApi.doRequest(RequestType.JSON, dataparams, jsonObject.toJSONString(), dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON(); return dataApi.getBodyInJSON();
} }
public JSONObject fetchPageOfMemberCardByTitle(String commodityCardType,String title,DataUserInfo... dataUserInfos) {
dataApi.setApiModule(ApiModule.Polar_Card)
.setApiName("API_fetchPageOfMemberCard")
.setTerminal(Terminal.B);
super.beforeDataRequest(dataUserInfos);
JSONObject jsonObject = new JSONObject();
jsonObject.put("title",title);//储值卡名称
jsonObject.put("shelfState","YES");//启用状态
// jsonObject.put("xcxSaleStatus","YES");//售卖状态
jsonObject.put("current", 0);
jsonObject.put("size", 20);
jsonObject.put("commodityCardType",commodityCardType);
jsonObject.put("studioId", dataApi.getLoginInfo().getStudioId());
jsonObject.put("brandId", dataApi.getLoginInfo().getBrandId());
jsonObject.put("operatorId", dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, jsonObject.toJSONString(), dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON();
}
/** /**
* @description:获取会员卡列表 * @description:获取会员卡列表
......
...@@ -92,7 +92,7 @@ public class TestPurchaseAreaTimes extends XMBaseTest { ...@@ -92,7 +92,7 @@ public class TestPurchaseAreaTimes extends XMBaseTest {
break; break;
} else { } else {
//查询启用中的储值卡,获取储值卡id //查询启用中的储值卡,获取储值卡id
String cardId = XMJSONPath.readPath(cardTools.fetchPageOfMemberCard("DEPOSIT_CARD", info), "$.result.records[0].id"); String cardId = XMJSONPath.readPath(cardTools.fetchPageOfMemberCardByTitle("DEPOSIT_CARD","0元储值卡", info), "$.result.records[0].id");
String latestSnapshotId = XMJSONPath.readPath(cardTools.fetchDetailById(cardId, info), "$.result.latestSnapshotId"); String latestSnapshotId = XMJSONPath.readPath(cardTools.fetchDetailById(cardId, info), "$.result.latestSnapshotId");
//b端购买1张储值卡 //b端购买1张储值卡
cardTools.signOrderDeposit(cardId, latestSnapshotId, memberId, "0.00", "1000.00", info); cardTools.signOrderDeposit(cardId, latestSnapshotId, memberId, "0.00", "1000.00", info);
......
...@@ -41,10 +41,10 @@ public class TestDoForceOpenTraining extends BaseCreateTrainingData { ...@@ -41,10 +41,10 @@ public class TestDoForceOpenTraining extends BaseCreateTrainingData {
public void testForceOpenTraining() throws InterruptedException { public void testForceOpenTraining() throws InterruptedException {
//1.创建训练营活动:保存并发布 //1.创建训练营活动:保存并发布
id = trainingTools.createThenPublishTraining(CommUtil.getTodayGoalTime(21), applyEndTime, courseId, openStartDate, id = trainingTools.createThenPublishTraining(CommUtil.getTodayGoalTime(30), applyEndTime, courseId, openStartDate,
openEndDate, 0.01, trainingTitle, 2, 1, trainerListIdS, "YES"); openEndDate, 0.01, trainingTitle, 2, 1, trainerListIdS, "YES");
if (id.isEmpty()) { if (id.isEmpty()) {
id = trainingTools.createThenPublishTraining(CommUtil.getTodayGoalTime(20), applyEndTime, courseId, openStartDate, id = trainingTools.createThenPublishTraining(CommUtil.getTodayGoalTime(30), applyEndTime, courseId, openStartDate,
openEndDate, 0.01, trainingTitle + RandomStringUtil.randomString(3), 2, 1, trainerListIdS, "YES"); openEndDate, 0.01, trainingTitle + RandomStringUtil.randomString(3), 2, 1, trainerListIdS, "YES");
} }
//2.查看活动详情,check 活动状态 //2.查看活动详情,check 活动状态
......
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