Commit 34c81d07 by xyy

fix case

parent 6492c7d1
...@@ -55,6 +55,7 @@ public class TestBatchModifyStudioConfig extends XMBaseTest { ...@@ -55,6 +55,7 @@ public class TestBatchModifyStudioConfig extends XMBaseTest {
object.put("brandId",xmAppApi.getLoginInfo().getBrandId()); object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId()); object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
......
...@@ -30,10 +30,18 @@ public class TestCurrentUser extends XMBaseTest { ...@@ -30,10 +30,18 @@ public class TestCurrentUser extends XMBaseTest {
super.beforeTest(); super.beforeTest();
} }
/**
* 进入每个乐动模块都会获取该接口,判断该馆的权限及配置
*/
@Test(description = "获取当前使用者") @Test(description = "获取当前使用者")
public void testCurrentUser(){ public void testCurrentUser(){
xmAppApi.doRequest(RequestType.JSON,params,"{}",headers).assetsSuccess(true); JSONObject object = new JSONObject();
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
Assert.assertTrue(response.getJSONObject("result").getJSONArray("permissions").size() >= 0); Assert.assertTrue(response.getJSONObject("result").getJSONArray("permissions").size() >= 0);
......
...@@ -39,9 +39,11 @@ public class TestGetFailTenantSmsRecordDetail extends XMBaseTest { ...@@ -39,9 +39,11 @@ public class TestGetFailTenantSmsRecordDetail extends XMBaseTest {
object.put("current",0); object.put("current",0);
object.put("size",20); object.put("size",20);
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//获取异常短信为空或者有值
int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total")); int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total"));
Assert.assertTrue(total >= 0); Assert.assertTrue(total >= 0);
} }
......
...@@ -34,6 +34,7 @@ public class TestGetSmsRechargeOrderStatus extends XMBaseTest { ...@@ -34,6 +34,7 @@ public class TestGetSmsRechargeOrderStatus extends XMBaseTest {
@Test(description = "短信充值失败") @Test(description = "短信充值失败")
public void testGetSmsRechargeOrderStatus(){ public void testGetSmsRechargeOrderStatus(){
//随机生成订单id
String orderId = RandomStringUtil.randomNumber(3,""); String orderId = RandomStringUtil.randomNumber(3,"");
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
...@@ -42,6 +43,7 @@ public class TestGetSmsRechargeOrderStatus extends XMBaseTest { ...@@ -42,6 +43,7 @@ public class TestGetSmsRechargeOrderStatus extends XMBaseTest {
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
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).assetsSuccess(false);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"充值订单不存在"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"充值订单不存在");
......
...@@ -42,9 +42,11 @@ public class TestGetSmsRechargePage extends XMBaseTest { ...@@ -42,9 +42,11 @@ public class TestGetSmsRechargePage extends XMBaseTest {
object.put("size",20); object.put("size",20);
object.put("studioIds",studioIds); object.put("studioIds",studioIds);
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//验收充值记录为空或者有值
int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total")); int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total"));
Assert.assertTrue(total >= 0); Assert.assertTrue(total >= 0);
} }
......
...@@ -34,9 +34,16 @@ public class TestGetSmsType extends XMBaseTest { ...@@ -34,9 +34,16 @@ public class TestGetSmsType extends XMBaseTest {
@Test(description = "获取短信类型枚举值") @Test(description = "获取短信类型枚举值")
public void testGetSmsType(){ public void testGetSmsType(){
xmAppApi.doRequest(RequestType.JSON,params,"",headers).assetsSuccess(true); JSONObject object = new JSONObject();
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//检验短信类型有值
Assert.assertTrue(response.getJSONArray("result").size() > 0); Assert.assertTrue(response.getJSONArray("result").size() > 0);
} }
} }
......
...@@ -42,6 +42,7 @@ public class TestGetStudioMessageConfigs extends XMBaseTest { ...@@ -42,6 +42,7 @@ public class TestGetStudioMessageConfigs extends XMBaseTest {
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//检验场馆配置有值
Assert.assertTrue(response.getJSONArray("result").size() > 0); Assert.assertTrue(response.getJSONArray("result").size() > 0);
} }
} }
......
...@@ -39,9 +39,11 @@ public class TestGetStudioSmsInfo extends XMBaseTest { ...@@ -39,9 +39,11 @@ public class TestGetStudioSmsInfo extends XMBaseTest {
object.put("brandId",xmAppApi.getLoginInfo().getBrandId()); object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId()); object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//检验条数=0或者有充值条数
int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.remain")); int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.remain"));
Assert.assertTrue(total >= 0); Assert.assertTrue(total >= 0);
} }
......
...@@ -38,9 +38,11 @@ public class TestGetSuitList extends XMBaseTest { ...@@ -38,9 +38,11 @@ public class TestGetSuitList extends XMBaseTest {
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId()); object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
Assert.assertTrue(response.getJSONArray("result").size() > 0); //获取4个短信套餐
Assert.assertTrue(response.getJSONArray("result").size() == 4);
} }
} }
...@@ -34,13 +34,16 @@ public class TestGetTenantSmsRecordDetail extends XMBaseTest { ...@@ -34,13 +34,16 @@ public class TestGetTenantSmsRecordDetail extends XMBaseTest {
@Test(description = "获取某条短信记录详情") @Test(description = "获取某条短信记录详情")
public void testGetTenantSmsRecordDetail(){ public void testGetTenantSmsRecordDetail(){
//随机生成一条记录id
String recordId = RandomStringUtil.randomNumber(3,""); String recordId = RandomStringUtil.randomNumber(3,"");
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("recordId",recordId); object.put("recordId",recordId);
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(false); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(false);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
//因未充值,检验失败
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"校验失败"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"校验失败");
} }
} }
\ No newline at end of file
...@@ -43,9 +43,11 @@ public class TestGetTenantSmsRecordPage extends XMBaseTest { ...@@ -43,9 +43,11 @@ public class TestGetTenantSmsRecordPage extends XMBaseTest {
object.put("brandId",xmAppApi.getLoginInfo().getBrandId()); object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId()); object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//发送记录为空或者有值
int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total")); int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total"));
Assert.assertTrue(total >= 0); Assert.assertTrue(total >= 0);
} }
......
...@@ -39,6 +39,7 @@ public class TestSmsRecharge extends XMBaseTest { ...@@ -39,6 +39,7 @@ public class TestSmsRecharge extends XMBaseTest {
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("suitType","SUIT_ONE"); object.put("suitType","SUIT_ONE");
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
...@@ -53,6 +54,7 @@ public class TestSmsRecharge extends XMBaseTest { ...@@ -53,6 +54,7 @@ public class TestSmsRecharge extends XMBaseTest {
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("suitType","SUIT_ONE"); object.put("suitType","SUIT_ONE");
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
......
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