Commit 5480e87b by yangfangfang

新增会员管理接口

parent 7c9f9f5a
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="通用设置场景case"> <!-- 起一个好听且唯一的名字-->
<test name="通用设置模块测试" preserve-order="true" verbose="3"> <!-- 再起一个听且唯一的名字 -->
<packages>
<package name="com.xiaomai.cases.polar.member.*"></package> <!-- 添加自己想要集成测试的case 范围自己定 -->
</packages>
</test>
<listeners>
<listener class-name="com.xiaomai.client.RetryListener" />
<listener class-name="com.xiaomai.client.TestListener" />
<listener class-name="com.xiaomai.client.ExtentTestNGIReporterListener"/>
</listeners>
</suite>
\ No newline at end of file
package com.xiaomai.cases.polar.member;
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 org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class TestSearch extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Clue)
.setApiName("API_searchMember")
.setLoginUser(LoginAccount.YFF_DEV)
.setTerminal(Terminal.B);
dal.setCase_owner("yff")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
super.beforeTest();
}
@DataProvider
public Object[][] dataProvider(){
return new Object[][]{
{"NORMAL"},
{"HISTORY"}
};
}
@Test(description = "获取正式会员和流失会员列表",dataProvider = "dataProvider")
public void testSearch(String status){
JSONObject jsonObject=new JSONObject();
jsonObject.put("current",0);
jsonObject.put("size",20);
jsonObject.put("brandId",xmAppApi.getLoginInfo().getBrandId());
JSONObject studioFilter=new JSONObject();
studioFilter.put("studioId",xmAppApi.getLoginInfo().getStudioId());
jsonObject.put("studioFilter",studioFilter);
JSONArray statusList=new JSONArray();
statusList.add(status);
jsonObject.put("statusList",statusList);
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
JSONObject response=xmAppApi.getBodyInJSON();
String success=response.getString("success");
Assert.assertEquals("true",success,"获取会员管理(正式会员/流失学员)列表失败");
}
@DataProvider
public Object[][] dataProvider1(){
return new Object[][]{
{"NORMAL"},
{"HISTORY"}
};
}
@Test(description = "筛选正式会员/流失学员来源、当前创建人、性别",dataProvider = "dataProvider1")
public void testSearchResource(String status){
JSONObject jsonObject=new JSONObject();
jsonObject.put("current",0);
jsonObject.put("size",20);
jsonObject.put("brandId",xmAppApi.getLoginInfo().getBrandId());
JSONObject studioFilter=new JSONObject();
studioFilter.put("studioId",xmAppApi.getLoginInfo().getStudioId());
jsonObject.put("studioFilter",studioFilter);
JSONArray statusList=new JSONArray();
statusList.add(status);
jsonObject.put("statusList",statusList);
jsonObject.put("resourceId","1");
jsonObject.put("creatorId",xmAppApi.getLoginInfo().getAdminId());
jsonObject.put("gender","WOMEN");
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
JSONObject response=xmAppApi.getBodyInJSON();
String success=response.getString("success");
Assert.assertEquals("true",success,"筛选会员管理(正式会员/流失学员)来源失败");
}
}
......@@ -9,6 +9,9 @@ public class ApiModule {
public static String Polar_Config ="polar_config";
public static String Polar_Setting ="polar_setting";//通用设置
public static String Polar_Clue ="polar_clue";
public static String Polar_Member ="polar_member";//会员管理
}
\ No newline at end of file
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