Commit 3b69493a authored by 赵然's avatar 赵然

zr

parent 879fdeb1
...@@ -19,9 +19,9 @@ public class 补给站_商品_DuibaTest extends AbstractTestNGSpringContextTests ...@@ -19,9 +19,9 @@ public class 补给站_商品_DuibaTest extends AbstractTestNGSpringContextTests
private DuibaLog logger = DuibaLog.getLogger(); private DuibaLog logger = DuibaLog.getLogger();
//至尊版app //至尊版app
String appId = "19515"; private static String appId = "19515";
//旗舰版app //旗舰版app
String appId2 = "21695"; private static String appId2 = "21695";
@Test(description = "至尊版app添加、上架至尊版实物") @Test(description = "至尊版app添加、上架至尊版实物")
......
package http.cases.SingleLotteryTest;
import base.DuibaLog;
import base.DuibaTestBase;
import http.service.hd.SigninService;
import io.restassured.internal.assertion.Assertion;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
import utils.MatcherString;
/**
* Created by zhaoran on 2018/6/8.
*/
public class 预览单品抽奖_AccessTest extends DuibaTestBase {
@Autowired
SigninService signinService;
private static DuibaLog logger = DuibaLog.getLogger();
@Test
public void 预览单抽() throws Exception {
Response response = signinService.preview("18714","3","2772","36732","zhaoran@duiba.com.cn");
String url = response.jsonPath().getString("data.url");
logger.info("预览url为:"+url);
Assert.assertEquals(url.contains("http://activity.m.duibatest.com.cn/autoLogin/autologin?appKey=BDqysEMghRqpDWAaQu9S4rLihHm&uid=duiba-preview-user"), true, "校验是否展示马上使用失败");
}
}
\ No newline at end of file
...@@ -124,12 +124,12 @@ public class DeveloperBJZ { ...@@ -124,12 +124,12 @@ public class DeveloperBJZ {
} }
//旗舰版app上架:至尊特权商品 //旗舰版app上架:至尊特权商品
public Response ajaxDirectUp2(String appId2, String itemIds) throws Exception { public Response ajaxDirectUp2(String appId, String itemIds) throws Exception {
String url = "http://" + hdHost + "/devRepo/ajaxDirectUp"; String url = "http://" + hdHost + "/devRepo/ajaxDirectUp";
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("appId",appId2); map.put("appId",appId);
map.put("itemIds", itemIds); 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 response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas(appId)).params(map).post(url);
response.prettyPrint(); response.prettyPrint();
try { try {
Assert.assertEquals(response.jsonPath().getString("desc"), "至尊版专享"); Assert.assertEquals(response.jsonPath().getString("desc"), "至尊版专享");
......
...@@ -82,4 +82,24 @@ public class SigninService { ...@@ -82,4 +82,24 @@ public class SigninService {
} }
return response; return response;
} }
//活动预览
public Response preview(String appId,String type,String sourceId,String activityId,String email) throws Exception{
Map<String,String> map = new HashMap<>();
map.put("appId",appId);
map.put("type",type);
map.put("sourceId",sourceId);
map.put("activityId",activityId);
Response response = given().cookies(authorization.hdLoginCommon(email)).params(map).post("http://"+hdHost+"/activity/preview");
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/activity/preview接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/activity/preview接口失败,返回信息:"+response.asString());
}
return response;
}
} }
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