Commit 99220cd4 authored by 胡梦新's avatar 胡梦新

hmx

parent ebe0b46a
......@@ -21,10 +21,13 @@ public class 补给站 extends DuibaTestBase {
DeveloperObjectService developerObjectService;
private DuibaLog logger = DuibaLog.getLogger();
//至尊版app
String appId="19515";
//旗舰版app
String appId2="21695";
//添加、上架至尊版实物
//至尊版app添加、上架至尊版实物
@Test
public void a_添加至尊版实物() throws Exception{
//查询列表,获取ID
......@@ -47,8 +50,21 @@ public class 补给站 extends DuibaTestBase {
developerObjectService.ajaxDel(appItemId);
}
//旗舰版app添加、上架至尊版实物:异常场景,提示不能上架
@Test
public void b_实物搜索() throws Exception{
public void b_旗舰版添加至尊版实物() throws Exception{
//查询列表,获取ID
Response response =developerBJZ.items("2",appId2);
String id= String.valueOf(response.jsonPath().getString("data.list[0].id"));
//上架
Response response2=developerBJZ.ajaxDirectUp2(appId2,id);
//接口提示,至尊版专享,不能上架
Assert.assertEquals(response2.jsonPath().getString("desc"), "至尊版专享", "校验接口上架失败");
}
//优质好货搜索功能
@Test
public void c_实物搜索() throws Exception{
// 根据具体的名称搜索出实物
developerBJZ.items2("2",appId);
// 输入精确的名称查询不到此实物
......@@ -59,7 +75,7 @@ public class 补给站 extends DuibaTestBase {
//添加、上架优惠券
@Test
public void c_添加至尊版优惠券() throws Exception{
public void d_添加至尊版优惠券() throws Exception{
//查询列表,获取ID
Response response =developerBJZ.coupons(appId,"2");
String id= String.valueOf(response.jsonPath().getString("data.list[0].id"));
......@@ -79,8 +95,20 @@ public class 补给站 extends DuibaTestBase {
developerObjectService.ajaxDel(appItemId);
}
//旗舰版app添加、上架至尊版优惠券:异常场景,提示不能上架
@Test
public void e_旗舰版添加至尊版优惠券() throws Exception{
//查询列表,获取ID
Response response =developerBJZ.coupons(appId2,"2");
String id= String.valueOf(response.jsonPath().getString("data.list[0].id"));
//上架
Response response2=developerBJZ.ajaxDirectUp2(appId2,id);
//接口提示,至尊版专享,不能上架
Assert.assertEquals(response2.jsonPath().getString("desc"), "至尊版专享", "校验接口上架失败");
}
@Test
public void e_添加直冲类() throws Exception{
public void f_添加直冲类() throws Exception{
String data= PublicMethod.data();
Response response1= developerBJZ.directCharges(appId);
String itemId=String.valueOf(response1.jsonPath().getString("data.list[1].id"));
......
......@@ -77,7 +77,7 @@ public class DeveloperBJZ {
map.put("rowId","1");
map.put("itemName","测试至尊享版-实物31");
map.put("max","20");
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas("19515")).params(map).get(url);
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas(appId)).params(map).get(url);
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"成功");
}catch(Exception e){
......@@ -123,6 +123,24 @@ public class DeveloperBJZ {
return response;
}
//旗舰版app上架:至尊特权商品
public Response ajaxDirectUp2(String appId2,String itemIds) throws Exception{
String url="http://"+hdHost+"/devRepo/ajaxDirectUp";
Map<String,String> map = new HashMap<>();
map.put("appId",appId2);
map.put("itemIds",itemIds);
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas(appId2)).params(map).post(url);
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"至尊版专享");
}catch(Exception e){
throw new Exception("创建接口1失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("创建接口2失败,返回信息:"+response.asString());
}
return response;
}
//大牌好券--查询至尊版特权TAB
public Response coupons(String appId,String type) throws Exception{
String url="http://"+hdHost+"/saasitem/coupons";
......
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