Commit 6a07135d authored by 赵然's avatar 赵然

Merge branch 'zr' into develop

parents 53c3b4ee 7827738e
...@@ -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添加、上架至尊版实物")
......
...@@ -31,6 +31,7 @@ public class 设置_应用信息_DuibaTest extends AbstractTestNGSpringContextTe ...@@ -31,6 +31,7 @@ public class 设置_应用信息_DuibaTest extends AbstractTestNGSpringContextTe
String unitName = isDecimalOpen ? "元" : "积分"; String unitName = isDecimalOpen ? "元" : "积分";
updateAppInfoService.UpdateAppInfo(appId,unitName,earnCreditsUrl,creditsDetailUrl,isDecimalOpen); updateAppInfoService.UpdateAppInfo(appId,unitName,earnCreditsUrl,creditsDetailUrl,isDecimalOpen);
Thread.sleep(1000);
Response response2= updateAppInfoService.appInfo(appId); Response response2= updateAppInfoService.appInfo(appId);
Assert.assertEquals(response2.jsonPath().getString("data.name"), "(saas自动化)至尊版", "校验应用名称失败"); Assert.assertEquals(response2.jsonPath().getString("data.name"), "(saas自动化)至尊版", "校验应用名称失败");
Assert.assertEquals(response2.jsonPath().getString("data.earnCreditsLetter"), "积分文案&2", "校验积分文案失败"); Assert.assertEquals(response2.jsonPath().getString("data.earnCreditsLetter"), "积分文案&2", "校验积分文案失败");
......
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
...@@ -275,7 +275,7 @@ public class Authorization { ...@@ -275,7 +275,7 @@ public class Authorization {
i--; i--;
} }
logger.info("hdCookiesSaasByApp cookies集合:"+hdCookiesSaasByApp.toString());
return hdCookies; return hdCookies;
} }
//密码为duibaduiba123 //密码为duibaduiba123
......
...@@ -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"), "至尊版专享");
......
...@@ -34,7 +34,7 @@ public class UpdateAppInfoService { ...@@ -34,7 +34,7 @@ public class UpdateAppInfoService {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("appId",appId); map.put("appId",appId);
map.put("creditsRate","100"); map.put("creditsRate","100");
map.put("appName","(saas)接口自动化应用"); map.put("appName","(saas自动化)至尊版");
map.put("appTitle","自动化测试使用"); map.put("appTitle","自动化测试使用");
map.put("logoVal","//yun.dui88.com/images/201809/svieibjtn0.png"); map.put("logoVal","//yun.dui88.com/images/201809/svieibjtn0.png");
map.put("unitName",unitName); map.put("unitName",unitName);
......
...@@ -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