Commit 3687d94c authored by 钱雯君's avatar 钱雯君

Merge branch 'mabo' into qwj_181029

parents 49c271e0 0c7c470f
......@@ -141,6 +141,9 @@ public class DingdingResult {
return result;
}
public String getJob() throws UnsupportedEncodingException {
return getByRun(run,"job");
}
public String getByRun(String run,String type) throws UnsupportedEncodingException {
run = run.substring(run.indexOf("_")+1, run.indexOf("."));
run =this.env.getProperty(run+"."+type);
......
......@@ -54,6 +54,8 @@ public class Postman {
public static void sendFinish(Map result){
Response response=given().params(result).get(miriaUrl);
System.out.println("jobName:"+result.get("jobName"));
System.out.println("miriaUrl:"+miriaUrl);
System.out.println("miria响应结果:"+response.asString());
}
public static Boolean getName(){
......
......@@ -7,6 +7,7 @@ import org.testng.xml.XmlSuite;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -75,6 +76,15 @@ public class TestReport implements IReporter{
}
map.put("failCase",failCase);
System.out.println("测试结果通知信息:"+gson.toJson(map));
//触发回调结束服务构建互斥
Map<String,String> mapJob = new HashMap<>();
try {
mapJob.put("jobName",ddResult.getJob());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Postman.sendFinish(mapJob);
//发送运行结果到自动化数据收集平台
if(sendPlatform)
Postman.sendTestPlatform(map);
......@@ -86,5 +96,6 @@ public class TestReport implements IReporter{
Postman.send2Dingding(map);
}
}
}
......@@ -139,8 +139,9 @@ public class 游戏_开大奖测试_AccessTest extends DuibaTestBase {
Response openWinnResponse = newGameService.openWinning(gameId);
openWinnResponse.prettyPrint();
Thread.sleep(3000);
Thread.sleep(8000);
List<Map<String,Object>> orders = jdbc.findModeResult("select * from ngame.ngame_orders where duiba_ngame_id = ?\n",gameId);
logger.info("orders信息为"+JSONObject.toJSONString(orders));
for(int i=0;i<orders.size();i++){
if (orders.get(i).get("consumer_id").toString().equals(user1.getConsumerId())){
Assert.assertEquals(orders.get(i).get("prize_id").toString(),optionId1,"第一名发奖奖项id校验失败");
......
......@@ -99,7 +99,7 @@ public class 游戏_新建无大奖游戏_AccessTest extends DuibaTestBase {
"[{\"type\":\"phonebill\",\"title\":\"小奖1\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png\",\"show\":true,\"description\":\"\",\"guarantee\":true,\"scoreArea\":\"0,100\",\"optionLimitCount\":\"\",\"limitDays\":\"\",\"limitTimeType\":\"\",\"rate\":5000,\"appItemId\":1,\"value\":\"1\",\"limit\":null,\"low\":null,\"remaind\":\"10000\",\"oldRemaind\":null,\"isMutliPrizeLimit\":false,\"autoOpen\":true}," +
"{\"type\":\"phonebill\",\"title\":\"小奖2\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png\",\"show\":true,\"description\":\"\",\"guarantee\":true,\"scoreArea\":\"101,200\",\"optionLimitCount\":\"\",\"limitDays\":\"\",\"limitTimeType\":\"\",\"rate\":8000,\"appItemId\":1,\"value\":\"2\",\"limit\":null,\"low\":null,\"remaind\":\"1000\",\"oldRemaind\":null,\"isMutliPrizeLimit\":false,\"autoOpen\":true}]");
Response response = given().contentType("application/x-www-form-urlencoded; charset=UTF-8").cookies(authorization.ssoLogin()).params(params).post("https://"+ url);
Response response = given().contentType("application/x-www-form-urlencoded; charset=UTF-8").cookies(authorization.ssoLogin()).params(params).post("http://"+ url);
response.prettyPrint();
Thread.sleep(3000);
......@@ -133,7 +133,7 @@ public class 游戏_新建无大奖游戏_AccessTest extends DuibaTestBase {
map1.put("id",gameIds.get(z));
map1.put("status","1");
Response response1 = given().cookies(authorization.ssoLogin()).contentType("application/x-www-form-urlencoded; charset=UTF-8").params(map1).post("https://"+url);
Response response1 = given().cookies(authorization.ssoLogin()).contentType("application/x-www-form-urlencoded; charset=UTF-8").params(map1).post("http://"+url);
Map<String,Object> result = jdbc.findSimpleResult("select * from ngame.duiba_ngame where id = ?\n",gameIds.get(z));
Assert.assertEquals(result.get("game_status").toString(),"1","校验状态修改失败");
}else if (z==1){
......
......@@ -11,6 +11,7 @@ package http.cases.PkTest;
import base.DuibaLog;
import base.DuibaTestBase;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import http.model.BetMobileVo;
import http.service.Activity.PkService;
import io.restassured.response.Response;
......@@ -61,8 +62,11 @@ public class pk_列表测试_AccessTest extends DuibaTestBase {
logger.info("未参加过押注用户的列表数据校验成功,unbetList的信息为"+ JSON.toJSONString(unbetList));
Response response_uid_18816 = pkService.getBetList(uid_18816);
logger.info("response_uid_18816"+ JSONObject.toJSONString(response_uid_18816.prettyPrint()));
List<BetMobileVo> betedList_uid_18816 = response_uid_18816.jsonPath().getList("data.betedList",BetMobileVo.class);
logger.info("betedList_uid_18816的信息为"+ JSONObject.toJSONString(betedList_uid_18816));
List<BetMobileVo> unbetList_uid_18816 = response_uid_18816.jsonPath().getList("data.unbetList",BetMobileVo.class);
logger.info("unbetList_uid_188166的信息为"+ JSONObject.toJSONString(unbetList_uid_18816));
Assert.assertEquals(String.valueOf(unbetList_uid_18816.size()),"0","已投注的活动为0校验失败");
Assert.assertEquals(String.valueOf(betedList_uid_18816.size()),"0","未投注的活动为0校验失败");
logger.info("没有添加pk楼层,用户的列表数据校验成功,均为空,betedList_uid_18816="+ JSON.toJSONString(betedList_uid_18816)+"\nunbetList_uid_18816="+ JSON.toJSONString(unbetList_uid_18816));
......
......@@ -85,8 +85,8 @@ public class pk_开奖_瓜分红包_押注人数不同测试_AccessTest extends
@Test
public void 瓜分红包_两个选项_押注人数不同_开奖测试(){
try {
public void 瓜分红包_两个选项_押注人数不同_开奖测试() throws Exception{
List<Map<String,Object>> pks = jdbc.findModeResult("select * from act_com_conf.tb_bet_option where bet_id = ?",newBetId);
logger.info("pk活动信息为"+JSONObject.toJSONString(pks));
......@@ -171,11 +171,6 @@ public class pk_开奖_瓜分红包_押注人数不同测试_AccessTest extends
Assert.assertEquals(use4_Acc2.toString(),String.valueOf(use4_Acc1+10),"用户4入账校验失败");
}catch (Exception e){
e.printStackTrace();
}
}
......
......@@ -50,10 +50,10 @@ public class pk_开奖_瓜分红包_押注人数相同测试_AccessTest extends
private String groupId = "7";
private Integer user01 = 4782;
private String consumerId01 = "100107000";//activity_order_con.tb_trade_center_activity_order_0760
private Integer user02 = 4783;
private String consumerId02 = "100107001";//activity_order_con.tb_trade_center_activity_order_0761
private Integer user01 = 4784;
private String consumerId01 = "100108068";//activity_order_con.tb_trade_center_activity_order_0804
private Integer user02 = 4785;
private String consumerId02 = "100108069";//activity_order_con.tb_trade_center_activity_order_0805
private String newBetId = "";
......@@ -84,9 +84,9 @@ public class pk_开奖_瓜分红包_押注人数相同测试_AccessTest extends
}
logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString());
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0760 where consumer_id = '100107000' and account_type = '6'\n");
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0804 where consumer_id = '100108068' and account_type = '6'\n");
Long use1_Acc1 = Long.valueOf(user01_account1.get("balance_amount").toString());
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0761 where consumer_id = '100107001' and account_type = '6'\n");
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0805 where consumer_id = '100108069' and account_type = '6'\n");
Long use2_Acc1 = Long.valueOf(user02_account1.get("balance_amount").toString());
......@@ -121,9 +121,9 @@ public class pk_开奖_瓜分红包_押注人数相同测试_AccessTest extends
}
}
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0760 where consumer_id = '100107000' and duiba_activity_id = ?\n",newBetId);
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0804 where consumer_id = '100108068' and duiba_activity_id = ?\n",newBetId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"10","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0761 where consumer_id = '100107001' and duiba_activity_id = ?\n",newBetId);
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0805 where consumer_id = '100108069' and duiba_activity_id = ?\n",newBetId);
Assert.assertEquals(user02_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
logger.info("用户01获取的红包值为:"+user01_order.get("add_credits").toString()+",用户02获取的红包值为:"+user02_order.get("add_credits").toString());
......@@ -136,10 +136,10 @@ public class pk_开奖_瓜分红包_押注人数相同测试_AccessTest extends
Assert.assertTrue(bet1Times>bet2Times,"活动获胜人数比失败人数多校验失败");
logger.info("选项1的押注人数为:"+bet1Result.get("bet_times").toString()+",选项2的押注人数为:"+bet2Result.get("bet_times").toString());
Map<String,Object> user01_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0760 where consumer_id = '100107000' and account_type = '6'\n");
Map<String,Object> user01_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0804 where consumer_id = '100108068' and account_type = '6'\n");
Long use1_Acc2 = Long.valueOf(user01_account2.get("balance_amount").toString());
Assert.assertEquals(use1_Acc2.toString(),String.valueOf(use1_Acc1+10),"用户2入账校验失败");
Map<String,Object> user02_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0761 where consumer_id = '100107001' and account_type = '6'\n");
Map<String,Object> user02_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0805 where consumer_id = '100108069' and account_type = '6'\n");
Long use2_Acc2 = Long.valueOf(user02_account2.get("balance_amount").toString());
Assert.assertEquals(use2_Acc2,use2_Acc1,"用户2入账校验失败");
......
......@@ -11,6 +11,7 @@ import base.DuibaLog;
import base.DuibaTestBase;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import http.service.Authorization;
import http.service.Manager.EditManagerInfoService;
import http.service.app.SeckillService;
......@@ -23,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.Assert;
import org.testng.annotations.Test;
import utils.GetCookieUtil;
import utils.MatcherString;
import java.util.HashMap;
......@@ -178,12 +180,13 @@ public class 天天秒杀_秒杀活动兑换测试_SeckillTest extends DuibaTest
Map<String,String> map = new HashMap<>();
Response response = editManagerInfoService.createUser("qwj测试秒杀用户");
Map<String,Object> user = jdbc.findSimpleResult("select * from dafuweng.user where name = 'qwj测试秒杀用户' and app_id = '67'\n");
String uid = user.get("id").toString();
String url = "http://47.97.214.108/user/loginDuiba?uid=" + uid;
Response login = given().get(url);
Map<String,Object> consumer = jdbc.findSimpleResult("select * from new_consumer.consumer_0010 where partner_user_id =? and app_id = '18816'\n",uid);
String consumerId = consumer.get("id").toString();
String url = GetCookieUtil.genUrl(uid,"3erv8LvBxKBSyuGK5i8FSGyYoFD1");
JSONObject cookie = GetCookieUtil.getConsumerIdFromCookie(url);
String consumerId = cookie.get("cid").toString();
Boolean res = jdbc.update("UPDATE new_consumer.consumer_0010 set addr_name = 'qwj' , addr_phone = '18143476563' ,addr_province = '浙江省' ,addr_city = '杭州市' " +
", addr_area = '西湖区' , addr_detail = '奖池花印' where partner_user_id = ? and app_id = '18816'\n",uid);
map.put("uid",uid);
......
......@@ -142,7 +142,7 @@ public class 种红包新用户_AccessTest extends DuibaTestBase{
Response response = editManagerInfoService.createUser("种红包新用户","68");
Map<String,Object> user = jdbc.findSimpleResult("select * from dafuweng.user where name = '种红包新用户' and app_id = '68'");
uid = Integer.valueOf(user.get("id").toString());
String url = "http://47.97.214.108/user/loginDuiba?uid=" + uid;
String url = "http://dafuweng.duibatest.com.cn/user/loginDuiba?uid=" + uid;
Response login = given().get(url);
Map<String,Object> consumer = jdbc.findSimpleResult("select * from new_consumer.consumer_0010 where partner_user_id =? and app_id = '19380'",uid);
consumerId = consumer.get("id").toString();
......
......@@ -103,7 +103,7 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
logger.info("种红包的红包配置接口校验正确");
}
@Test
//@Test
public void 衰减红包校验() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(uid4);
......
......@@ -128,7 +128,7 @@ public class 账户异常提现_AccessTest extends DuibaTestBase{
}
@Test
//@Test
public void 开发者账户余额不足() throws Exception {
//获取原账户余额
......
......@@ -164,7 +164,7 @@ public class Authorization {
Map params=new HashMap();
params.put("uid","not_login");
params.put("credits","0");
String url=tool.buildUrlWithSign("http://home.m.duibatest.com.cn/autoLogin/autologin?",params);
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);
return response;
......
......@@ -448,8 +448,7 @@ public class EditManagerInfoService {
public Response createUser(String name){
String url = "http://47.97.214.108" + "/user/create";
String url = "http://dafuweng.duibatest.com.cn" + "/user/create";
Map<String,Object> map = new HashMap<>();
map.put("appId","67");
map.put("name",name);
......@@ -464,7 +463,7 @@ public class EditManagerInfoService {
public Response createUser(String name,String appId){
String url = "http://47.97.214.108" + "/user/create";
String url = "http://dafuweng.duibatest.com.cn" + "/user/create";
Map<String,Object> map = new HashMap<>();
map.put("appId",appId);
map.put("name",name);
......
......@@ -4,8 +4,8 @@ proxyserver.ip=172.16.80.203
proxyserver.port=22
proxyserver.user=dev
proxyserver.prvkey=key/hzlId_rsa
dafuweng.host=47.97.214.108
dafuweng.port=9002
dafuweng.host=dafuweng.duibatest.com.cn
dafuweng.port=80
uid=2707
appId=2239
hdserver.host=hd.dlp.duibatest.com.cn
......@@ -24,47 +24,54 @@ trade.host = activity.m.duibatest.com.cn
//\u6570\u636E\u5E93\u914D\u7F6E
db.name = duiba_test
db.password= svbP3KUw2PurAnBb2rbs3vohF
db.url = jdbc:mysql://rdswy2b9wy53044250u1o.mysql.rds.aliyuncs.com:3306/?tinyInt1isBit=false
db.url = jdbc:mysql://47.97.127.67:13001/?tinyInt1isBit=false
db.driver= com.mysql.cj.jdbc.Driver
db.maxtotal = 6
//\u9489\u9489\u62A5\u544A\u914D\u7F6E
pluginTest.project=\u63D2\u4EF6
//钉钉报告配置
pluginTest.project=插件
pluginTest.names=zhaoran,qianwenjun
pluginTest.group=\u63D2\u4EF6-\u63A5\u53E3\u81EA\u52A8\u5316
pluginTest.group=插件-接口自动化
pluginTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaPlugin_interface/HTML_Report/suite1_test1_results.html
pluginTest.job=duibaPlugin_interface
signTest.project=\u7B7E\u5230
signTest.project=签到
signTest.names=zhousongbo
signTest.group=\u7B7E\u5230-\u63A5\u53E3\u81EA\u52A8\u5316
signTest.group=签到-接口自动化
signTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaSign_interface/HTML_Report/suite1_test1_results.html
signTest.job=duibaSign_interface
FloorTest.project=\u697C\u5C42
FloorTest.project=楼层
FloorTest.names=zhaoran,qianwenjun
FloorTest.group=\u697C\u5C42-\u63A5\u53E3\u81EA\u52A8\u5316
FloorTest.group=楼层-接口自动化
FloorTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaFloor_interface/HTML_Report/suite1_test1_results.html
FloorTest.job=duibaFloor_interface
DuibaTest.project=\u6D3B\u52A8\u5DE5\u5177
DuibaTest.project=活动工具
DuibaTest.names=zhaoran,qianwenjun
DuibaTest.group=\u6D3B\u52A8\u5DE5\u5177-\u63A5\u53E3\u81EA\u52A8\u5316
DuibaTest.group=活动工具-接口自动化
DuibaTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duiba_interface/HTML_Report/suite1_test1_results.html
DuibaTest.job=duiba_interface
AccessTest.project=\u7EFC\u5408\u4E1A\u52A1(\u5355\u54C1\u62BD\u5956/\u79D2\u6740/\u6E38\u620F)
AccessTest.project=综合业务(单品抽奖/秒杀/游戏)
AccessTest.names=zhaoran,qianwenjun
AccessTest.group=\u7EFC\u5408\u4E1A\u52A1-\u63A5\u53E3\u81EA\u52A8\u5316
AccessTest.group=综合业务-接口自动化
AccessTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaAccess_interface/HTML_Report/suite1_test1_results.html
AccessTest.job=duibaAccess_interface
JenkinsTest.project=\u7EFC\u5408\u4E1A\u52A1(\u5355\u54C1\u62BD\u5956/\u79D2\u6740/\u6E38\u620F)
JenkinsTest.project=综合业务(单品抽奖/秒杀/游戏)
JenkinsTest.names=zhaoran,qianwenjun
JenkinsTest.group=\u7EFC\u5408\u4E1A\u52A1-\u63A5\u53E3\u81EA\u52A8\u5316
JenkinsTest.group=综合业务-接口自动化
JenkinsTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaAccess_interface/HTML_Report/suite1_test1_results.html
ExchangeTest.project=\u666E\u5151\u4E1A\u52A1
ExchangeTest.project=普兑业务
ExchangeTest.names=panyuli
ExchangeTest.group=\u666E\u5151\u4E1A\u52A1-\u63A5\u53E3\u81EA\u52A8\u5316
ExchangeTest.group=普兑业务-接口自动化
ExchangeTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaExchange_interface/HTML_Report/suite1_test1_results.html
ExchangeTest.job=duibaExchange_interface
SeckillTest.project=\u79D2\u6740\u4E1A\u52A1
SeckillTest.project=秒杀业务
SeckillTest.names=qianwenjun
SeckillTest.group=\u79D2\u6740\u4E1A\u52A1-\u63A5\u53E3\u81EA\u52A8\u5316
SeckillTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/Seckill_interface/HTML_Report/suite1_test1_results.html
\ No newline at end of file
SeckillTest.group=秒杀业务-接口自动化
SeckillTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/Seckill_interface/HTML_Report/suite1_test1_results.html
SeckillTest.job=Seckill_interface
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