Commit 9aea1576 authored by 龚小红's avatar 龚小红

更改xml文件

parent eb1a8b4c
package com.kjj.cases.assistant.menu;
import com.kjj.cases.admin.Authorization;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.BaseUtils.*;
public class NoviceGuidance implements Authorization {
private int userId; //小葡萄的用户id
private int sellerId; //小葡萄的销售id
private static final NetworkUtils network = NetworkUtils.getInstance();
@BeforeClass
public void setUp(){
ssoLogin();
}
@Test(description = "禁用代理人小葡萄",priority = 1)
public void 禁用代理人小葡萄() throws UnsupportedEncodingException {
//找到小葡萄的用户id
Map<String, Object> params = new HashMap<String, Object>();
String name = URLEncoder.encode("小葡萄","utf-8");
params.put("sellerName",name);
params.put("sellerId","");
params.put("pageNo",1);
params.put("pageSize",10);
params.put("agentId","");
params.put("phoneNumber","");
Response response = network.getResponse(params,MANAGER_vipList);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,MANAGER_vipList,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,MANAGER_vipList,"返回数据为空",response.body().asString()));
userId = response.jsonPath().getInt("data.list.get(0).userId");
sellerId = response.jsonPath().getInt("data.list.get(0).userVersionList.get(0).sellerId");
int userVersion = response.jsonPath().getInt("data.list.get(0).userVersionList.get(0).userVersion");
long vipBeginTime = response.jsonPath().getLong("data.list.get(0).userVersionList.get(0).vipBeginTime");
long vipEndTime = response.jsonPath().getLong("data.list.get(0).userVersionList.get(0).vipEndTime");
//禁用账号
params.put("userId",userId);
response = network.postResponse(params,MANAGER_updateTypeOrDate);
success = response.jsonPath().getBoolean("success");
boolean result = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,USINGSTRATAGY_strategyDetail,"接口返回失败",response.body().asString()));
Assert.assertTrue(result,network.message(params,USINGSTRATAGY_strategyDetail,"返回数据为空",response.body().asString()));
//切换会员
params.put("reason","测试账号");
params.put("sellerId",sellerId);
params.put("userVersion",userVersion);
params.put("vipEndDate",10);
params.put("vipStartDate","");
params.put("vipType",2);
response = network.getResponse(params,MANAGER_updateTypeOrDate);
success = response.jsonPath().getBoolean("success");
result = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,USINGSTRATAGY_strategyDetail,"接口返回失败",response.body().asString()));
Assert.assertTrue(result,network.message(params,USINGSTRATAGY_strategyDetail,"返回数据为空",response.body().asString()));
}
@Test(description = "小葡萄进入首页",priority = 2)
public void 小葡萄进入首页(){
}
}
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