Commit de520450 authored by 赵然's avatar 赵然

Merge branch 'mabo' of gitlab2.dui88.com:mabo/test-platform into mabo

parents a8ad2db3 1279dbc5
......@@ -152,7 +152,11 @@ public class 抽奖异常测试_DuibaTest extends DuibaTestBase {
//获取未登录场景cookie
Response responses = authorization.autoLogin();
//进行接口测试传参
Response response = newActivityService.doJoin(responses.getDetailedCookies(),data.get("token"),data.get("activityId"));
Map<String,String> map = responses.getCookies();
logger.info("cookies:"+map.toString());
if(responses.getDetailedCookies()==null)logger.info("cookies = = null");
Response response = newActivityService.doJoinMap(map,data.get("token"),data.get("activityId"));
// Response response = newActivityService.doJoin(responses.getDetailedCookies(),data.get("token"),data.get("activityId"));
response.prettyPrint();
String success = String.valueOf(response.jsonPath().getString("success"));
//根据case选择校验项
......
......@@ -68,6 +68,26 @@ public class NewActivityService {
map.put("oaId",activityId);
logger.info("请求/hdtool/doJoin接口,activityId="+activityId);
logger.info("url:"+url+"/hdtool/doJoin");
Response response = given().cookies(cookies).params(map).post(url+"/hdtool/doJoin");
try{
Assert.assertEquals(String.valueOf(response.getStatusCode()),"200");
logger.info("/hdtool/doJoin接口成功,返回信息:"+response.asString());
}catch(Exception e){
throw new Exception("/hdtool/doJoin接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/hdtool/doJoin接口失败,返回信息:"+response.asString());
}
return response;
}
public Response doJoinMap(Map cookies, String token,String activityId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("token",token);
map.put("activityId",activityId);
map.put("oaId",activityId);
logger.info("请求/hdtool/doJoin接口,activityId="+activityId);
logger.info("url:"+url+"/hdtool/doJoin");
Response response = given().cookies(cookies).params(map).post(url+"/hdtool/doJoin");
try{
Assert.assertEquals(String.valueOf(response.getStatusCode()),"200");
......
......@@ -167,6 +167,9 @@ public class Authorization {
String url=tool.buildUrlWithSign("http://activity.m.duibatest.com.cn/autoLogin/autologin?",params);
logger.info("dafuweng免登陆url为:"+url);
Response response=given().redirects().follow(false).get(url);
logger.info("dafuweng免登陆,响应数据:"+response.asString());
logger.info("dafuweng免登陆,响应状态码:"+response.getStatusCode());
return response;
}
public Map generateSignAutoLogin(String appKey, int uid){
......
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