Commit c8290f14 by yangfangfang

修改标签管理、增加会员管理接口

parent 716e9a88
package com.xiaomai.cases.polar.member;
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 TestFindDetailById extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Clue)
.setApiName("API_findDetailById")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("yff")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@Test(description = "获取会员详情以及更多资料")
public void testFindDetailById(){
//暂时还不能转会员,只能写死:memberId:1771002119284924417-自动化正式会员勿动
JSONObject jsonObject=new JSONObject();
jsonObject.put("memberId","1771002119284924417");
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
JSONObject response=xmAppApi.getBodyInJSON();
String success=response.getString("success");
Assert.assertEquals(success,"true","获取会员详情以及更多资料失败");
}
@Test(description = "获取会员详情以及更多资料-会员id不能为空")
public void testFindDetailById_1(){
JSONObject jsonObject1=new JSONObject();
jsonObject1.put("memberId","");
xmAppApi.doRequest(RequestType.JSON,params,jsonObject1.toJSONString(),headers).assetsSuccess(false);
Assert.assertEquals(XMJSONPath.readPath(xmAppApi.getBodyInJSON(),"$message"),"会员id不能为空");
}
}
......@@ -6,6 +6,7 @@ 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;
......@@ -41,4 +42,17 @@ public class TestFetchPage extends XMBaseTest {
Assert.assertEquals(success,"true","获取标签列表失败");
}
@Test(description = "获取标签列表-品牌id不能为空")
public void testFetchPage_1(){
JSONObject jsonObject=new JSONObject();
jsonObject.put("size",20);
jsonObject.put("current",0);
jsonObject.put("brandId","");
jsonObject.put("needUsageInfo","true");
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(false);
Assert.assertEquals(XMJSONPath.readPath(xmAppApi.getBodyInJSON(),"$message"),"品牌id不能为空");
}
}
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