Commit 39fcf9fa authored by 赵然's avatar 赵然

Merge branch 'master' into develop

parents 800b94a7 986e4c44
......@@ -62,7 +62,7 @@ public class TestListener implements ITestListener {
serviceDoctor();
}catch (SkipException e){
SFExpress.skip = context.getAllTestMethods().length;
throw e;
// throw e;
}
}
......
......@@ -44,6 +44,10 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
DevItemService devItemService;
@Autowired
ActivityService activityService;
private int uid = 4642;
private String appId = "21465";
private Map hdCookies;
private DuibaLog logger = DuibaLog.getLogger();
private String skinId=null;
......@@ -51,11 +55,12 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354006");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤ActiveGroup");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboActiveGroup");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -387,11 +392,11 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -403,15 +408,15 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
List<Map> list = jsonPath.getList("list",Map.class);
// response = devItemService.appItems(authorization.hdLoginmabo(),"18740");
response = activityService.list2(authorization.hdLoginmabo(),"18740");
// response = devItemService.appItems(hdCookies,appId);
response = activityService.list2(hdCookies,appId);
response.prettyPrint();
List<Map> maplist = response.jsonPath().getList("data.list",Map.class);
int size = maplist.size();
......@@ -445,7 +450,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
......
......@@ -42,23 +42,28 @@ public class Banner_FloorTest extends DuibaTestBase {
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4643;
private String appId = "21466";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
List<Map> list = devFloorBannerService.selectedList(authorization.hdLoginmabo(),"18740");
hdCookies = authorization.hdLoginCommonNew("13193354007");
List<Map> list = devFloorBannerService.selectedList(hdCookies,appId);
for(int i=0;i<list.size();i++){
Map map = list.get(i);
String bannerId = String.valueOf(map.get("bannerId"));
devFloorBannerService.delBanner(authorization.hdLoginmabo(),"18740",bannerId);
devFloorBannerService.delBanner(hdCookies,appId,bannerId);
}
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤banner");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboTest楼层banner");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -154,21 +159,21 @@ public class Banner_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
response = devFloorBannerService.activityList(authorization.hdLoginmabo(),"18740","");
response = devFloorBannerService.activityList(hdCookies,appId,"");
response.prettyPrint();
JSONObject json = new JSONObject();
json.putAll(getByName(response.jsonPath().getList("data"),"【自动化】出奖虚拟商品"));
json.put("appId", 18740);
json.put("appId", appId);
json.put("new", false);
json.put("selected", false);
json.put("show", true);
devFloorBannerService.saveActivityBanner(authorization.hdLoginmabo(),json.toJSONString()).prettyPrint();
devFloorBannerService.saveActivityBanner(hdCookies,json.toJSONString()).prettyPrint();
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -180,7 +185,7 @@ public class Banner_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
......@@ -201,7 +206,7 @@ public class Banner_FloorTest extends DuibaTestBase {
// Assert.assertEquals(link,"//activity.m.duibatest.com.cn/newtools/index?id=21344&dbnewopen&dpm=18740.5.231.3&dcm=202.21344.0.0","");
Assert.assertEquals(title,"【自动化】出奖虚拟商品","");
Assert.assertEquals(sourceType,"13","");
Assert.assertEquals(activityId,"21344","");
Assert.assertEquals(activityId,"36114","");
......@@ -212,18 +217,18 @@ public class Banner_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devFloorBannerService.itemList(authorization.hdLoginmabo(),"18740","");
Response response = devFloorBannerService.itemList(hdCookies,appId,"");
response.prettyPrint();
JSONObject json = new JSONObject();
json.putAll(getByName(response.jsonPath().getList("data"),"mabo自动化实物"));
json.put("appId", 18740);
json.put("appId", appId);
json.put("new", false);
json.put("selected", false);
json.put("show", true);
devFloorBannerService.saveItemBanner(authorization.hdLoginmabo(),json.toJSONString()).prettyPrint();
devFloorBannerService.saveItemBanner(hdCookies,json.toJSONString()).prettyPrint();
Thread.sleep(62000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -235,7 +240,7 @@ public class Banner_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
response.prettyPrint();
String s = response.asString();
......@@ -251,11 +256,11 @@ public class Banner_FloorTest extends DuibaTestBase {
String sourceType = String.valueOf(map.get("sourceType"));
Assert.assertEquals(image,"//yun.dui88.com/images/201805/7mwt22vdfu.jpg","");
Assert.assertEquals(image,"//yun.dui88.com/images/201811/tkuykkb8s2.jpg","");
// Assert.assertEquals(link,"//goods.m.duibatest.com.cn/mobile/appItemDetail?appItemId=163948&dbnewopen&dpm=18740.5.231.2&dcm=102.163948.0.0","");
Assert.assertEquals(title,"mabo自动化实物","");
Assert.assertEquals(sourceType,"0","");
Assert.assertEquals(appItemId,"163948","");
Assert.assertEquals(appItemId,"186478","");
......@@ -264,7 +269,7 @@ public class Banner_FloorTest extends DuibaTestBase {
public void D_banner自定义外链接() throws Exception {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
String appId = "18740";
// String appId = "18740";
String bannerImgNew = "";
String img = "//yun.dui88.com/images/201805/hdgasav66e.jpg";
String title = "banner上传自动化测试";
......@@ -278,10 +283,10 @@ public class Banner_FloorTest extends DuibaTestBase {
json.put("url",url);
devFloorBannerService.uploadBanner(authorization.hdLoginmabo(),json.toJSONString()).prettyPrint();
devFloorBannerService.uploadBanner(hdCookies,json.toJSONString()).prettyPrint();
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -293,7 +298,7 @@ public class Banner_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
Response response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
Response response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
......@@ -330,15 +335,15 @@ public class Banner_FloorTest extends DuibaTestBase {
public void E_删除banner皮肤和楼层() throws Exception {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
List<Map> list = devFloorBannerService.selectedList(authorization.hdLoginmabo(),"18740");
List<Map> list = devFloorBannerService.selectedList(hdCookies,appId);
for(int i=0;i<list.size();i++){
Map map = list.get(i);
String bannerId = String.valueOf(map.get("bannerId"));
devFloorBannerService.delBanner(authorization.hdLoginmabo(),"18740",bannerId);
devFloorBannerService.delBanner(hdCookies,appId,bannerId);
}
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......@@ -366,7 +371,7 @@ public class Banner_FloorTest extends DuibaTestBase {
//@Test
public void test1(){
Response response = homeService.index(2753);
Response response = homeService.index(uid);
String html = response.asString();
// System.out.println(html);
String find = "var CfG={(.*?)";
......
......@@ -47,14 +47,19 @@ public class Coupon_FloorTest extends DuibaTestBase {
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4644;
private String appId = "21467";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354008");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤conpon");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboConpon");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -342,11 +347,11 @@ public class Coupon_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
int showNum = 5;
int showNum = 3;
JSONObject json = new JSONObject();
json.put("appId","18740");
json.put("appId",appId);
json.put("floorId",floorId);
json.put("floorTitle","优惠券");
json.put("showNum",String.valueOf(showNum));
......@@ -354,14 +359,14 @@ public class Coupon_FloorTest extends DuibaTestBase {
response = devFloorChildPageService.couponPageConfig(authorization.hdLoginmabo(),json.toJSONString());
response = devFloorChildPageService.couponPageConfig(hdCookies,json.toJSONString());
Thread.sleep(70000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -373,7 +378,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
......@@ -393,7 +398,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -42,14 +42,19 @@ public class Game_FloorTest extends DuibaTestBase {
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4648;
private String appId = "21468";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354009");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤Game");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboGame");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -230,11 +235,11 @@ public class Game_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -246,7 +251,7 @@ public class Game_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
response.prettyPrint();
......@@ -273,7 +278,7 @@ public class Game_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -47,28 +47,33 @@ public class Icon_FloorTest extends DuibaTestBase {
private String skinId=null;
private String floorId=null;
private String bannerId = null;
private int uid = 4650;
private String appId = "21469";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354010");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤icon");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboicon");
floorId = String.valueOf(map.get("id"));
Response response = devFloorIconService.selectedList(authorization.hdLoginmabo(),"18740");
Response response = devFloorIconService.selectedList(hdCookies,appId);
List<Map> list = response.jsonPath().getList("data",Map.class);
map = getByName(list,"今日必抢");
if(map!=null){
JSONObject json = new JSONObject();
json.put("appId","18740");
json.put("appId",appId);
json.put("bannerId",map.get("bannerId").toString());
response = devFloorIconService.delIcon(authorization.hdLoginmabo(),json.toJSONString());
response = devFloorIconService.delIcon(hdCookies,json.toJSONString());
}
response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -223,10 +228,10 @@ public class Icon_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
//应用皮肤
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
JSONObject json = new JSONObject();
json.put("appId","18740");
json.put("appId",appId);
json.put("classifySwitch","false");
json.put("iconType","list");
json.put("img","//yun.dui88.com/duibaManagerWeb/dnb7ivbsjr.png");
......@@ -243,12 +248,12 @@ public class Icon_FloorTest extends DuibaTestBase {
json.put("payload","null");
response = devFloorIconService.saveIcon(authorization.hdLoginmabo(),json.toJSONString());
response = devFloorIconService.saveIcon(hdCookies,json.toJSONString());
response.prettyPrint();
Thread.sleep(70000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -261,7 +266,7 @@ public class Icon_FloorTest extends DuibaTestBase {
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
response.prettyPrint();
String s = response.asString();
JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
......@@ -296,7 +301,7 @@ public class Icon_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devFloorIconService.selectedList(authorization.hdLoginmabo(),"18740");
Response response = devFloorIconService.selectedList(hdCookies,appId);
List<Map> list = response.jsonPath().getList("data",Map.class);
Map map = getByTitle(list,"今日必抢");
......@@ -306,7 +311,7 @@ public class Icon_FloorTest extends DuibaTestBase {
bannerId = map.get("bannerId").toString();
JSONObject json = new JSONObject();
json.put("appId","18740");
json.put("appId",appId);
json.put("bannerId",bannerId);
json.put("classifyImage","null");
json.put("classifySwitch","false");
......@@ -316,11 +321,11 @@ public class Icon_FloorTest extends DuibaTestBase {
json.put("sourceRelationId","2");
json.put("title","今日必抢1");
response = devFloorIconService.updateIcon(authorization.hdLoginmabo(),json.toJSONString());
response = devFloorIconService.updateIcon(hdCookies,json.toJSONString());
response.prettyPrint();
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -333,7 +338,7 @@ public class Icon_FloorTest extends DuibaTestBase {
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
response.prettyPrint();
String s = response.asString();
......@@ -353,13 +358,13 @@ public class Icon_FloorTest extends DuibaTestBase {
logger.info(df.format(new Date()));
JSONObject json = new JSONObject();
json.put("appId","18740");
json.put("appId",appId);
json.put("bannerId",bannerId);
Response response = devFloorIconService.delIcon(authorization.hdLoginmabo(),json.toJSONString());
Response response = devFloorIconService.delIcon(hdCookies,json.toJSONString());
response.prettyPrint();
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -389,7 +394,7 @@ public class Icon_FloorTest extends DuibaTestBase {
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -47,15 +47,20 @@ public class Item_FloorTest extends DuibaTestBase {
private String skinId=null;
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4658;
private String appId = "21470";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354011");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤Item");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboItem");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -362,11 +367,11 @@ public class Item_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
Thread.sleep(70000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -378,11 +383,11 @@ public class Item_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
response = devFloorService.itemSelectedList("18740");
response = devFloorService.itemSelectedList(appId);
List<Map> listDev = response.jsonPath().getList("data",Map.class);
JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
......@@ -405,7 +410,7 @@ public class Item_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -43,14 +43,20 @@ public class Seckill_FloorTest extends DuibaTestBase {
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4654;
private String appId = "21471";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354012");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤Sckill");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboSckill");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -805,11 +811,11 @@ public class Seckill_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -821,7 +827,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
String source = s.substring(s.indexOf("{"),s.length()-1);
......@@ -837,9 +843,9 @@ public class Seckill_FloorTest extends DuibaTestBase {
url = getMatcher(url,source,1);
Assert.assertEquals(activityId,"820","");
Assert.assertEquals(image,"//yun.dui88.com/images/201801/7de9zo957y.png","");
Assert.assertEquals(operatingActivityId,"25550","");
Assert.assertEquals(operatingActivityId,"36116","");
Assert.assertTrue(url.contains("//activity.m.duibatest.com.cn/SecondsKillActivity/index?id=25550"));
Assert.assertTrue(url.contains("//activity.m.duibatest.com.cn/SecondsKillActivity/index?id=36116"));
}
......@@ -849,7 +855,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -47,14 +47,19 @@ public class Showcase_FloorTest extends DuibaTestBase {
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4634;
private String appId = "21464";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354005");
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤Showcase");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboShowcase");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -244,11 +249,11 @@ public class Showcase_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -260,14 +265,14 @@ public class Showcase_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
JsonPath jsonPath=from(s.substring(s.indexOf("{"),s.length()-1));
List<Map> list = jsonPath.getList("list",Map.class);
response = devFloorShowcaseService.getShowcaseContent(authorization.hdLoginmabo(),"18740");
response = devFloorShowcaseService.getShowcaseContent(hdCookies,appId);
List<Map> listDev = response.jsonPath().getList("data",Map.class);
//开发者配置和手机端配置校验
......@@ -290,7 +295,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -43,16 +43,21 @@ public class Sign_FloorTest extends DuibaTestBase {
private String floorId=null;
private DuibaLog logger = DuibaLog.getLogger();
private int uid = 4572;
private String appId = "21446";
private Map hdCookies;
@BeforeClass
public void beforeClass(){
try{
hdCookies = authorization.hdLoginCommonNew("13193354004");//authorization.hdLoginmabo();
Map map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_skin where skin_name = ?","mabo楼层皮肤Sign");
skinId = String.valueOf(map.get("id"));
map = jdbc.findSimpleResult("select * from credits_dev.tb_credits_floor_code WHERE floor_name= ?","maboSign");
floorId = String.valueOf(map.get("id"));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response = floorService.deleteFloor(authorization.ssoLogin(),floorId);
......@@ -510,11 +515,11 @@ public class Sign_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740",skinId);
Response response = devSkinService.saveSkin(hdCookies,appId,skinId);
Thread.sleep(60000);
JsonPath jsonCfg = homeService.getCFG(2753);
JsonPath jsonCfg = homeService.getCFG(uid);
Assert.assertEquals(jsonCfg.getList("").size(),1,"banner展示数量和配置不符");
......@@ -526,7 +531,7 @@ public class Sign_FloorTest extends DuibaTestBase {
String floorType = MatcherString.getString(jsonCfg.getList("").get(0).toString(),"floorType=(.*?),",1);
response = homeService.floor(authorization.dafuwengLogin(2753),floorType,dataType,"3",floorId);
response = homeService.floor(authorization.dafuwengLogin(uid),floorType,dataType,"3",floorId);
String s = response.asString();
......@@ -546,7 +551,7 @@ public class Sign_FloorTest extends DuibaTestBase {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
logger.info(df.format(new Date()));
Response response = devSkinService.saveSkin(authorization.hdLoginmabo(),"18740","198");
Response response = devSkinService.saveSkin(hdCookies,appId,"106");
response.prettyPrint();
response = floorService.deleteSkin(authorization.ssoLogin(),skinId,"1");
response.prettyPrint();
......
......@@ -284,6 +284,36 @@ public class Authorization {
}
//取消安全校验
// logger.info(hdCookies);
return hdCookies;
}
//密码为duibaduiba123
public Map hdLoginCommonNew(String account){
String path = "/doLoginNew";
int i=10;
Map<String,String> hdCookies = hdCookiesCommon.get(account);
while((hdCookies==null||hdCookies.size()==0)&&i>0) {
Response token=this.hdGetToken();
String url = PROTOCOL + hdHost + path;
Map<String,String> cookies=token.getCookies();
Map<String, String> paras = new HashMap<>();
paras.put("account", account);
paras.put("password", SecurityUtils.getMD5("Dct7xTdGPvbUL1eOtSWoB9ySZNY="+from(token.asString()).getString("data.loginsToken")));
paras.put("redirect", "/redirectApp");
paras.put("isAutoLogin", "true");
paras.put("validate","22");
Response response = given().cookies(cookies).params(paras).post(url);
response.prettyPrint();
hdCookies=new HashMap<>(response.getCookies());
if(hdCookies==null||hdCookies.size()==0){
hdCookies.remove("csrf_token");
hdCookiesCommon.put(account,hdCookies);
}
i--;
}
//取消安全校验
// logger.info(hdCookies);
return hdCookies;
}
......
......@@ -61,7 +61,7 @@ public class DevFloorIconService {
public Response selectedList(Map cookies, String appId) throws Exception {
JSONObject json = new JSONObject();
json.put("appId","18740");
json.put("appId",appId);
Response response = given().cookies(cookies).contentType(ContentType.JSON).body(json.toJSONString()).post("http://"+hdserverHost+"/devFloorIcon/selectedList");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
......
......@@ -25,7 +25,7 @@ trade.host = activity.m.duibatest.com.cn
db.name = duiba_test
db.password= svbP3KUw2PurAnBb2rbs3vohF
db.url = jdbc:mysql://rdswy2b9wy53044250u1o.mysql.rds.aliyuncs.com:3306/
db.driver= com.mysql.jdbc.Driver
db.driver= com.mysql.cj.jdbc.Driver
db.maxtotal = 6
//\u9489\u9489\u62A5\u544A\u914D\u7F6E
......@@ -39,9 +39,9 @@ signTest.names=zhousongbo
signTest.group=\u7B7E\u5230-\u63A5\u53E3\u81EA\u52A8\u5316
signTest.resultUrl=http://tst.deploy.dui88.com/view/duibaTest/job/duibaSign_interface/HTML_Report/suite1_test1_results.html
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
DuibaTest.project=\u6D3B\u52A8\u5DE5\u5177
......
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