Commit 6492c7d1 by xyy

新增case

parent e2fa7b8a
package com.xiaomai.cases.polar.brandMerchant;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @Author: xyy
* @CreateTime: 2024-04-23 11:48
* @Description: 获取品牌商户列表
* @Version: 1.0
*/
public class TestBrandMerchantList extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_brandMerchant_list")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取品牌商户列表")
public void testBrandMerchantList(){
JSONObject object = new JSONObject();
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
Assert.assertTrue(response.getJSONArray("result").size() >= 0);
}
}
\ No newline at end of file
package com.xiaomai.cases.polar.brandMerchant;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @Author: xyy
* @CreateTime: 2024-04-23 11:48
* @Description: 获取修改记录详情
* @Version: 1.0
*/
public class TestGetApply extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_getApply")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取修改记录详情")
public void testPageApply(){
JSONObject object = new JSONObject();
object.put("id",0);
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(false);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"数据不存在");
}
}
package com.xiaomai.cases.polar.brandMerchant;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @Author: xyy
* @CreateTime: 2024-04-23 11:48
* @Description: 获取最新商户号
* @Version: 1.0
*/
public class TestGetLatestApply extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_getLatestApply")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取最新商户号")
public void testBrandMerchantList(){
JSONObject object = new JSONObject();
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
}
}
\ No newline at end of file
package com.xiaomai.cases.polar.brandMerchant;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @Author: xyy
* @CreateTime: 2024-04-23 11:48
* @Description: 获取商户号
* @Version: 1.0
*/
public class TestGetMerchant extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_getMerchant")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取商户号")
public void testBatchModifyStudioConfig(){
JSONObject object = new JSONObject();
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
}
}
\ No newline at end of file
package com.xiaomai.cases.polar.brandMerchant;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @Author: xyy
* @CreateTime: 2024-04-23 11:48
* @Description: 商户号信息的修改记录
* @Version: 1.0
*/
public class TestPageApply extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_pageApply")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "商户号信息的修改记录")
public void testPageApply(){
JSONObject object = new JSONObject();
object.put("current",0);
object.put("size",20);
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.total"));
Assert.assertTrue(total>=0);
}
}
\ No newline at end of file
...@@ -24,7 +24,7 @@ public class TestBatchModifyStudioConfig extends XMBaseTest { ...@@ -24,7 +24,7 @@ public class TestBatchModifyStudioConfig extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_batchModifyStudioConfig") .setApiName("API_batchModifyStudioConfig")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
...@@ -52,6 +52,8 @@ public class TestBatchModifyStudioConfig extends XMBaseTest { ...@@ -52,6 +52,8 @@ public class TestBatchModifyStudioConfig extends XMBaseTest {
object.put("configListRequest",configListRequest); object.put("configListRequest",configListRequest);
object.put("messageConfigTypes",messageConfigTypes); object.put("messageConfigTypes",messageConfigTypes);
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
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();
......
...@@ -23,7 +23,7 @@ public class TestCurrentUser extends XMBaseTest { ...@@ -23,7 +23,7 @@ public class TestCurrentUser extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_currentUser") .setApiName("API_currentUser")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
...@@ -36,7 +36,8 @@ public class TestCurrentUser extends XMBaseTest { ...@@ -36,7 +36,8 @@ public class TestCurrentUser extends XMBaseTest {
xmAppApi.doRequest(RequestType.JSON,params,"{}",headers).assetsSuccess(true); xmAppApi.doRequest(RequestType.JSON,params,"{}",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.getJSONObject("result").getJSONArray("permissions").size() >= 0);
Assert.assertTrue(response.getJSONObject("result").getJSONArray("configs").size() >= 0);
} }
} }
......
...@@ -24,7 +24,7 @@ public class TestGetFailTenantSmsRecordDetail extends XMBaseTest { ...@@ -24,7 +24,7 @@ public class TestGetFailTenantSmsRecordDetail extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getFailTenantSmsRecordDetail") .setApiName("API_getFailTenantSmsRecordDetail")
.setLoginUser(LoginAccount.ZYX_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
......
package com.xiaomai.cases.polar.config;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.RandomStringUtil;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.xiaomai.utils.XMBaseTest;
/**
* @Author: xyy
* @CreateTime: 2024-06-12 11:48
* @Description:短信充值失败
* @Version: 1.0
*/
public class TestGetSmsRechargeOrderStatus extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getSmsRechargeOrderStatus")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "短信充值失败")
public void testGetSmsRechargeOrderStatus(){
String orderId = RandomStringUtil.randomNumber(3,"");
JSONObject object = new JSONObject();
object.put("orderId",orderId);
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(false);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"充值订单不存在");
}
}
...@@ -25,7 +25,7 @@ public class TestGetSmsRechargePage extends XMBaseTest { ...@@ -25,7 +25,7 @@ public class TestGetSmsRechargePage extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getSmsRechargePage") .setApiName("API_getSmsRechargePage")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
......
...@@ -24,7 +24,7 @@ public class TestGetSmsType extends XMBaseTest { ...@@ -24,7 +24,7 @@ public class TestGetSmsType extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getSmsType") .setApiName("API_getSmsType")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
......
...@@ -24,7 +24,7 @@ public class TestGetStudioMessageConfigs extends XMBaseTest { ...@@ -24,7 +24,7 @@ public class TestGetStudioMessageConfigs extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getStudioMessageConfigs") .setApiName("API_getStudioMessageConfigs")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
...@@ -37,6 +37,7 @@ public class TestGetStudioMessageConfigs extends XMBaseTest { ...@@ -37,6 +37,7 @@ public class TestGetStudioMessageConfigs extends XMBaseTest {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("brandId",xmAppApi.getLoginInfo().getBrandId()); object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
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();
......
...@@ -24,7 +24,7 @@ public class TestGetStudioSmsInfo extends XMBaseTest { ...@@ -24,7 +24,7 @@ public class TestGetStudioSmsInfo extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getStudioSmsInfo") .setApiName("API_getStudioSmsInfo")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
...@@ -36,6 +36,8 @@ public class TestGetStudioSmsInfo extends XMBaseTest { ...@@ -36,6 +36,8 @@ public class TestGetStudioSmsInfo extends XMBaseTest {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
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();
......
package com.xiaomai.cases.polar.config;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.xiaomai.utils.XMBaseTest;
/**
* @Author: xyy
* @CreateTime: 2024-06-12 11:48
* @Description:获取短信充值套餐
* @Version: 1.0
*/
public class TestGetSuitList extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getSuitList")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取短信充值套餐")
public void testGetSuitList(){
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();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
Assert.assertTrue(response.getJSONArray("result").size() > 0);
}
}
...@@ -10,6 +10,7 @@ import org.testng.Assert; ...@@ -10,6 +10,7 @@ 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; import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.RandomStringUtil;
/** /**
* @Author: xyy * @Author: xyy
...@@ -23,7 +24,7 @@ public class TestGetTenantSmsRecordDetail extends XMBaseTest { ...@@ -23,7 +24,7 @@ public class TestGetTenantSmsRecordDetail extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getTenantSmsRecordDetail") .setApiName("API_getTenantSmsRecordDetail")
.setLoginUser(LoginAccount.ZYX_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
...@@ -33,12 +34,13 @@ public class TestGetTenantSmsRecordDetail extends XMBaseTest { ...@@ -33,12 +34,13 @@ public class TestGetTenantSmsRecordDetail extends XMBaseTest {
@Test(description = "获取某条短信记录详情") @Test(description = "获取某条短信记录详情")
public void testGetTenantSmsRecordDetail(){ public void testGetTenantSmsRecordDetail(){
String recordId = RandomStringUtil.randomNumber(3,"");
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("recordId",0); object.put("recordId",recordId);
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true); 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"),"校验失败");
Assert.assertTrue(response.getJSONArray("result").size() >= 0);
} }
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ public class TestGetTenantSmsRecordPage extends XMBaseTest { ...@@ -23,7 +23,7 @@ public class TestGetTenantSmsRecordPage extends XMBaseTest {
public void beforeTest(){ public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config) xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getTenantSmsRecordPage") .setApiName("API_getTenantSmsRecordPage")
.setLoginUser(LoginAccount.YFF_DEV) .setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
dal.setCase_owner("xyy") dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]); .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
...@@ -40,6 +40,8 @@ public class TestGetTenantSmsRecordPage extends XMBaseTest { ...@@ -40,6 +40,8 @@ public class TestGetTenantSmsRecordPage extends XMBaseTest {
object.put("endTime",null); object.put("endTime",null);
object.put("msgTypes",null); object.put("msgTypes",null);
object.put("studioId",xmAppApi.getLoginInfo().getStudioId()); object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
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();
......
package com.xiaomai.cases.polar.config;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.xiaomai.utils.XMBaseTest;
/**
* @Author: xyy
* @CreateTime: 2024-06-12 11:48
* @Description:调起短信充值
* @Version: 1.0
*/
public class TestSmsRecharge extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_smsRecharge")
.setLoginUser(LoginAccount.XYY_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "调起短信充值-支付宝")
public void testSmsRecharge_ali(){
JSONObject object = new JSONObject();
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
object.put("paymentType","ALI");
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("suitType","SUIT_ONE");
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
}
@Test(description = "调起短信充值-微信")
public void testSmsRecharge_wx(){
JSONObject object = new JSONObject();
object.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
object.put("paymentType","WX");
object.put("studioId",xmAppApi.getLoginInfo().getStudioId());
object.put("suitType","SUIT_ONE");
xmAppApi.doRequest(RequestType.JSON,params,object.toJSONString(),headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
}
}
...@@ -6,7 +6,8 @@ package com.xiaomai.enums; ...@@ -6,7 +6,8 @@ package com.xiaomai.enums;
*/ */
public class ApiModule { public class ApiModule {
public static String Polar_Admin ="polar_admin"; public static String Polar_Admin ="polar_admin";
public static String Polar_Config ="polar_config"; public static String Polar_Config ="polar_config";//通知管理
public static String Polar_Merchant ="polar_merchant";//乐动收银
public static String Polar_Setting ="polar_setting";//通用设置 public static String Polar_Setting ="polar_setting";//通用设置
public static String Polar_Clue ="polar_clue"; public static String Polar_Clue ="polar_clue";
public static String Polar_Member ="polar_member";//会员管理 public static String Polar_Member ="polar_member";//会员管理
......
...@@ -9,6 +9,7 @@ public class LoginAccount { ...@@ -9,6 +9,7 @@ public class LoginAccount {
public static String XYM_DEV = "xym_dev"; public static String XYM_DEV = "xym_dev";
public static String YFF_DEV = "yff_dev"; public static String YFF_DEV = "yff_dev";
public static String ZYX_DEV = "zyx_dev"; public static String ZYX_DEV = "zyx_dev";
public static String XYY_PROD = "xyy_prod";
public static String ADU_PROD = "adu_prod"; public static String ADU_PROD = "adu_prod";
public static String GYM_PROD = "GYM_PROd" + public static String GYM_PROD = "GYM_PROd" +
......
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