Commit 81748936 by xuyamei

电子合同新增4个APi

parent 9cc8f5b2
......@@ -227,6 +227,53 @@ public class EleContractTools extends XMBaseTest {
dataApi.doRequest(RequestType.JSON,dataparams,body.toString(),dataheadrs).assetsSuccess(true);
}
public void setBalanceWarning(int balanceWarning,String id){
setUp("API_setBalanceWarning");
JSONObject body = new JSONObject();
body.put("warnAmount",balanceWarning);
body.put("brandId",xmAppApi.getLoginInfo().getBrandId());
body.put("studioId",xmAppApi.getLoginInfo().getStudioId());
body.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
body.put("notifyPhone","13120057004");
body.put("id",id);
dataApi.doRequest(RequestType.JSON,dataparams,body.toString(),dataheadrs).assetsSuccess(true);
}
/**
* @description 复制签署地址
* @author: xuyamei
* @date: 2024/8/6 16:58
* @param id:合同id
* @return: java.lang.String
**/
public String getContractSignUrl(String id){
setUp("API_getContractSignUrl");
JSONObject body = new JSONObject();
body.put("brandId",xmAppApi.getLoginInfo().getBrandId());
body.put("studioId",xmAppApi.getLoginInfo().getStudioId());
body.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
body.put("id",id);
dataApi.doRequest(RequestType.JSON,dataparams,body.toString(),dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON().getString("result");
}
/**
* @description: 重新认证前置校验-存在待家长签署,签署中的合同都不允许重新认证
* @author: xuyamei
* @date: 2024/8/6 17:08
* @return: boolean
**/
public boolean checkBeforeResetVerify(){
setUp("API_checkBeforeResetVerify");
String body = "{\"tenantId\":\""+dataApi.getLoginInfo().getStudioId()+"\"}";
dataApi.doRequest(RequestType.JSON,dataparams,body.toString(),dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON().getBoolean("result");
}
......
package com.xiaomai.cases.polar.eleContract;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.basetest.BaseTestImpl;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.annotation.Resource;
/**
* @BelongsProject: xm-sportstest
* @BelongsPackage: com.xiaomai.cases.polar.eleContract
* @Author: xuyamei
* @CreateTime: 2024-08-06 16:33
* @Description: 剩余份数小于设置的预警值合同管理提示条
* @Version: 1.0
*/
public class TestGetShowResidueCount extends BaseTestImpl {
@Resource(name = "eleContractTools")
EleContractTools eleContractTools;
@BeforeMethod
@Override
public void beforeTest(){
setTestInfo(ApiModule.Polar_EleContract,"API_getShowResidueCount", LoginAccount.DZHT_PROD, Terminal.B,"xym");
super.beforeTest();
}
@Test
public void testGetShowResidueCount(){
int warning = 1000;
// 查询预警记录id
JSONObject balanceWarning = eleContractTools.getBalanceWarning();
String id = balanceWarning.getString("id");
// 先设置预警值
eleContractTools.setBalanceWarning(warning, id);
// 查询剩余份数小于设置的预警值合同管理提示条
JSONObject body = new JSONObject();
body.put("tenantId",xmAppApi.getLoginInfo().getStudioId());
body.put("studioId",xmAppApi.getLoginInfo().getStudioId());
body.put("brandId",xmAppApi.getLoginInfo().getBrandId());
body.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,body.toString(),headers).assetsSuccess(true);
Assert.assertTrue(xmAppApi.getBodyInJSON().getInteger("result") == warning);
}
}
package com.xiaomai.cases.polar.eleContract;
import com.xiaomai.basetest.BaseTestImpl;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @BelongsProject: xm-sportstest
* @BelongsPackage: com.xiaomai.cases.polar.eleContract
* @Author: xuyamei
* @CreateTime: 2024-08-06 16:46
* @Description: 获取租户是否购买结果
* @Version: 1.0
*/
public class TestGetTenantPurchaseFlag extends BaseTestImpl {
@BeforeMethod
@Override
public void beforeTest(){
setTestInfo(ApiModule.Polar_EleContract,"API_getTenantPurchaseFlag", LoginAccount.DZHT_PROD, Terminal.B,"xym");
super.beforeTest();
}
@Test
public void testGetTenantPurchaseFlag(){
String body = "{\"tenantId\":\""+xmAppApi.getLoginInfo().getStudioId()+"\"}";
xmAppApi.doRequest(RequestType.JSON,params,body,headers).assetsSuccess(true);
Assert.assertTrue(xmAppApi.getBodyInJSON().getBoolean("result"),"场馆已经购买但是返回的false");
}
}
......@@ -143,6 +143,14 @@ public class TestStartContractV2 extends BaseTestImpl {
}
}
@Test(priority = 1,description = "复制签署地址")
public void testGetContractSignUrl(){
String URL= eleContractTools.getContractSignUrl(eleContractId);
Assert.assertTrue(!URL.equals(""),"复制签署地址失败");
// 验证一下有待签署的合同,不允许重新认证
Assert.assertTrue(eleContractTools.checkBeforeResetVerify(),"有待签署的合同,但是重新认证校验返回的false");
}
@Test(priority = 1,description = "关联订单")
public void testAssociate(){
......
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