Commit 2d8f4211 authored by 吕雯燕's avatar 吕雯燕

Merge branch 'master' into duiba_wenyan

parents a1da9b1f 4da13022
...@@ -261,7 +261,7 @@ public class 自有_自有活动出奖 extends DuibaTestBase { ...@@ -261,7 +261,7 @@ public class 自有_自有活动出奖 extends DuibaTestBase {
String coupon_code = response.jsonPath().getString("data.lottery.coupon_code"); String coupon_code = response.jsonPath().getString("data.lottery.coupon_code");
String coupon_key = response.jsonPath().getString("data.lottery.coupon_key"); String coupon_key = response.jsonPath().getString("data.lottery.coupon_key");
Assert.assertEquals(id,"15810","id不正确"); Assert.assertEquals(id,"36248","id不正确");
Assert.assertTrue(link.contains("//activity.m.duibatest.com.cn/crecord/recordDetailNew?orderId="),"link不正确"); Assert.assertTrue(link.contains("//activity.m.duibatest.com.cn/crecord/recordDetailNew?orderId="),"link不正确");
Assert.assertEquals(title,"【自动化】优惠券-普通","title不正确"); Assert.assertEquals(title,"【自动化】优惠券-普通","title不正确");
Assert.assertEquals(type,"coupon","type不正确"); Assert.assertEquals(type,"coupon","type不正确");
......
...@@ -50,8 +50,8 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe ...@@ -50,8 +50,8 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
public void clearDb() { public void clearDb() {
try { try {
//清除用户参与活动次数(活动id:19127) //清除用户参与活动次数(活动id:19127)
Boolean clearResult8 = jdbc.update("delete from ckvtable.tb_kvtable_0687 where consumer_id = 100025007 and vkey = 'activity-centerjoinNum_100025007_19933'",null); Boolean clearResult8 = jdbc.update("delete from ckvtable.tb_kvtable_0188 where consumer_id = 100176060 and vkey = 'activity-centerjoinNum_100176060_19933'",null);
Boolean clearResult9 = jdbc.update("delete from ckvtable.tb_kvtable_0656 where consumer_id = 100026000 and vkey = 'activity-centerjoinNum_100026000_19933'",null); Boolean clearResult9 = jdbc.update("delete from ckvtable.tb_kvtable_0188 where consumer_id = 100176060 and vkey = 'activity-centerjoinNum_100176060_19933'",null);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -62,11 +62,11 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe ...@@ -62,11 +62,11 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
try { try {
//清除自定义活动-中奖奖品数量信息(12851) //清除自定义活动-中奖奖品数量信息(12851)
Boolean clearResult1 = jdbc.update("delete from ckvtable.tb_kvtable_0687 where consumer_id = 100025007 and vkey = 'activity-centerwinOptionNum_100025007_19933_hdtool14153'",null); Boolean clearResult1 = jdbc.update("delete from ckvtable.tb_kvtable_0188 where consumer_id = 100176060 and vkey = 'activity-centerwinOptionNum_100176060_19933_hdtool14153'",null);
//清除集卡规则n等级奖项-中奖次数(集卡规则id:9_1) //清除集卡规则n等级奖项-中奖次数(集卡规则id:9_1)
Boolean clearResult2 = jdbc.update("delete from ckvtable.tb_kvtable_0687 where consumer_id = 100025007 and vkey = 'cl_good_cid_Crule_grade_100025007_243_1'",null); Boolean clearResult2 = jdbc.update("delete from ckvtable.tb_kvtable_0188 where consumer_id = 100176060 and vkey = 'cl_good_cid_Crule_grade_100176060_243_1'",null);
//清除收集的集卡商品数量(集卡商品id:27160) //清除收集的集卡商品数量(集卡商品id:27160)
Boolean clearResult3 = jdbc.update("delete from ckvtable.tb_kvtable_0687 where consumer_id = 100025007 and vkey = 'cl_good_cid_itemId_100025007_27217'",null); Boolean clearResult3 = jdbc.update("delete from ckvtable.tb_kvtable_0188 where consumer_id = 100176060 and vkey = 'cl_good_cid_itemId_100176060_27217'",null);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -90,12 +90,12 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe ...@@ -90,12 +90,12 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
for(int i=0;i<2;i++) { for(int i=0;i<2;i++) {
if(i==0){ if(i==0){
for (int j=0;j<2;j++){ for (int j=0;j<2;j++){
Response response = playNewActivityResult("19933", "r3oq9gqkf", "243",2720); Response response = playNewActivityResult("19933", "r3oq9gqkf", "243",7504);
Assert.assertEquals(String.valueOf(response.jsonPath().getString("lottery.type")), "collectGoods", "校验中奖类型失败"); Assert.assertEquals(String.valueOf(response.jsonPath().getString("lottery.type")), "collectGoods", "校验中奖类型失败");
logger.info("校验自定义中奖奖项信息成功,自定义活动游戏中奖奖品类型" + response.jsonPath().getString("lottery.type")); logger.info("校验自定义中奖奖项信息成功,自定义活动游戏中奖奖品类型" + response.jsonPath().getString("lottery.type"));
} }
//集卡结束后开奖--开奖类型:直接开奖 //集卡结束后开奖--开奖类型:直接开奖
Response openResponse = playCollectResult("243", "19933",2720); Response openResponse = playCollectResult("243", "19933",7504);
Assert.assertEquals(openResponse.jsonPath().getString("lottery.title"), cLReward.getRlName(), "校验奖项失败"); Assert.assertEquals(openResponse.jsonPath().getString("lottery.title"), cLReward.getRlName(), "校验奖项失败");
Assert.assertEquals(openResponse.jsonPath().getString("lottery.type"), cLReward.getRlType(), "校验奖项失败"); Assert.assertEquals(openResponse.jsonPath().getString("lottery.type"), cLReward.getRlType(), "校验奖项失败");
logger.info("校验集卡活动开奖奖项信息成功,奖品信息为:" + openResponse.jsonPath().getString("lottery.title")); logger.info("校验集卡活动开奖奖项信息成功,奖品信息为:" + openResponse.jsonPath().getString("lottery.title"));
...@@ -103,13 +103,13 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe ...@@ -103,13 +103,13 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
}else if(i==1){ }else if(i==1){
for (int j=0;j<2;j++){ for (int j=0;j<2;j++){
if (j==0){ if (j==0){
Response response = playNewActivityResult("19933", "r3oq9gqkf", "243",2720); Response response = playNewActivityResult("19933", "r3oq9gqkf", "243",7504);
Assert.assertEquals(String.valueOf(response.jsonPath().getString("lottery.type")), "collectGoods", "校验中奖类型失败"); Assert.assertEquals(String.valueOf(response.jsonPath().getString("lottery.type")), "collectGoods", "校验中奖类型失败");
logger.info("校验自定义中奖奖项信息成功,自定义活动游戏中奖奖品类型" + response.jsonPath().getString("lottery.type")); logger.info("校验自定义中奖奖项信息成功,自定义活动游戏中奖奖品类型" + response.jsonPath().getString("lottery.type"));
}else if (j==1){ }else if (j==1){
//第二次中谢谢参与,开奖不满足中奖条件 //第二次中谢谢参与,开奖不满足中奖条件
Response response = playNewActivityResult("19933", "r3oq9gqkf", "243",2720); Response response = playNewActivityResult("19933", "r3oq9gqkf", "243",7504);
String type = String.valueOf(response.jsonPath().getString("lottery.type")); String type = String.valueOf(response.jsonPath().getString("lottery.type"));
Assert.assertTrue((type.contains("thanks"))||(type.contains("lucky"))); Assert.assertTrue((type.contains("thanks"))||(type.contains("lucky")));
logger.info("校验中奖谢谢参与成功,奖项类型为" + response.jsonPath().getString("lottery.type")); logger.info("校验中奖谢谢参与成功,奖项类型为" + response.jsonPath().getString("lottery.type"));
...@@ -130,12 +130,12 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe ...@@ -130,12 +130,12 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
String awardsType = awardResponse.jsonPath().getString("data.config.rewards[0].rlType"); String awardsType = awardResponse.jsonPath().getString("data.config.rewards[0].rlType");
for (int i=0;i<2;i++){ for (int i=0;i<2;i++){
Response response = playNewActivityResult1("19929", "r3oq9gqkf", "239",2720); Response response = playNewActivityResult1("19929", "r3oq9gqkf", "239",7504);
//校验中奖结果类型 //校验中奖结果类型
Assert.assertEquals(String.valueOf(response.jsonPath().getString("lottery.type")), "collectGoods", "校验中奖类型失败"); Assert.assertEquals(String.valueOf(response.jsonPath().getString("lottery.type")), "collectGoods", "校验中奖类型失败");
logger.info("校验中奖类型成功,自定义活动游戏中奖奖品类型为" + response.jsonPath().getString("lottery.type")); logger.info("校验中奖类型成功,自定义活动游戏中奖奖品类型为" + response.jsonPath().getString("lottery.type"));
Response openResponse = playCollectResult("239", "19929",2720); Response openResponse = playCollectResult("239", "19929",7504);
Assert.assertEquals(openResponse.jsonPath().getString("lottery.title"), awardsName, "校验奖项失败"); Assert.assertEquals(openResponse.jsonPath().getString("lottery.title"), awardsName, "校验奖项失败");
Assert.assertEquals(openResponse.jsonPath().getString("lottery.type"), awardsType, "校验奖项失败"); Assert.assertEquals(openResponse.jsonPath().getString("lottery.type"), awardsType, "校验奖项失败");
logger.info("校验活动中奖信息name和type成功,奖品信息为:" + openResponse.jsonPath().getString("lottery.title")); logger.info("校验活动中奖信息name和type成功,奖品信息为:" + openResponse.jsonPath().getString("lottery.title"));
......
...@@ -156,7 +156,7 @@ public class CustomActivity_DuibaTest extends DuibaTestBase { ...@@ -156,7 +156,7 @@ public class CustomActivity_DuibaTest extends DuibaTestBase {
break; break;
} }
Thread.sleep(1000);
} }
...@@ -249,19 +249,25 @@ public class CustomActivity_DuibaTest extends DuibaTestBase { ...@@ -249,19 +249,25 @@ public class CustomActivity_DuibaTest extends DuibaTestBase {
//活动抽奖接口传参单独抽离 //活动抽奖接口传参单独抽离
public Response 自定义答题活动抽奖(String activityId, String token, String device) throws Exception { public Response 自定义答题活动抽奖(String activityId, String token, String device) throws Exception {
Response response = newActivityService.doJoin2(activityId, token); Response response = newActivityService.doJoin2(7496,activityId, token);
response.prettyPrint(); response.prettyPrint();
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
newActivityService.submit(orderId); newActivityService.submit(7496,orderId);
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId, device); response = newActivityService.getOrderStatus2(7496,orderId, device);
String result = String.valueOf(response.jsonPath().getString("result")); String result = String.valueOf(response.jsonPath().getString("result"));
int i = 8; int i = 3;
while (i > 0 && (result.equals("0"))) { // while (i > 0 && (result.equals("0"))) {
// Thread.sleep(1000);
// response = newActivityService.getOrderStatus2(7496,orderId, device);
// result = String.valueOf(response.jsonPath().getString("result"));
// i--;
// response.prettyPrint();
// }
while (i > 0 ) {
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId, device); response = newActivityService.getOrderStatus2(7496,orderId, device);
result = String.valueOf(response.jsonPath().getString("result"));
i--; i--;
response.prettyPrint(); response.prettyPrint();
} }
......
...@@ -17,7 +17,7 @@ import org.testng.annotations.Test; ...@@ -17,7 +17,7 @@ import org.testng.annotations.Test;
/** /**
* Created by zhaoran on 2018/3/15. * Created by zhaoran on 2018/3/15.
*/ */
public class 创建自有活动_DuibaTest extends DuibaTestBase { public class 创建自有活动 extends DuibaTestBase {
@Autowired @Autowired
SigninService signinService; SigninService signinService;
@Autowired @Autowired
......
...@@ -34,15 +34,15 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -34,15 +34,15 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900849714500524"); Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900849714500524");
long remaining = (long)map.get("stock"); long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("21803","h5ps61"); Response response = newActivityService.doJoin2(7505 ,"21803","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
response.print(); response.print();
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
response.print(); response.print();
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
...@@ -67,34 +67,34 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -67,34 +67,34 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
//领奖操作 //领奖操作
String recordId = MatcherString.getString(response.asString(), "recordId=(.*?)&", 1); String recordId = MatcherString.getString(response.asString(), "recordId=(.*?)&", 1);
response = newActivityService.doTakePrize(2720,type, recordId); response = newActivityService.doTakePrize(7505,type, recordId);
Assert.assertEquals(response.jsonPath().getString("message"), "领奖成功"); Assert.assertEquals(response.jsonPath().getString("message"), "领奖成功");
logger.info("结果:" + type + "领奖流程成功"); logger.info("结果:" + type + "领奖流程成功");
//校验领奖后的订单状态 //校验领奖后的订单状态
Map<String, Object> selectResult = jdbc.findSimpleResult("select * from credits_hdtool.hdtool_orders_0687 where id = '"+orderId+"'"); Map<String, Object> selectResult = jdbc.findSimpleResult("select * from credits_hdtool.hdtool_orders_0189 where id = '"+orderId+"'");
String main_orderId = String.valueOf(selectResult.get("main_order_num")); String main_orderId = String.valueOf(selectResult.get("main_order_num"));
logger.info("主订单为:"+main_orderId); logger.info("主订单为:"+main_orderId);
Map<String, Object> selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"' "); Map<String, Object> selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"' ");
String flowWork = String.valueOf(selectResult2.get("flowwork_stage")); String flowWork = String.valueOf(selectResult2.get("flowwork_stage"));
logger.info("领奖后数据库订单节点:"+flowWork); logger.info("领奖后数据库订单节点:"+flowWork);
int j =10; int j =10;
while (j > 0 && !flowWork.equals("SupplierExchange-started")) { while (j > 0 && !flowWork.equals("SupplierExchange-started")) {
Thread.sleep(300); Thread.sleep(300);
selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"' "); selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"' ");
flowWork = String.valueOf(selectResult2.get("flowwork_stage")); flowWork = String.valueOf(selectResult2.get("flowwork_stage"));
logger.info("领奖后数据库订单节点:" + flowWork); logger.info("领奖后数据库订单节点:" + flowWork);
j--; j--;
} }
Assert.assertEquals(flowWork,"SupplierExchange-started","数据库主订单流程节点校验失败"); Assert.assertEquals(flowWork,"SupplierExchange-started","数据库主订单流程节点校验失败");
Assert.assertEquals(String.valueOf(selectResult2.get("biz_params")),"胡梦新:18258853242:浙江省:杭州市:西湖区:西溪街道:数娱大厦 ","数据库主订单biz_params校验失败"); Assert.assertEquals(String.valueOf(selectResult2.get("biz_params")),"胡梦新:18258853242:浙江省:杭州市:西湖区:西溪街道:数娱大厦","数据库主订单biz_params校验失败");
Assert.assertEquals(String.valueOf(selectResult2.get("pay_status")),"none","数据库主订单pay_status校验失败"); Assert.assertEquals(String.valueOf(selectResult2.get("pay_status")),"none","数据库主订单pay_status校验失败");
Assert.assertEquals(String.valueOf(selectResult2.get("status")),"consume_success","数据库主订单status校验失败"); Assert.assertEquals(String.valueOf(selectResult2.get("status")),"consume_success","数据库主订单status校验失败");
//发货操作 //发货操作
Map<String, Object> selectResult3 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"' "); Map<String, Object> selectResult3 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"' ");
String orderId_send = String.valueOf(selectResult3.get("supplier_order_id")); String orderId_send = String.valueOf(selectResult3.get("supplier_order_id"));
logger.info("发货订单为:"+orderId_send); logger.info("发货订单为:"+orderId_send);
...@@ -103,14 +103,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -103,14 +103,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
logger.info("自有实物发货订单成功"); logger.info("自有实物发货订单成功");
//校验发货后的订单状态 //校验发货后的订单状态
selectResult3 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"'"); selectResult3 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"'");
String flowWork2 = String.valueOf(selectResult3.get("flowwork_stage")); String flowWork2 = String.valueOf(selectResult3.get("flowwork_stage"));
logger.info("发货后数据库订单节点:"+flowWork2); logger.info("发货后数据库订单节点:"+flowWork2);
int k =10; int k =10;
while (k > 0 && !flowWork2.equals("Success-complete")) { while (k > 0 && !flowWork2.equals("Success-complete")) {
Thread.sleep(1000); Thread.sleep(1000);
selectResult3 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"' "); selectResult3 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"' ");
flowWork2 = String.valueOf(selectResult3.get("flowwork_stage")); flowWork2 = String.valueOf(selectResult3.get("flowwork_stage"));
logger.info("发货后数据库订单节点:" + flowWork2); logger.info("发货后数据库订单节点:" + flowWork2);
k--; k--;
...@@ -121,14 +121,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -121,14 +121,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test(description = "出奖及订单校验") @Test(description = "出奖及订单校验")
public void 出奖自有优惠券() throws Exception { public void 出奖自有优惠券() throws Exception {
Response response = newActivityService.doJoin2("21792","h5ps61"); Response response = newActivityService.doJoin2(7505,"21792","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
...@@ -145,20 +145,20 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -145,20 +145,20 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Assert.assertTrue(link.contains("//activity.m.duibatest.com.cn/crecord/recordDetailNew?orderId="),"link不正确"); Assert.assertTrue(link.contains("//activity.m.duibatest.com.cn/crecord/recordDetailNew?orderId="),"link不正确");
Assert.assertEquals(title,"【自动化勿动】zr自有优惠券","title不正确"); Assert.assertEquals(title,"【自动化勿动】zr自有优惠券","title不正确");
Assert.assertEquals(type,"coupon","type不正确"); Assert.assertEquals(type,"coupon","type不正确");
Assert.assertEquals(coupon_code,"123123123","coupon_code不正确"); Assert.assertEquals(coupon_code,"dasdasdsadsad","coupon_code不正确");
Assert.assertEquals(coupon_key,"123123","coupon_key不正确"); Assert.assertEquals(coupon_key,"12312321","coupon_key不正确");
Map<String, Object> selectResult = jdbc.findSimpleResult("select * from credits_hdtool.hdtool_orders_0687 where id = '"+orderId+"' ",null); Map<String, Object> selectResult = jdbc.findSimpleResult("select * from credits_hdtool.hdtool_orders_0189 where id = '"+orderId+"' ",null);
logger.info("主订单为:"+selectResult.get("main_order_num")); logger.info("主订单为:"+selectResult.get("main_order_num"));
String main_orderId = String.valueOf(selectResult.get("main_order_num")); String main_orderId = String.valueOf(selectResult.get("main_order_num"));
Map<String, Object> selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"' "); Map<String, Object> selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"' ");
logger.info("数据库订单节点:"+selectResult2.get("flowwork_stage")); logger.info("数据库订单节点:"+selectResult2.get("flowwork_stage"));
String flowWork = String.valueOf(selectResult2.get("flowwork_stage")); String flowWork = String.valueOf(selectResult2.get("flowwork_stage"));
int j =10; int j =10;
while (j > 0 && !flowWork.equals("Success-complete")) { while (j > 0 && !flowWork.equals("Success-complete")) {
Thread.sleep(300); Thread.sleep(300);
selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0687 where order_num = '"+main_orderId+"' "); selectResult2 = jdbc.findSimpleResult("select * from orders_consumer.orders_0189 where order_num = '"+main_orderId+"' ");
flowWork = String.valueOf(selectResult2.get("flowwork_stage")); flowWork = String.valueOf(selectResult2.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork); logger.info("数据库订单节点:" + flowWork);
j--; j--;
...@@ -171,14 +171,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -171,14 +171,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900860200070105"); Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900860200070105");
long remaining = (long)map.get("stock"); long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("21793","h5ps61"); Response response = newActivityService.doJoin2(7505,"21793","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
...@@ -207,14 +207,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -207,14 +207,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public void 出奖兑吧实物() throws Exception { public void 出奖兑吧实物() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900440770170322 "); Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900440770170322 ");
long remaining = (long)map.get("stock"); long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("22637","h5ps61"); Response response = newActivityService.doJoin2(7505,"22637","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
response.prettyPeek(); response.prettyPeek();
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
...@@ -241,17 +241,18 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -241,17 +241,18 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test @Test
public void 出奖兑吧优惠券() throws Exception { public void 出奖兑吧优惠券() throws Exception {
Response response = newActivityService.doJoin2("22636","h5ps61"); Response response = newActivityService.doJoin2(7505,"22636","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
response.prettyPrint();
String id = response.jsonPath().getString("lottery.id"); String id = response.jsonPath().getString("lottery.id");
String imgurl = response.jsonPath().getString("lottery.imgurl"); String imgurl = response.jsonPath().getString("lottery.imgurl");
...@@ -261,7 +262,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -261,7 +262,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
String coupon_code = response.jsonPath().getString("lottery.coupon_code"); String coupon_code = response.jsonPath().getString("lottery.coupon_code");
String coupon_key = response.jsonPath().getString("lottery.coupon_key"); String coupon_key = response.jsonPath().getString("lottery.coupon_key");
Assert.assertEquals(id,"15810","id不正确"); Assert.assertEquals(id,"36248","id不正确");
Assert.assertTrue(link.contains("//activity.m.duibatest.com.cn/crecord/recordDetailNew?orderId="),"link不正确"); Assert.assertTrue(link.contains("//activity.m.duibatest.com.cn/crecord/recordDetailNew?orderId="),"link不正确");
Assert.assertEquals(title,"【自动化】优惠券-普通","title不正确"); Assert.assertEquals(title,"【自动化】优惠券-普通","title不正确");
Assert.assertEquals(type,"coupon","type不正确"); Assert.assertEquals(type,"coupon","type不正确");
...@@ -269,14 +270,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -269,14 +270,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test @Test
public void 出奖话费() throws Exception { public void 出奖话费() throws Exception {
Response response = newActivityService.doJoin2("22647","h5ps61"); Response response = newActivityService.doJoin2(7505,"22647","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
...@@ -296,14 +297,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -296,14 +297,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test @Test
public void 出奖支付宝() throws Exception { public void 出奖支付宝() throws Exception {
Response response = newActivityService.doJoin2("22648","h5ps61"); Response response = newActivityService.doJoin2(7505,"22648","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
...@@ -323,14 +324,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -323,14 +324,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test @Test
public void 出奖Q() throws Exception { public void 出奖Q() throws Exception {
Response response = newActivityService.doJoin2("22649","h5ps61"); Response response = newActivityService.doJoin2(7505,"22649","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
...@@ -350,14 +351,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase { ...@@ -350,14 +351,14 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test @Test
public void 出奖福袋() throws Exception { public void 出奖福袋() throws Exception {
Response response = newActivityService.doJoin2("22651","h5ps61"); Response response = newActivityService.doJoin2(7505,"22651","h5ps61");
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
String result = response.jsonPath().getString("result"); String result = response.jsonPath().getString("result");
int i = 30; int i = 30;
while(i>0&&result.equals("0")){ while(i>0&&result.equals("0")){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId); response = newActivityService.getOrderStatus2(7505,orderId);
result = response.jsonPath().getString("result"); result = response.jsonPath().getString("result");
i--; i--;
} }
......
...@@ -287,6 +287,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet { ...@@ -287,6 +287,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
Map<String, String> map = authorization.dafuwengLogin(uid); Map<String, String> map = authorization.dafuwengLogin(uid);
Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "活动详情页请求异常"); Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "活动详情页请求异常");
Thread.sleep(5000);
//实物兑换 //实物兑换
response = couponExchangeService.objectExchange(map, "161100", null, "null", "yrJRr7Cddp2YeQd", "null"); response = couponExchangeService.objectExchange(map, "161100", null, "null", "yrJRr7Cddp2YeQd", "null");
// response.prettyPrint(); // response.prettyPrint();
...@@ -307,6 +308,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet { ...@@ -307,6 +308,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
message = response.jsonPath().getString("data.message"); message = response.jsonPath().getString("data.message");
i--; i--;
} }
Thread.sleep(2000);
//查询数据库,获取当前积分 //查询数据库,获取当前积分
mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid); mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid);
String creditsNew = String.valueOf(mapuser.get("credits")); String creditsNew = String.valueOf(mapuser.get("credits"));
...@@ -344,6 +346,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet { ...@@ -344,6 +346,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
String credits = String.valueOf(mapuser.get("credits")); String credits = String.valueOf(mapuser.get("credits"));
logger.info("兑换前积分:" + credits); //扣去100积分 logger.info("兑换前积分:" + credits); //扣去100积分
credits = String.valueOf(Integer.valueOf(credits) - 1); credits = String.valueOf(Integer.valueOf(credits) - 1);
Thread.sleep(5000);
//优惠券兑换 //优惠券兑换
Response response = couponExchangeService.couponExchange(authorization.dafuwengLogin(uid), "159857", null); Response response = couponExchangeService.couponExchange(authorization.dafuwengLogin(uid), "159857", null);
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
...@@ -361,6 +364,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet { ...@@ -361,6 +364,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
i--; i--;
} }
Thread.sleep(3000);
response.prettyPrint(); response.prettyPrint();
//查询数据库,获取当前积分 //查询数据库,获取当前积分
mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid); mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid);
......
...@@ -138,6 +138,7 @@ public class Qb_兑换限制测试_ExchangeTest extends CheckTemplet { ...@@ -138,6 +138,7 @@ public class Qb_兑换限制测试_ExchangeTest extends CheckTemplet {
public void 用户每月兑换限制() throws Exception { public void 用户每月兑换限制() throws Exception {
int uid = 7478; int uid = 7478;
Thread.sleep(4000);
//第一次兑换 //第一次兑换
Response response = qbExchangeService.doTakePrize(authorization.dafuwengLogin(uid),"12343432554","3"); Response response = qbExchangeService.doTakePrize(authorization.dafuwengLogin(uid),"12343432554","3");
String orderId = (String)response.jsonPath().get("orderId"); String orderId = (String)response.jsonPath().get("orderId");
......
...@@ -88,10 +88,11 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -88,10 +88,11 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
String orderId = this.支付宝兑换订单(uid,"peeulk6392@sandbox.com","沙箱环境","10"); String orderId = this.支付宝兑换订单(uid,"peeulk6392@sandbox.com","沙箱环境","10");
logger.info("订单号:" + orderId); logger.info("订单号:" + orderId);
Thread.sleep(3000);
//订单审核,判断是否在待审核节点 //订单审核,判断是否在待审核节点
Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId); Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
String flowWork = String.valueOf(mapOrder.get("flowwork_stage")); String flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
Thread.sleep(300);
logger.info("数据库订单节点:" + flowWork); logger.info("数据库订单节点:" + flowWork);
Assert.assertEquals(flowWork,"Audit-started","校验订单审核节点失败"); Assert.assertEquals(flowWork,"Audit-started","校验订单审核节点失败");
String orderIdmain = String.valueOf(mapOrder.get("order_num")); String orderIdmain = String.valueOf(mapOrder.get("order_num"));
...@@ -113,6 +114,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -113,6 +114,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
while (j > 0 && !flowWork.equals("Success-complete")) { while (j > 0 && !flowWork.equals("Success-complete")) {
Thread.sleep(1000); Thread.sleep(1000);
auditResponse = dsOrderService.submitAudit("22542",orderId,"pass",authorization.hdLoginCommonNew("15833333333")); auditResponse = dsOrderService.submitAudit("22542",orderId,"pass",authorization.hdLoginCommonNew("15833333333"));
auditResponse.prettyPrint();
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId); mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage")); flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork); logger.info("数据库订单节点:" + flowWork);
......
...@@ -164,6 +164,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -164,6 +164,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("兑换前的积分:"+credits); logger.info("兑换前的积分:"+credits);
credits = String.valueOf(Integer.valueOf(credits)-10); credits = String.valueOf(Integer.valueOf(credits)-10);
Thread.sleep(5000);
//优惠券兑换 //优惠券兑换
this.优惠券兑换("174797","30290",uid); this.优惠券兑换("174797","30290",uid);
...@@ -192,6 +193,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -192,6 +193,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("兑换前的优惠券共享库存:" + stock); logger.info("兑换前的优惠券共享库存:" + stock);
stock = String.valueOf(Integer.valueOf(stock)-1); stock = String.valueOf(Integer.valueOf(stock)-1);
Thread.sleep(5000);
//优惠券兑换 //优惠券兑换
this.优惠券兑换("174923","30318",uid); this.优惠券兑换("174923","30318",uid);
...@@ -215,6 +217,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -215,6 +217,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
String ftDate = ft.format(dNow); String ftDate = ft.format(dNow);
try { try {
Thread.sleep(5000);
//优惠券第一次兑换 //优惠券第一次兑换
this.优惠券兑换("174928","30319",uid); this.优惠券兑换("174928","30319",uid);
...@@ -317,10 +320,12 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -317,10 +320,12 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
// logger.info("兑换前的开发者余额:" + remainMoney); // logger.info("兑换前的开发者余额:" + remainMoney);
// String remainMoneyNew =String.valueOf(Integer.valueOf(remainMoney) - 1000) ; // String remainMoneyNew =String.valueOf(Integer.valueOf(remainMoney) - 1000) ;
Thread.sleep(5000);
//优惠券兑换 //优惠券兑换
String orderId = this.优惠券兑换订单(appItemId,itemId,uid); String orderId = this.优惠券兑换订单(appItemId,itemId,uid);
logger.info("订单号:" + orderId); logger.info("订单号:" + orderId);
Thread.sleep(3000);
//订单审核,判断是否在待审核节点 //订单审核,判断是否在待审核节点
Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId); Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
String flowWork = String.valueOf(mapOrder.get("flowwork_stage")); String flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
...@@ -331,7 +336,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -331,7 +336,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("兑吧订单号为:" + orderIdmain); logger.info("兑吧订单号为:" + orderIdmain);
int i =10; int i =10;
while (i > 0 && !flowWork.equals("Audit-started")) { while (i > 0 && !flowWork.equals("Audit-started")) {
Thread.sleep(300); Thread.sleep(3000);
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId); mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage")); flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork); logger.info("数据库订单节点:" + flowWork);
...@@ -344,7 +349,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -344,7 +349,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
//判断订单是否审核成功,如果订单没有成功则继续审核 //判断订单是否审核成功,如果订单没有成功则继续审核
int j =10; int j =10;
while (j > 0 && !flowWork.equals("Success-complete")) { while (j > 0 && !flowWork.equals("Success-complete")) {
Thread.sleep(1000); Thread.sleep(3000);
auditResponse = dsOrderService.submitAudit("22542",orderId,"pass",authorization.hdLoginCommonNew("15833333333")); auditResponse = dsOrderService.submitAudit("22542",orderId,"pass",authorization.hdLoginCommonNew("15833333333"));
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId); mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage")); flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
...@@ -504,6 +509,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -504,6 +509,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
map.put("token","yrJRr7Cddp2YeQd"); map.put("token","yrJRr7Cddp2YeQd");
try{ try{
Thread.sleep(5000);
//优惠券兑换,用户兑换限制次数1次 //优惠券兑换,用户兑换限制次数1次
Response response= this.优惠券兑换("170295","29294", uid); Response response= this.优惠券兑换("170295","29294", uid);
Assert.assertEquals(response.jsonPath().getString("status"),"success","校验兑换失败"); Assert.assertEquals(response.jsonPath().getString("status"),"success","校验兑换失败");
......
...@@ -40,7 +40,8 @@ public class 平台券_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -40,7 +40,8 @@ public class 平台券_兑换流程测试_ExchangeTest extends CheckTemplet {
// private MysqlUtils jdbc; // private MysqlUtils jdbc;
// @BeforeClass // @BeforeClassF优惠券用户批次兑换限制测试()
// public void before(){ // public void before(){
// //
// jdbc = MysqlUtils.mysqlDuiba(""); // jdbc = MysqlUtils.mysqlDuiba("");
......
...@@ -515,6 +515,7 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec ...@@ -515,6 +515,7 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec
String stock = String.valueOf(mapStock.get("stock")); String stock = String.valueOf(mapStock.get("stock"));
logger.info("兑换前的库存:" + stock); logger.info("兑换前的库存:" + stock);
Thread.sleep(5000);
Response response = gawService.virtualExchange(cookies, appItemId,skuId); Response response = gawService.virtualExchange(cookies, appItemId,skuId);
String orderId = response.jsonPath().getString("data.orderId"); String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果 //获取兑换结果
......
...@@ -116,7 +116,7 @@ public class 游戏_开大奖测试_AccessTest extends DuibaTestBase { ...@@ -116,7 +116,7 @@ public class 游戏_开大奖测试_AccessTest extends DuibaTestBase {
} }
} }
@Test //@Test
public void 游戏_排名开奖测试() throws Exception{ public void 游戏_排名开奖测试() throws Exception{
//四个用户参加游戏 //四个用户参加游戏
//第一名:user1,中话费 //第一名:user1,中话费
......
...@@ -19,7 +19,7 @@ import org.testng.annotations.Test; ...@@ -19,7 +19,7 @@ import org.testng.annotations.Test;
*/ */
@ContextConfiguration(classes = Config.class) @ContextConfiguration(classes = Config.class)
public class 商品管理操作_ExchangeTest extends AbstractTestNGSpringContextTests { public class 商品管理操作 extends AbstractTestNGSpringContextTests {
@Autowired @Autowired
SpglczService czService; SpglczService czService;
@Autowired @Autowired
......
...@@ -16,7 +16,7 @@ import org.testng.annotations.Test; ...@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
* 自有优惠券添加、修改、删除、上架或下架、查询操作 * 自有优惠券添加、修改、删除、上架或下架、查询操作
*/ */
@ContextConfiguration(classes = Config.class) @ContextConfiguration(classes = Config.class)
public class 自有优惠券测试_ExchangeTest extends AbstractTestNGSpringContextTests { public class 自有优惠券测试 extends AbstractTestNGSpringContextTests {
@Autowired @Autowired
DeveloperObjectService developerObjectService; DeveloperObjectService developerObjectService;
@Autowired @Autowired
......
...@@ -17,7 +17,7 @@ import org.testng.annotations.Test; ...@@ -17,7 +17,7 @@ import org.testng.annotations.Test;
* @author wangxiaoshuang * @author wangxiaoshuang
*/ */
@ContextConfiguration(classes = Config.class) @ContextConfiguration(classes = Config.class)
public class 自有实物测试_ExchangeTest extends AbstractTestNGSpringContextTests { public class 自有实物测试 extends AbstractTestNGSpringContextTests {
@Autowired @Autowired
DeveloperObjectService objectService; DeveloperObjectService objectService;
......
...@@ -15,7 +15,7 @@ import org.testng.annotations.Test; ...@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
* 自有虚拟商品添加、修改、删除、上架或下架、查询操作 * 自有虚拟商品添加、修改、删除、上架或下架、查询操作
*/ */
@ContextConfiguration(classes = Config.class) @ContextConfiguration(classes = Config.class)
public class 自有虚拟商品测试_ExchangeTest extends AbstractTestNGSpringContextTests { public class 自有虚拟商品测试 extends AbstractTestNGSpringContextTests {
@Autowired @Autowired
DeveloperVirtualService developerVirtualService; DeveloperVirtualService developerVirtualService;
@Autowired @Autowired
......
...@@ -106,17 +106,17 @@ public class 优惠券测试_DuibaTest extends AbstractTestNGSpringContextTests ...@@ -106,17 +106,17 @@ public class 优惠券测试_DuibaTest extends AbstractTestNGSpringContextTests
public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception { public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception {
Response response = newActivityService.doJoin2(activityId,token); Response response = newActivityService.doJoin2(7497,activityId,token);
response.prettyPrint(); response.prettyPrint();
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(7497,orderId,device);
response.prettyPrint(); response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result")); String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30; int i= 30;
while(i>0&&(result.equals("0"))){ while(i>0&&(result.equals("0"))){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(7497,orderId,device);
result = String.valueOf(response.jsonPath().getString("result")); result = String.valueOf(response.jsonPath().getString("result"));
i--; i--;
response.prettyPrint(); response.prettyPrint();
......
...@@ -27,7 +27,7 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase { ...@@ -27,7 +27,7 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase {
@Test @Test
public void 全局红包测试() throws Exception { public void 全局红包测试() throws Exception {
Map<String, Object> selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0687 where account_id = '100025007_0_0' "); Map<String, Object> selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0176 where account_id = '100176048_0_0' ");
int balance = Integer.parseInt(String.valueOf(selectResult.get("balance_amount"))); int balance = Integer.parseInt(String.valueOf(selectResult.get("balance_amount")));
logger.info("账户原有余额为"+balance); logger.info("账户原有余额为"+balance);
//进行接口测试传参 //进行接口测试传参
...@@ -40,7 +40,7 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase { ...@@ -40,7 +40,7 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase {
balance = balance + bonus; balance = balance + bonus;
logger.info("预期余额为"+balance); logger.info("预期余额为"+balance);
selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0687 where account_id = '100025007_0_0' "); selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0176 where account_id = '100176048_0_0' ");
int balanceNew = Integer.parseInt(String.valueOf(selectResult.get("balance_amount"))); int balanceNew = Integer.parseInt(String.valueOf(selectResult.get("balance_amount")));
logger.info("实际余额为"+balanceNew); logger.info("实际余额为"+balanceNew);
Assert.assertEquals(balanceNew,balance,"全局红包增加账户余额失败"); Assert.assertEquals(balanceNew,balance,"全局红包增加账户余额失败");
...@@ -48,17 +48,17 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase { ...@@ -48,17 +48,17 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase {
public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception { public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception {
Response response = newActivityService.doJoin2(activityId,token); Response response = newActivityService.doJoin2(7498 ,activityId,token);
response.prettyPrint(); response.prettyPrint();
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(7498,orderId,device);
response.prettyPrint(); response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result")); String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30; int i= 30;
while(i>0&&(result.equals("0"))){ while(i>0&&(result.equals("0"))){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(7498,orderId,device);
result = String.valueOf(response.jsonPath().getString("result")); result = String.valueOf(response.jsonPath().getString("result"));
i--; i--;
response.prettyPrint(); response.prettyPrint();
......
...@@ -43,10 +43,10 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase { ...@@ -43,10 +43,10 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase {
//数据库删除 //数据库删除
try { try {
//case:[奖品发放限制测试_永久]数据处理:删除永久中奖记录 //case:[奖品发放限制测试_永久]数据处理:删除永久中奖记录
jdbc.update("UPDATE ckvtable.tb_kvtable_0687 SET int_value = '0' WHERE vkey = 'activity-centerwinOptionNum_100025007_35868_hdtool25884'"); jdbc.update("UPDATE ckvtable.tb_kvtable_0177 SET int_value = '0' WHERE vkey = 'activity-centerwinOptionNum_100176049_35868_hdtool25884'");
//case:[奖品发放限制测试_每日]数据处理:删除每日中奖记录 //case:[奖品发放限制测试_每日]数据处理:删除每日中奖记录
String y_m_d = getTime2(0); String y_m_d = getTime2(0);
String key = "k05_PRIZE_K001_"+y_m_d+"_hdtool25933_100025007"; String key = "k05_PRIZE_K001_"+y_m_d+"_hdtool25933_100176049";
hbaseService.deleteHBASEKey2(key); hbaseService.deleteHBASEKey2(key);
} catch (Exception e) { } catch (Exception e) {
System.out.println(e); System.out.println(e);
...@@ -59,12 +59,12 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase { ...@@ -59,12 +59,12 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase {
public void 奖品发放限制测试_永久() throws Exception { public void 奖品发放限制测试_永久() throws Exception {
//第一次抽奖 //第一次抽奖
Response response = this.新活动工具接口传参("35868","adsdas","iOS"); Response response = this.新活动工具接口传参(7499,"35868","adsdas","iOS");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"phonebill","第一次抽奖出奖类型失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"phonebill","第一次抽奖出奖类型失败");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.title")),"话费","第一次抽奖出奖title失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.title")),"话费","第一次抽奖出奖title失败");
//第二次抽奖 //第二次抽奖
response = this.新活动工具接口传参("35868","adsdas","iOS"); response = this.新活动工具接口传参(7499,"35868","adsdas","iOS");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"lucky","第一次抽奖出奖类型失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"lucky","第一次抽奖出奖类型失败");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.useBtnText")),"马上使用","第一次抽奖出奖文案失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.useBtnText")),"马上使用","第一次抽奖出奖文案失败");
...@@ -75,30 +75,30 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase { ...@@ -75,30 +75,30 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase {
public void 奖品发放限制测试_每日() throws Exception { public void 奖品发放限制测试_每日() throws Exception {
//第一次抽奖 //第一次抽奖
Response response = this.新活动工具接口传参("35920","adsdas","iOS"); Response response = this.新活动工具接口传参(7499,"35920","adsdas","iOS");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"phonebill","第一次抽奖出奖类型失败,请考虑是否activity-access-web发布了master分支所导致"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"phonebill","第一次抽奖出奖类型失败,请考虑是否activity-access-web发布了master分支所导致");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.title")),"话费","第一次抽奖出奖title失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.title")),"话费","第一次抽奖出奖title失败");
//第二次抽奖 //第二次抽奖
response = this.新活动工具接口传参("35920","adsdas","iOS"); response = this.新活动工具接口传参(7499,"35920","adsdas","iOS");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"lucky","第一次抽奖出奖类型失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.type")),"lucky","第一次抽奖出奖类型失败");
Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.useBtnText")),"马上使用","第一次抽奖出奖文案失败"); Assert.assertEquals( String.valueOf(response.jsonPath().getString("lottery.useBtnText")),"马上使用","第一次抽奖出奖文案失败");
} }
public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception { public Response 新活动工具接口传参(int uid,String activityId,String token,String device) throws Exception {
Response response = newActivityService.doJoin2(activityId,token); Response response = newActivityService.doJoin2(uid,activityId,token);
response.prettyPrint(); response.prettyPrint();
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(uid,orderId,device);
response.prettyPrint(); response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result")); String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30; int i= 30;
while(i>0&&(result.equals("0"))){ while(i>0&&(result.equals("0"))){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(uid,orderId,device);
result = String.valueOf(response.jsonPath().getString("result")); result = String.valueOf(response.jsonPath().getString("result"));
i--; i--;
response.prettyPrint(); response.prettyPrint();
......
...@@ -110,11 +110,20 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase { ...@@ -110,11 +110,20 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
response = newActivityService.getOrderStatus2(orderId,"iOS"); response = newActivityService.getOrderStatus2(orderId,"iOS");
response.prettyPrint(); response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result")); String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30; // int i= 30;
while(i>0&&(result.equals("0"))){ // while(i>0&&(result.equals("0"))){
// Thread.sleep(1000);
// response = newActivityService.getOrderStatus2(orderId,"iOS");
// result = String.valueOf(response.jsonPath().getString("result"));
// i--;
// response.prettyPrint();
// }
int i= 3;
while(i>0){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,"iOS"); response = newActivityService.getOrderStatus2(orderId,"iOS");
result = String.valueOf(response.jsonPath().getString("result"));
i--; i--;
response.prettyPrint(); response.prettyPrint();
} }
...@@ -273,17 +282,17 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase { ...@@ -273,17 +282,17 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
} }
public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception { public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception {
Response response = newActivityService.doJoin2(activityId,token); Response response = newActivityService.doJoin2(7500,activityId,token);
response.prettyPrint(); response.prettyPrint();
String orderId = response.jsonPath().getString("orderId"); String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(7500,orderId,device);
response.prettyPrint(); response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result")); String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30; int i= 30;
while(i>0&&(result.equals("0"))){ while(i>0&&(result.equals("0"))){
Thread.sleep(1000); Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device); response = newActivityService.getOrderStatus2(7500,orderId,device);
result = String.valueOf(response.jsonPath().getString("result")); result = String.valueOf(response.jsonPath().getString("result"));
i--; i--;
response.prettyPrint(); response.prettyPrint();
......
...@@ -49,6 +49,7 @@ public class 页面元素测试_DuibaTest extends AbstractTestNGSpringContextTes ...@@ -49,6 +49,7 @@ public class 页面元素测试_DuibaTest extends AbstractTestNGSpringContextTes
@Test(description = "校验接口返回的奖品") @Test(description = "校验接口返回的奖品")
public void 奖品显示测试() throws Exception { public void 奖品显示测试() throws Exception {
Response response = newActivityService.ajaxElement("duiba","3347","19204","false"); Response response = newActivityService.ajaxElement("duiba","3347","19204","false");
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("options[0].prizeType"), "thanks", "校验显示谢谢参与失败"); Assert.assertEquals(response.jsonPath().getString("options[0].prizeType"), "thanks", "校验显示谢谢参与失败");
Assert.assertEquals(response.jsonPath().getString("options[1].prizeType"), "coupon", "校验显示优惠券失败"); Assert.assertEquals(response.jsonPath().getString("options[1].prizeType"), "coupon", "校验显示优惠券失败");
Assert.assertEquals(response.jsonPath().getString("options[2].prizeType"), "object", "校验显示实物失败"); Assert.assertEquals(response.jsonPath().getString("options[2].prizeType"), "object", "校验显示实物失败");
......
...@@ -241,7 +241,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase { ...@@ -241,7 +241,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId1,"活动id校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId1,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.01","活动id校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.01","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"1","兑换状态校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid3); response = pkService.list(uid3);
response.prettyPrint(); response.prettyPrint();
......
...@@ -245,7 +245,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas ...@@ -245,7 +245,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId2,"活动id校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId2,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.06","活动id校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.06","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"1","兑换状态校验失败"); Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid1); response = pkService.list(uid1);
response.prettyPrint(); response.prettyPrint();
......
...@@ -395,10 +395,12 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du ...@@ -395,10 +395,12 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
//第一次秒杀 //第一次秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId); Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId"); String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000); Thread.sleep(1000);
//获取兑换结果 //获取兑换结果
response = seckillNewService.orderStatus(orderId,uid); response = seckillNewService.orderStatus(orderId,uid);
response.prettyPrint();
String status = response.jsonPath().getString("data.status"); String status = response.jsonPath().getString("data.status");
int i = 10; int i = 10;
//异步接口,直到兑换成功 //异步接口,直到兑换成功
......
...@@ -74,6 +74,7 @@ public class 秒杀商品_自有新商家充值_兑换限制_SeckillTest extends ...@@ -74,6 +74,7 @@ public class 秒杀商品_自有新商家充值_兑换限制_SeckillTest extends
//秒杀 //秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId); Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId"); String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000); Thread.sleep(1000);
response = seckillNewService.orderStatus(orderId,uid); response = seckillNewService.orderStatus(orderId,uid);
......
...@@ -503,7 +503,7 @@ public class ContractSign_signTest extends DuibaTestBase { ...@@ -503,7 +503,7 @@ public class ContractSign_signTest extends DuibaTestBase {
map.put("skinId","46"); map.put("skinId","46");
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map)); JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map));
Response response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonObject).post("https://mng.duibatest.com.cn/newmanager/signContract/save"); Response response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonObject).post("https://mng.duibatest.com.cn/newmanager/signContract/save");
//response.prettyPrint(); response.prettyPrint();
try { try {
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/signContract/save接口失败"); Assert.assertEquals(response.jsonPath().getString("success"), "true", "/signContract/save接口失败");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -45,13 +45,16 @@ public class 夺宝签到_signTest extends DuibaTestBase { ...@@ -45,13 +45,16 @@ public class 夺宝签到_signTest extends DuibaTestBase {
Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("false")); Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("false"));
//签到 //签到
response = signTreasureService.doSign(phaseId,id,uid); response = signTreasureService.doSign(phaseId,id,uid);
//获取logId //获取logId
String logId = response.jsonPath().getString("data.logId"); String logId = response.jsonPath().getString("data.logId");
//获取签到结果 //获取签到结果
Thread.sleep(3000); Thread.sleep(3000);
response = signTreasureService.getSignResult(logId,uid); response = signTreasureService.getSignResult(logId,uid);
response.prettyPrint();
//校验夺宝码 //校验夺宝码
Assert.assertTrue(response.jsonPath().getString("data.codes").equals("[102_114_14_84]")); //Assert.assertTrue(response.jsonPath().getString("data.codes").equals("[52_33_122_12]"));
//校验已签到 //校验已签到
response = signTreasureService.getHomeInfo(id,uid); response = signTreasureService.getHomeInfo(id,uid);
Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("true")); Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("true"));
......
...@@ -45,7 +45,7 @@ public class 单品抽奖_中鼓励奖_AccessTest extends DuibaTestBase { ...@@ -45,7 +45,7 @@ public class 单品抽奖_中鼓励奖_AccessTest extends DuibaTestBase {
if(method.getName().equals("鼓励奖限制测试")) { if(method.getName().equals("鼓励奖限制测试")) {
result = new Object[][]{ result = new Object[][]{
new Object[]{1, "27128", "1", "","鼓励奖优惠券数量1,数量用完则判断是否可中主奖"}, new Object[]{1, "27128", "1", "","鼓励奖优惠券数量1,数量用完则判断是否可中主奖"},
new Object[]{2, "27000", "99999", "1","鼓励奖限制,数量用完后用户无法再中鼓励奖"}, // new Object[]{2, "27000", "99999", "1","鼓励奖限制,数量用完后用户无法再中鼓励奖"},
}; };
} }
return result; return result;
......
...@@ -77,9 +77,9 @@ public class 自有单品抽奖_AccessTest extends DuibaTestBase { ...@@ -77,9 +77,9 @@ public class 自有单品抽奖_AccessTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("showUse"), "true", "校验是否展示马上使用失败"); Assert.assertEquals(response.jsonPath().getString("showUse"), "true", "校验是否展示马上使用失败");
Assert.assertEquals(response.jsonPath().getString("useBtnText"), "马上使用", "校验按钮文案展示失败"); Assert.assertEquals(response.jsonPath().getString("useBtnText"), "马上使用", "校验按钮文案展示失败");
if ( device.equals("iOS")) { if ( device.equals("iOS")) {
Assert.assertEquals(response.jsonPath().getString("iosDownloadUrl"), "www.baidu.com", "校验Url失败"); Assert.assertEquals(response.jsonPath().getString("iosDownloadUrl"), "http://www.baidu.com", "校验Url失败");
}else{ }else{
Assert.assertEquals(response.jsonPath().getString("androidDownloadUrl"),"www.baidu.com","校验Url失败"); Assert.assertEquals(response.jsonPath().getString("androidDownloadUrl"),"http://www.baidu.com","校验Url失败");
} }
logger.info("校验链接券码项:openUrl,useBtnText成功"); logger.info("校验链接券码项:openUrl,useBtnText成功");
break; break;
......
...@@ -154,7 +154,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT ...@@ -154,7 +154,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT
String desc = response.jsonPath().getString("desc"); String desc = response.jsonPath().getString("desc");
logger.info("code:"+code+",desc:"+desc); logger.info("code:"+code+",desc:"+desc);
//校验 //校验
Assert.assertEquals(code,"1001003","ZDH权益已过期 有问题" ); Assert.assertEquals(code,"1001029","ZDH权益已过期 有问题" );
response.prettyPrint(); response.prettyPrint();
logger.info(" ZDH核销二期权益已过期-->结束了"); logger.info(" ZDH核销二期权益已过期-->结束了");
} }
...@@ -286,7 +286,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT ...@@ -286,7 +286,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT
String desc = response.jsonPath().getString("desc"); String desc = response.jsonPath().getString("desc");
logger.info("code:"+code+",desc:"+desc); logger.info("code:"+code+",desc:"+desc);
//校验 //校验
Assert.assertEquals(code,"1001002","2-ZDH权益未开始进行兑换( 有问题" ); Assert.assertEquals(code,"1001028","2-ZDH权益未开始进行兑换( 有问题" );
response.prettyPrint(); response.prettyPrint();
logger.info(" 2-ZDH权益未开始进行兑换(-->结束了"); logger.info(" 2-ZDH权益未开始进行兑换(-->结束了");
} }
......
...@@ -331,6 +331,31 @@ public class NewActivityService { ...@@ -331,6 +331,31 @@ public class NewActivityService {
return response; return response;
} }
public Response getOrderStatus2(int uid,String orderId,String device) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("orderId",orderId);
Map<String,String> maphead = new HashMap<>();
if ( device.equals("iOS")) {
maphead.put("User-Agent", "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1");
}else{
maphead.put("User-Agent", "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Mobile Safari/537.36");
}
logger.info("请求/hdtool/getOrderStatus接口,orderId="+orderId);
Response response = given().headers(maphead).cookies(authorization.dafuwengLogin(uid)).params(map).post(url+"/hdtool/getOrderStatus");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/hdtool/getOrderStatus接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/hdtool/getOrderStatus接口失败,返回信息:"+response.asString());
}
return response;
}
public Response getOrderStatus3(String orderId) throws Exception { public Response getOrderStatus3(String orderId) throws Exception {
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("orderId",orderId); map.put("orderId",orderId);
...@@ -515,12 +540,12 @@ public class NewActivityService { ...@@ -515,12 +540,12 @@ public class NewActivityService {
return response; return response;
} }
//自定义答题活动--提交答案 //自定义答题活动--提交答案
public void submit(String orderId) throws Exception { public void submit(int uid,String orderId) throws Exception {
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("orderId",orderId); map.put("orderId",orderId);
map.put("answerData","[{\"id\":465,\"option\":3}]"); map.put("answerData","[{\"id\":463,\"option\":1}]");
logger.info("请求/hdtool/submit接口,orderId="+orderId); logger.info("请求/hdtool/submit接口,orderId="+orderId);
Response response = given().cookies(authorization.dafuwengLogin(2720)).params(map).post(url+"/hdtool/submit"); Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(url+"/hdtool/submit");
try{ try{
Assert.assertEquals(response.jsonPath().getString("success"),"true"); Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){ }catch(Exception e){
......
...@@ -28,7 +28,10 @@ db.password= 2Fe36uDap8TMqtfzob3f1u8r2aK8qjdnwPP ...@@ -28,7 +28,10 @@ db.password= 2Fe36uDap8TMqtfzob3f1u8r2aK8qjdnwPP
//db.url = jdbc:mysql://47.97.127.67:13001/?tinyInt1isBit=false //db.url = jdbc:mysql://47.97.127.67:13001/?tinyInt1isBit=false
#db.url = jdbc:mysql://autotest-config.duibatest.com.cn:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000 #db.url = jdbc:mysql://autotest-config.duibatest.com.cn:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.url = jdbc:mysql://auto.testdb2.duibar.com:3306/?serverTimezone=UTC&tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000 #db.url = jdbc:mysql://auto.testdb2.duibar.com:3306/?serverTimezone=UTC&tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.url = jdbc:mysql://auto.testdb2.duibar.com:5306/?serverTimezone=UTC&tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.driver= com.mysql.cj.jdbc.Driver db.driver= com.mysql.cj.jdbc.Driver
......
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