Commit 2d7e6f3f by xyy

短信管理case

parent 6ac63db1
package com.xiaomai.cases.polar.config;
import com.alibaba.fastjson.JSONArray;
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-13 11:48
* @Description: 批量修改场馆配置
* @Version: 1.0
*/
public class TestBatchModifyStudioConfig extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_batchModifyStudioConfig")
.setLoginUser(LoginAccount.YFF_DEV)
.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();
//构建configListRequest
JSONArray configListRequest = new JSONArray();
JSONObject smsObject = new JSONObject();
smsObject.put("msgType","SMS");
smsObject.put("configValue","TRUE");
JSONObject wechatObject = new JSONObject();
wechatObject.put("msgType","WECHAT");
wechatObject.put("configValue","TRUE");
configListRequest.add(smsObject);
configListRequest.add(wechatObject);
//构建messageConfigTypes
JSONArray messageConfigTypes = new JSONArray();
messageConfigTypes.add("ALL");
object.put("configListRequest",configListRequest);
object.put("messageConfigTypes",messageConfigTypes);
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"),"操作成功!");
}
}
package com.xiaomai.cases.polar.config;
public class TestCurrentUser {
}
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-04-13 11:48
* @Description:获取异常短信详情
* @Version: 1.0
*/
public class TestGetFailTenantSmsRecordDetail extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getFailTenantSmsRecordDetail")
.setLoginUser(LoginAccount.ZYX_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取异常短信详情")
public void testGetFailTenantSmsRecordDetail(){
JSONObject object = new JSONObject();
object.put("recordId",0);
object.put("current",0);
object.put("size",20);
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);
}
}
package com.xiaomai.cases.polar.config;
import com.alibaba.fastjson.JSONArray;
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-04-13 11:48
* @Description:获取充值记录
* @Version: 1.0
*/
public class TestGetSmsRechargePage extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getSmsRechargePage")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取充值记录")
public void testGetSmsRechargePage(){
JSONObject object = new JSONObject();
JSONArray studioIds = new JSONArray();
studioIds.add(xmAppApi.getLoginInfo().getStudioId());
object.put("current",0);
object.put("size",20);
object.put("studioIds",studioIds);
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);
}
}
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-04-13 11:48
* @Description:获取短信类型枚举值
* @Version: 1.0
*/
public class TestGetSmsType extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getSmsType")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取短信类型枚举值")
public void testGetSmsType(){
xmAppApi.doRequest(RequestType.JSON,params,"",headers).assetsSuccess(true);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
Assert.assertTrue(response.getJSONArray("result").size() > 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.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.xiaomai.utils.XMBaseTest;
/**
* @Author: xyy
* @CreateTime: 2024-04-13 11:48
* @Description: 获取场馆消息配置
* @Version: 1.0
*/
public class TestGetStudioMessageConfigs extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getStudioMessageConfigs")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取场馆消息配置")
public void testGetStudioMessageConfigs(){
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);
}
}
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-04-13 11:48
* @Description:获取场馆短信条数
* @Version: 1.0
*/
public class TestGetStudioSmsInfo extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getStudioSmsInfo")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取场馆短信条数")
public void testGetStudioSmsInfo(){
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"),"操作成功!");
int total = Integer.parseInt(XMJSONPath.readPath(response,"$.result.remain"));
Assert.assertTrue(total >= 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.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.xiaomai.utils.XMBaseTest;
/**
* @Author: xyy
* @CreateTime: 2024-04-13 11:48
* @Description:获取某条短信记录详情
* @Version: 1.0
*/
public class TestGetTenantSmsRecordDetail extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getTenantSmsRecordDetail")
.setLoginUser(LoginAccount.ZYX_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取某条短信记录详情")
public void testGetTenantSmsRecordDetail(){
JSONObject object = new JSONObject();
object.put("recordId",0);
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.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-04-13 11:48
* @Description:获取短信发送记录
* @Version: 1.0
*/
public class TestGetTenantSmsRecordPage extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Config)
.setApiName("API_getTenantSmsRecordPage")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("xyy")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取短信发送记录")
public void testGetTenantSmsRecordPage(){
JSONObject object = new JSONObject();
object.put("current",0);
object.put("size",20);
object.put("msgTypes",null);
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);
}
}
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