Commit 36c4c632 by xyy

fix case

parent 8fd79888
......@@ -34,12 +34,15 @@ public class TestBrandMerchantList extends XMBaseTest {
public void testBrandMerchantList(){
JSONObject object = new JSONObject();
object.put("brandId",xmAppApi.getLoginInfo().getBrandId());
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);
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;
public class TestCheckUnbind extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_checkUnbind")
.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 testCheckUnbind() {
JSONObject object = new JSONObject();
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);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "操作成功!");
}
}
......@@ -31,11 +31,14 @@ public class TestGetLatestApply extends XMBaseTest {
}
@Test(description = "获取最新商户号")
public void testBrandMerchantList(){
public void testGetLatestApply(){
JSONObject object = new JSONObject();
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);
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;
public class TestGetLatestSuccessApply extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_getLatestSuccessApply")
.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 testGetLatestSuccessApply() {
JSONObject object = new JSONObject();
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);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "操作成功!");
}
}
......@@ -35,9 +35,15 @@ public class TestGetMerchant extends XMBaseTest {
JSONObject object = new JSONObject();
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);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//检验场馆绑定商户
Assert.assertEquals(XMJSONPath.readPath(response,"$.result.studioId"),xmAppApi.getLoginInfo().getStudioId());
Assert.assertEquals(XMJSONPath.readPath(response,"$.result.openState"),"SUCCESS");
}
}
\ 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;
public class TestGetStudioJoinBrandInfo extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Merchant)
.setApiName("API_getStudioJoinBrandInfo")
.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 testGetStudioJoinBrandInfo() {
JSONObject object = new JSONObject();
object.put("id", 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);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "操作成功!");
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.name"), "小麦乐动自动化场馆");
}
}
......@@ -37,11 +37,14 @@ public class TestPageApply extends XMBaseTest {
JSONObject object = new JSONObject();
object.put("current",0);
object.put("size",20);
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);
JSONObject response = xmAppApi.getBodyInJSON();
Assert.assertEquals(XMJSONPath.readPath(response,"$.message"),"操作成功!");
//获取商户修改信息至少有1次记录
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