Commit d4c2a34e authored by 吕雯燕's avatar 吕雯燕

lv

parent f4c745a9
...@@ -70,12 +70,21 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{ ...@@ -70,12 +70,21 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
result = new Object[][]{ result = new Object[][]{
new Object[]{1,"[{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"1\",\"show\":true,\"arealimit\":false,\"pronumber\":\"1\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172178,\"name\":\"【勿动】自有优惠券审核通过测试\",\"remaind\":\"100\"},{\"type\":\"object\",\"title\":\"实物\",\"img\":\"//yun.duiba.com.cn/upload/1uF0l1462438316968.png\",\"valid\":true,\"probability\":\"2\",\"show\":true,\"arealimit\":false,\"pronumber\":\"2\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":175491,\"name\":\"【自动化】自有实物19:51:09\",\"remaind\":\"90\"},{\"type\":\"virtual\",\"title\":\"虚拟商品\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/virtual.png\",\"valid\":true,\"probability\":\"3\",\"show\":true,\"arealimit\":false,\"pronumber\":\"3\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":178060,\"value\":\"test\",\"remaind\":\"80\"},{\"type\":\"phonebill\",\"title\":\"话费\",\"img\":\"//yun.duiba.com.cn/upload/AROxS1462438316966.png\",\"valid\":true,\"probability\":\"4\",\"show\":true,\"arealimit\":false,\"pronumber\":\"4\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"remaind\":\"70\"},{\"type\":\"alipay\",\"title\":\"支付宝\",\"img\":\"//yun.duiba.com.cn/upload/KkZMp1462438317113.png\",\"valid\":true,\"probability\":\"5\",\"show\":true,\"arealimit\":false,\"pronumber\":\"5\",\"alipay\":\"\",\"description\":\"\",\"value\":\"1\",\"remaind\":\"60\"},{\"type\":\"qb\",\"title\":\"Q币\",\"img\":\"//yun.duiba.com.cn/upload/mF3wO1462438317114.png\",\"valid\":true,\"probability\":\"6\",\"show\":true,\"arealimit\":false,\"pronumber\":\"6\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"remaind\":\"50\"},{\"type\":\"lucky\",\"title\":\"福袋\",\"img\":\"//yun.duiba.com.cn/webapp/img/luckynewn.png\",\"valid\":true,\"probability\":\"0\",\"show\":false,\"arealimit\":false,\"pronumber\":\"0\",\"alipay\":\"\",\"description\":\"\"}]", new Object[]{1,"[{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"1\",\"show\":true,\"arealimit\":false,\"pronumber\":\"1\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172178,\"name\":\"【勿动】自有优惠券审核通过测试\",\"remaind\":\"100\"},{\"type\":\"object\",\"title\":\"实物\",\"img\":\"//yun.duiba.com.cn/upload/1uF0l1462438316968.png\",\"valid\":true,\"probability\":\"2\",\"show\":true,\"arealimit\":false,\"pronumber\":\"2\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":175491,\"name\":\"【自动化】自有实物19:51:09\",\"remaind\":\"90\"},{\"type\":\"virtual\",\"title\":\"虚拟商品\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/virtual.png\",\"valid\":true,\"probability\":\"3\",\"show\":true,\"arealimit\":false,\"pronumber\":\"3\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":178060,\"value\":\"test\",\"remaind\":\"80\"},{\"type\":\"phonebill\",\"title\":\"话费\",\"img\":\"//yun.duiba.com.cn/upload/AROxS1462438316966.png\",\"valid\":true,\"probability\":\"4\",\"show\":true,\"arealimit\":false,\"pronumber\":\"4\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"remaind\":\"70\"},{\"type\":\"alipay\",\"title\":\"支付宝\",\"img\":\"//yun.duiba.com.cn/upload/KkZMp1462438317113.png\",\"valid\":true,\"probability\":\"5\",\"show\":true,\"arealimit\":false,\"pronumber\":\"5\",\"alipay\":\"\",\"description\":\"\",\"value\":\"1\",\"remaind\":\"60\"},{\"type\":\"qb\",\"title\":\"Q币\",\"img\":\"//yun.duiba.com.cn/upload/mF3wO1462438317114.png\",\"valid\":true,\"probability\":\"6\",\"show\":true,\"arealimit\":false,\"pronumber\":\"6\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"remaind\":\"50\"},{\"type\":\"lucky\",\"title\":\"福袋\",\"img\":\"//yun.duiba.com.cn/webapp/img/luckynewn.png\",\"valid\":true,\"probability\":\"0\",\"show\":false,\"arealimit\":false,\"pronumber\":\"0\",\"alipay\":\"\",\"description\":\"\"}]",
"[{\"index\":null,\"type\":\"text\",\"rightAnswer\":1,\"name\":\"文字题一\",\"option1\":\"文字题一A\",\"option2\":\"文字题一B\",\"option3\":\"文字题一C\",\"option4\":\"文字题一D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"2\",\"name\":\"文字题二\",\"option1\":\"文字题二A\",\"option2\":\"文字题二B\",\"option3\":\"文字题二C\",\"option4\":\"文字题二D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"3\",\"name\":\"文字题三\",\"option1\":\"文字题三A\",\"option2\":\"文字题三B\",\"option3\":\"文字题三C\",\"option4\":\"文字题三D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"4\",\"name\":\"文字题四\",\"option1\":\"文字题四A\",\"option2\":\"文字题四B\",\"option3\":\"文字题四C\",\"option4\":\"文字题四D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":1,\"name\":\"文字题五\",\"option1\":\"文字题五A\",\"option2\":\"文字题五B\",\"option3\":\"文字题五C\",\"option4\":\"文字题五D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"2\",\"name\":\"文字题六\",\"option1\":\"文字题六A\",\"option2\":\"文字题六B\",\"option3\":\"文字题六C\",\"option4\":\"文字题六D\"}]", "[{\"index\":null,\"type\":\"text\",\"rightAnswer\":1,\"name\":\"文字题一\",\"option1\":\"文字题一A\",\"option2\":\"文字题一B\",\"option3\":\"文字题一C\",\"option4\":\"文字题一D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"2\",\"name\":\"文字题二\",\"option1\":\"文字题二A\",\"option2\":\"文字题二B\",\"option3\":\"文字题二C\",\"option4\":\"文字题二D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"3\",\"name\":\"文字题三\",\"option1\":\"文字题三A\",\"option2\":\"文字题三B\",\"option3\":\"文字题三C\",\"option4\":\"文字题三D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"4\",\"name\":\"文字题四\",\"option1\":\"文字题四A\",\"option2\":\"文字题四B\",\"option3\":\"文字题四C\",\"option4\":\"文字题四D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":1,\"name\":\"文字题五\",\"option1\":\"文字题五A\",\"option2\":\"文字题五B\",\"option3\":\"文字题五C\",\"option4\":\"文字题五D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"2\",\"name\":\"文字题六\",\"option1\":\"文字题六A\",\"option2\":\"文字题六B\",\"option3\":\"文字题六C\",\"option4\":\"文字题六D\"}]",
"10","everyday","5","everyday","6","新建自有答题活动-文字题"}, //case 1 "1","10","everyday","5","everyday","6","新建自有答题活动-文字题"}, //case 1
new Object[]{2,"[{\"type\":\"coupon\",\"title\":\"优惠券1\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"1\",\"show\":true,\"arealimit\":false,\"pronumber\":\"1\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券2\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"2\",\"show\":true,\"arealimit\":false,\"pronumber\":\"2\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172163,\"name\":\"【勿动】兑吧优惠券定向库存不足\",\"remaind\":\"60\"},{\"type\":\"coupon\",\"title\":\"优惠券3\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"3\",\"show\":true,\"arealimit\":false,\"pronumber\":\"3\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":185571,\"name\":\"【自动化】自有优惠券成功页跳转链接 兑换成功后页面没有跳转按钮 以及点击入口\",\"remaind\":\"30\"}]", new Object[]{2,"[{\"type\":\"coupon\",\"title\":\"优惠券1\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"1\",\"show\":true,\"arealimit\":false,\"pronumber\":\"1\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券2\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"2\",\"show\":true,\"arealimit\":false,\"pronumber\":\"2\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172163,\"name\":\"【勿动】兑吧优惠券定向库存不足\",\"remaind\":\"60\"},{\"type\":\"coupon\",\"title\":\"优惠券3\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"3\",\"show\":true,\"arealimit\":false,\"pronumber\":\"3\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":185571,\"name\":\"【自动化】自有优惠券成功页跳转链接 兑换成功后页面没有跳转按钮 以及点击入口\",\"remaind\":\"30\"}]",
"[{\"index\":null,\"type\":\"image\",\"rightAnswer\":1,\"name\":\"图片题1\",\"option1\":\"//yun.dui88.com/images/201811/0tg3occ8ft.png\",\"option2\":\"//yun.dui88.com/images/201811/7avinswhbx.png\",\"option3\":\"//yun.dui88.com/images/201811/wpivlzrt5x.png\",\"option4\":\"//yun.dui88.com/images/201811/omk617xseb.png\"},{\"index\":null,\"type\":\"image\",\"rightAnswer\":1,\"name\":\"图片题2\",\"option1\":\"//yun.dui88.com/images/201811/x7ukissn3k.png\",\"option2\":\"//yun.dui88.com/images/201811/3g81rrei8x.png\",\"option3\":\"//yun.dui88.com/images/201811/m16yaakc6u.png\",\"option4\":\"//yun.dui88.com/images/201811/kodb08cqi3.png\"},{\"index\":null,\"type\":\"image\",\"rightAnswer\":1,\"name\":\"图片题3\",\"option1\":\"//yun.dui88.com/images/201811/au84gljudk.png\",\"option2\":\"//yun.dui88.com/images/201811/vt9wfrnefk.png\",\"option3\":\"//yun.dui88.com/images/201811/tzplflmd8e.png\",\"option4\":\"//yun.dui88.com/images/201811/n5odjivu2j.png\"}]", "[{\"index\":null,\"type\":\"image\",\"rightAnswer\":1,\"name\":\"图片题1\",\"option1\":\"//yun.dui88.com/images/201811/0tg3occ8ft.png\",\"option2\":\"//yun.dui88.com/images/201811/7avinswhbx.png\",\"option3\":\"//yun.dui88.com/images/201811/wpivlzrt5x.png\",\"option4\":\"//yun.dui88.com/images/201811/omk617xseb.png\"},{\"index\":null,\"type\":\"image\",\"rightAnswer\":1,\"name\":\"图片题2\",\"option1\":\"//yun.dui88.com/images/201811/x7ukissn3k.png\",\"option2\":\"//yun.dui88.com/images/201811/3g81rrei8x.png\",\"option3\":\"//yun.dui88.com/images/201811/m16yaakc6u.png\",\"option4\":\"//yun.dui88.com/images/201811/kodb08cqi3.png\"},{\"index\":null,\"type\":\"image\",\"rightAnswer\":1,\"name\":\"图片题3\",\"option1\":\"//yun.dui88.com/images/201811/au84gljudk.png\",\"option2\":\"//yun.dui88.com/images/201811/vt9wfrnefk.png\",\"option3\":\"//yun.dui88.com/images/201811/tzplflmd8e.png\",\"option4\":\"//yun.dui88.com/images/201811/n5odjivu2j.png\"}]",
"5","forever","20","forever","3","新建自有答题活动-图片题"},//case 2 "1","5","forever","20","forever","3","新建自有答题活动-图片题"},//case 2
};
}else
if(method.getName().equals("新建自有答题独立活动")){
result = new Object[][]{
new Object[]{1,"[{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"1\",\"show\":true,\"arealimit\":false,\"pronumber\":\"1\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172178,\"name\":\"【勿动】自有优惠券审核通过测试\",\"remaind\":\"100\"},{\"type\":\"object\",\"title\":\"实物\",\"img\":\"//yun.duiba.com.cn/upload/1uF0l1462438316968.png\",\"valid\":true,\"probability\":\"2\",\"show\":true,\"arealimit\":false,\"pronumber\":\"2\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":175491,\"name\":\"【自动化】自有实物19:51:09\",\"remaind\":\"50\"},{\"type\":\"virtual\",\"title\":\"虚拟商品\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/virtual.png\",\"valid\":true,\"probability\":\"3\",\"show\":true,\"arealimit\":false,\"pronumber\":\"3\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159849,\"value\":\"DUIBA_SELF\",\"remaind\":\"10\"}]",
"[{\"index\":null,\"type\":\"text\",\"rightAnswer\":1,\"name\":\"文字题1\",\"option1\":\"文字题1A\",\"option2\":\"文字题1B\",\"option3\":\"文字题1C\",\"option4\":\"文字题1D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"2\",\"name\":\"文字题2\",\"option1\":\"文字题2A\",\"option2\":\"文字题2B\",\"option3\":\"文字题2C\",\"option4\":\"文字题2D\"},{\"index\":null,\"type\":\"text\",\"rightAnswer\":\"3\",\"name\":\"文字题3\",\"option1\":\"文字题3A\",\"option2\":\"文字题3B\",\"option3\":\"文字题3C\",\"option4\":\"文字题3D\"}]",
"0","","everyday","12","everyday","3","新建自有答题独立活动-文字题"}, //case1
}; };
} }
return result; return result;
} }
...@@ -297,6 +306,7 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{ ...@@ -297,6 +306,7 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
* @param caseNum 用例编号 * @param caseNum 用例编号
* @param awards 奖品 * @param awards 奖品
* @param questionRecord 题目 * @param questionRecord 题目
* @param creditsType 活动模式
* @param freeLimit 免费次数 * @param freeLimit 免费次数
* @param freeScope 免费次数类型 * @param freeScope 免费次数类型
* @param limitCount 限制次数 * @param limitCount 限制次数
...@@ -306,14 +316,14 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{ ...@@ -306,14 +316,14 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
* @throws Exception * @throws Exception
*/ */
@Test(dataProvider = "providerMethod") @Test(dataProvider = "providerMethod")
public void 新建自有答题活动(int caseNum,String awards,String questionRecord,String freeLimit,String freeScope,String limitCount,String limitScope,String optionNum,String caseName) throws Exception{ public void 新建自有答题活动(int caseNum,String awards,String questionRecord,String creditsType,String freeLimit,String freeScope,String limitCount,String limitScope,String optionNum,String caseName) throws Exception{
logger.info("-----------------------------"+caseName+"-----------------------------"); logger.info("-----------------------------"+caseName+"-----------------------------");
String data = PublicMethod.data(); String data = PublicMethod.data();
String title = "【自动化】自有答题活动"+data; String title = "【自动化】自有答题活动"+data;
//新建自有手动开奖 //新建自有答题活动
developerService.saveQuestion(title,awards,questionRecord,freeLimit,freeScope,limitCount,limitScope,optionNum); developerService.saveQuestion(title,awards,questionRecord,creditsType,freeLimit,freeScope,limitCount,limitScope,optionNum);
//获取活动id //获取活动id
Response listResponse = developerService.list2(title); Response listResponse = developerService.list2(title);
...@@ -355,6 +365,63 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{ ...@@ -355,6 +365,63 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
} }
/**
* @param caseNum 用例编号
* @param awards 奖品
* @param questionRecord 题目
* @param creditsType 活动模式
* @param freeLimit 免费次数
* @param freeScope 免费次数类型
* @param limitCount 限制次数
* @param limitScope 限制次数类型
* @param optionNum 题目数
* @param caseName 用例名称
* @throws Exception
*/
// @Test(dataProvider = "providerMethod")
public void 新建自有答题独立活动(int caseNum,String awards,String questionRecord,String creditsType,String freeLimit,String freeScope,String limitCount,String limitScope,String optionNum,String caseName) throws Exception{
logger.info("-----------------------------"+caseName+"-----------------------------");
String data = PublicMethod.data();
String title = "【自动化】自有答题独立活动"+data;
//新建自有答题活动
developerService.saveQuestion(title,awards,questionRecord,creditsType,freeLimit,freeScope,limitCount,limitScope,optionNum);
//获取活动id
Response listResponse = developerService.list2(title);
String id = String.valueOf(listResponse.jsonPath().getString("data.list[0].id"));
//编辑活动,校验活动内容
Response editResponse = developerService.editQuestion(id);
switch (caseNum){
case 1:
Assert.assertEquals(editResponse.jsonPath().getString("data.creditsType"),"0","校验活动积分类型失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.freeLimit"),"12","校验活动免费次数失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.limitCount"),"12","校验活动限制次数失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.limitScope"),"everyday","校验活动限制类型失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.mode"),"free","校验活动模式失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.questionRecord[1].name"),"文字题2","校验活动题目名称失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.questionRecord[1].type"),"text","校验活动题目类型失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.awards[1].name"),"【自动化】自有实物19:51:09","校验活动奖品名称失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.awards[1].probability"),"2","校验活动奖品获奖资格失败");
logger.info("校验新建自有答题独立活动-1内容成功");
break;
case 2:
break;
}
//删除测试数据
this.删除自有活动(title);
}
//删除自有活动 //删除自有活动
public void 删除自有活动(String title) throws Exception{ public void 删除自有活动(String title) throws Exception{
......
...@@ -1111,7 +1111,7 @@ public class DeveloperService { ...@@ -1111,7 +1111,7 @@ public class DeveloperService {
} }
//保存自有答题活动--所有字段 //保存自有答题活动--所有字段
public Response saveQuestion(String title,String awards,String questionRecord,String freeLimit,String freeScope,String limitCount,String limitScope,String optionNum) throws Exception { public Response saveQuestion(String title,String awards,String questionRecord,String creditsType,String freeLimit,String freeScope,String limitCount,String limitScope,String optionNum) throws Exception {
String url=hdHost+"/question/save"; String url=hdHost+"/question/save";
...@@ -1122,7 +1122,7 @@ public class DeveloperService { ...@@ -1122,7 +1122,7 @@ public class DeveloperService {
map.put("awards",awards); map.put("awards",awards);
map.put("questionRecord",questionRecord); map.put("questionRecord",questionRecord);
map.put("credits","22"); map.put("credits","22");
map.put("creditsType","1"); map.put("creditsType",creditsType);
map.put("banner","//yun.duiba.com.cn/upload/S2T4p1474356849960.png"); map.put("banner","//yun.duiba.com.cn/upload/S2T4p1474356849960.png");
map.put("thumbnail","//yun.duiba.com.cn/upload/ljoka1474356876322.png"); map.put("thumbnail","//yun.duiba.com.cn/upload/ljoka1474356876322.png");
map.put("bannerImgNew","//yun.duiba.com.cn/upload/qzfsmsyo9s.png"); map.put("bannerImgNew","//yun.duiba.com.cn/upload/qzfsmsyo9s.png");
......
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