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

Merge branch 'master' into duiba_wenyan

parents a1da9b1f 4da13022
......@@ -261,7 +261,7 @@ public class 自有_自有活动出奖 extends DuibaTestBase {
String coupon_code = response.jsonPath().getString("data.lottery.coupon_code");
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.assertEquals(title,"【自动化】优惠券-普通","title不正确");
Assert.assertEquals(type,"coupon","type不正确");
......
......@@ -50,8 +50,8 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
public void clearDb() {
try {
//清除用户参与活动次数(活动id:19127)
Boolean clearResult8 = jdbc.update("delete from ckvtable.tb_kvtable_0687 where consumer_id = 100025007 and vkey = 'activity-centerjoinNum_100025007_19933'",null);
Boolean clearResult9 = jdbc.update("delete from ckvtable.tb_kvtable_0656 where consumer_id = 100026000 and vkey = 'activity-centerjoinNum_100026000_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_0188 where consumer_id = 100176060 and vkey = 'activity-centerjoinNum_100176060_19933'",null);
} catch (Exception e) {
e.printStackTrace();
......@@ -62,11 +62,11 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
try {
//清除自定义活动-中奖奖品数量信息(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)
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)
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) {
e.printStackTrace();
}
......@@ -90,12 +90,12 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
for(int i=0;i<2;i++) {
if(i==0){
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", "校验中奖类型失败");
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.type"), cLReward.getRlType(), "校验奖项失败");
logger.info("校验集卡活动开奖奖项信息成功,奖品信息为:" + openResponse.jsonPath().getString("lottery.title"));
......@@ -103,13 +103,13 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
}else if(i==1){
for (int j=0;j<2;j++){
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", "校验中奖类型失败");
logger.info("校验自定义中奖奖项信息成功,自定义活动游戏中奖奖品类型" + response.jsonPath().getString("lottery.type"));
}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"));
Assert.assertTrue((type.contains("thanks"))||(type.contains("lucky")));
logger.info("校验中奖谢谢参与成功,奖项类型为" + response.jsonPath().getString("lottery.type"));
......@@ -130,12 +130,12 @@ public class 集卡_单奖项_用户中奖限制测试_DuibaTest extends DuibaTe
String awardsType = awardResponse.jsonPath().getString("data.config.rewards[0].rlType");
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", "校验中奖类型失败");
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.type"), awardsType, "校验奖项失败");
logger.info("校验活动中奖信息name和type成功,奖品信息为:" + openResponse.jsonPath().getString("lottery.title"));
......
......@@ -156,7 +156,7 @@ public class CustomActivity_DuibaTest extends DuibaTestBase {
break;
}
Thread.sleep(1000);
}
......@@ -249,19 +249,25 @@ public class CustomActivity_DuibaTest extends DuibaTestBase {
//活动抽奖接口传参单独抽离
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();
String orderId = response.jsonPath().getString("orderId");
newActivityService.submit(orderId);
newActivityService.submit(7496,orderId);
Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId, device);
response = newActivityService.getOrderStatus2(7496,orderId, device);
String result = String.valueOf(response.jsonPath().getString("result"));
int i = 8;
while (i > 0 && (result.equals("0"))) {
int i = 3;
// 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);
response = newActivityService.getOrderStatus2(orderId, device);
result = String.valueOf(response.jsonPath().getString("result"));
response = newActivityService.getOrderStatus2(7496,orderId, device);
i--;
response.prettyPrint();
}
......
......@@ -17,7 +17,7 @@ import org.testng.annotations.Test;
/**
* Created by zhaoran on 2018/3/15.
*/
public class 创建自有活动_DuibaTest extends DuibaTestBase {
public class 创建自有活动 extends DuibaTestBase {
@Autowired
SigninService signinService;
@Autowired
......
......@@ -287,6 +287,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
Map<String, String> map = authorization.dafuwengLogin(uid);
Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "活动详情页请求异常");
Thread.sleep(5000);
//实物兑换
response = couponExchangeService.objectExchange(map, "161100", null, "null", "yrJRr7Cddp2YeQd", "null");
// response.prettyPrint();
......@@ -307,6 +308,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
message = response.jsonPath().getString("data.message");
i--;
}
Thread.sleep(2000);
//查询数据库,获取当前积分
mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid);
String creditsNew = String.valueOf(mapuser.get("credits"));
......@@ -344,6 +346,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
String credits = String.valueOf(mapuser.get("credits"));
logger.info("兑换前积分:" + credits); //扣去100积分
credits = String.valueOf(Integer.valueOf(credits) - 1);
Thread.sleep(5000);
//优惠券兑换
Response response = couponExchangeService.couponExchange(authorization.dafuwengLogin(uid), "159857", null);
String orderId = response.jsonPath().getString("orderId");
......@@ -361,6 +364,7 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
i--;
}
Thread.sleep(3000);
response.prettyPrint();
//查询数据库,获取当前积分
mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid);
......
......@@ -138,6 +138,7 @@ public class Qb_兑换限制测试_ExchangeTest extends CheckTemplet {
public void 用户每月兑换限制() throws Exception {
int uid = 7478;
Thread.sleep(4000);
//第一次兑换
Response response = qbExchangeService.doTakePrize(authorization.dafuwengLogin(uid),"12343432554","3");
String orderId = (String)response.jsonPath().get("orderId");
......
......@@ -88,10 +88,11 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
String orderId = this.支付宝兑换订单(uid,"peeulk6392@sandbox.com","沙箱环境","10");
logger.info("订单号:" + orderId);
Thread.sleep(3000);
//订单审核,判断是否在待审核节点
Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
String flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
Thread.sleep(300);
logger.info("数据库订单节点:" + flowWork);
Assert.assertEquals(flowWork,"Audit-started","校验订单审核节点失败");
String orderIdmain = String.valueOf(mapOrder.get("order_num"));
......@@ -113,6 +114,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
while (j > 0 && !flowWork.equals("Success-complete")) {
Thread.sleep(1000);
auditResponse = dsOrderService.submitAudit("22542",orderId,"pass",authorization.hdLoginCommonNew("15833333333"));
auditResponse.prettyPrint();
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork);
......
......@@ -164,6 +164,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("兑换前的积分:"+credits);
credits = String.valueOf(Integer.valueOf(credits)-10);
Thread.sleep(5000);
//优惠券兑换
this.优惠券兑换("174797","30290",uid);
......@@ -192,6 +193,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("兑换前的优惠券共享库存:" + stock);
stock = String.valueOf(Integer.valueOf(stock)-1);
Thread.sleep(5000);
//优惠券兑换
this.优惠券兑换("174923","30318",uid);
......@@ -215,6 +217,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
String ftDate = ft.format(dNow);
try {
Thread.sleep(5000);
//优惠券第一次兑换
this.优惠券兑换("174928","30319",uid);
......@@ -317,10 +320,12 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
// logger.info("兑换前的开发者余额:" + remainMoney);
// String remainMoneyNew =String.valueOf(Integer.valueOf(remainMoney) - 1000) ;
Thread.sleep(5000);
//优惠券兑换
String orderId = this.优惠券兑换订单(appItemId,itemId,uid);
logger.info("订单号:" + orderId);
Thread.sleep(3000);
//订单审核,判断是否在待审核节点
Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
String flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
......@@ -331,7 +336,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("兑吧订单号为:" + orderIdmain);
int i =10;
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);
flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork);
......@@ -344,7 +349,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
//判断订单是否审核成功,如果订单没有成功则继续审核
int j =10;
while (j > 0 && !flowWork.equals("Success-complete")) {
Thread.sleep(1000);
Thread.sleep(3000);
auditResponse = dsOrderService.submitAudit("22542",orderId,"pass",authorization.hdLoginCommonNew("15833333333"));
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders9+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
......@@ -504,6 +509,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
map.put("token","yrJRr7Cddp2YeQd");
try{
Thread.sleep(5000);
//优惠券兑换,用户兑换限制次数1次
Response response= this.优惠券兑换("170295","29294", uid);
Assert.assertEquals(response.jsonPath().getString("status"),"success","校验兑换失败");
......
......@@ -40,7 +40,8 @@ public class 平台券_兑换流程测试_ExchangeTest extends CheckTemplet {
// private MysqlUtils jdbc;
// @BeforeClass
// @BeforeClassF优惠券用户批次兑换限制测试()
// public void before(){
//
// jdbc = MysqlUtils.mysqlDuiba("");
......
......@@ -515,6 +515,7 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec
String stock = String.valueOf(mapStock.get("stock"));
logger.info("兑换前的库存:" + stock);
Thread.sleep(5000);
Response response = gawService.virtualExchange(cookies, appItemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
......
......@@ -116,7 +116,7 @@ public class 游戏_开大奖测试_AccessTest extends DuibaTestBase {
}
}
@Test
//@Test
public void 游戏_排名开奖测试() throws Exception{
//四个用户参加游戏
//第一名:user1,中话费
......
......@@ -19,7 +19,7 @@ import org.testng.annotations.Test;
*/
@ContextConfiguration(classes = Config.class)
public class 商品管理操作_ExchangeTest extends AbstractTestNGSpringContextTests {
public class 商品管理操作 extends AbstractTestNGSpringContextTests {
@Autowired
SpglczService czService;
@Autowired
......
......@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
* 自有优惠券添加、修改、删除、上架或下架、查询操作
*/
@ContextConfiguration(classes = Config.class)
public class 自有优惠券测试_ExchangeTest extends AbstractTestNGSpringContextTests {
public class 自有优惠券测试 extends AbstractTestNGSpringContextTests {
@Autowired
DeveloperObjectService developerObjectService;
@Autowired
......
......@@ -17,7 +17,7 @@ import org.testng.annotations.Test;
* @author wangxiaoshuang
*/
@ContextConfiguration(classes = Config.class)
public class 自有实物测试_ExchangeTest extends AbstractTestNGSpringContextTests {
public class 自有实物测试 extends AbstractTestNGSpringContextTests {
@Autowired
DeveloperObjectService objectService;
......
......@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
* 自有虚拟商品添加、修改、删除、上架或下架、查询操作
*/
@ContextConfiguration(classes = Config.class)
public class 自有虚拟商品测试_ExchangeTest extends AbstractTestNGSpringContextTests {
public class 自有虚拟商品测试 extends AbstractTestNGSpringContextTests {
@Autowired
DeveloperVirtualService developerVirtualService;
@Autowired
......
......@@ -106,17 +106,17 @@ public class 优惠券测试_DuibaTest extends AbstractTestNGSpringContextTests
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();
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(7497,orderId,device);
response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30;
while(i>0&&(result.equals("0"))){
Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(7497,orderId,device);
result = String.valueOf(response.jsonPath().getString("result"));
i--;
response.prettyPrint();
......
......@@ -27,7 +27,7 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase {
@Test
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")));
logger.info("账户原有余额为"+balance);
//进行接口测试传参
......@@ -40,7 +40,7 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase {
balance = balance + bonus;
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")));
logger.info("实际余额为"+balanceNew);
Assert.assertEquals(balanceNew,balance,"全局红包增加账户余额失败");
......@@ -48,17 +48,17 @@ public class 全局红包账户_DuibaTest extends DuibaTestBase {
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();
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(7498,orderId,device);
response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30;
while(i>0&&(result.equals("0"))){
Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(7498,orderId,device);
result = String.valueOf(response.jsonPath().getString("result"));
i--;
response.prettyPrint();
......
......@@ -43,10 +43,10 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase {
//数据库删除
try {
//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:[奖品发放限制测试_每日]数据处理:删除每日中奖记录
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);
} catch (Exception e) {
System.out.println(e);
......@@ -59,12 +59,12 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase {
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.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.useBtnText")),"马上使用","第一次抽奖出奖文案失败");
......@@ -75,30 +75,30 @@ public class 奖品发放限制_DuibaTest extends DuibaTestBase {
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.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.useBtnText")),"马上使用","第一次抽奖出奖文案失败");
}
public Response 新活动工具接口传参(String activityId,String token,String device) throws Exception {
Response response = newActivityService.doJoin2(activityId,token);
public Response 新活动工具接口传参(int uid,String activityId,String token,String device) throws Exception {
Response response = newActivityService.doJoin2(uid,activityId,token);
response.prettyPrint();
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(uid,orderId,device);
response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30;
while(i>0&&(result.equals("0"))){
Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(uid,orderId,device);
result = String.valueOf(response.jsonPath().getString("result"));
i--;
response.prettyPrint();
......
......@@ -110,11 +110,20 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
response = newActivityService.getOrderStatus2(orderId,"iOS");
response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30;
while(i>0&&(result.equals("0"))){
// int i= 30;
// 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);
response = newActivityService.getOrderStatus2(orderId,"iOS");
result = String.valueOf(response.jsonPath().getString("result"));
i--;
response.prettyPrint();
}
......@@ -273,17 +282,17 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
}
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();
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(7500,orderId,device);
response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30;
while(i>0&&(result.equals("0"))){
Thread.sleep(1000);
response = newActivityService.getOrderStatus2(orderId,device);
response = newActivityService.getOrderStatus2(7500,orderId,device);
result = String.valueOf(response.jsonPath().getString("result"));
i--;
response.prettyPrint();
......
......@@ -49,6 +49,7 @@ public class 页面元素测试_DuibaTest extends AbstractTestNGSpringContextTes
@Test(description = "校验接口返回的奖品")
public void 奖品显示测试() throws Exception {
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[1].prizeType"), "coupon", "校验显示优惠券失败");
Assert.assertEquals(response.jsonPath().getString("options[2].prizeType"), "object", "校验显示实物失败");
......
......@@ -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.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.exchangeStatus"),"1","兑换状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid3);
response.prettyPrint();
......
......@@ -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.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.exchangeStatus"),"1","兑换状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid1);
response.prettyPrint();
......
......@@ -395,10 +395,12 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
//第一次秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000);
//获取兑换结果
response = seckillNewService.orderStatus(orderId,uid);
response.prettyPrint();
String status = response.jsonPath().getString("data.status");
int i = 10;
//异步接口,直到兑换成功
......
......@@ -74,6 +74,7 @@ public class 秒杀商品_自有新商家充值_兑换限制_SeckillTest extends
//秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000);
response = seckillNewService.orderStatus(orderId,uid);
......
......@@ -503,7 +503,7 @@ public class ContractSign_signTest extends DuibaTestBase {
map.put("skinId","46");
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.prettyPrint();
response.prettyPrint();
try {
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/signContract/save接口失败");
} catch (Exception e) {
......
......@@ -45,13 +45,16 @@ public class 夺宝签到_signTest extends DuibaTestBase {
Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("false"));
//签到
response = signTreasureService.doSign(phaseId,id,uid);
//获取logId
String logId = response.jsonPath().getString("data.logId");
//获取签到结果
Thread.sleep(3000);
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);
Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("true"));
......
......@@ -45,7 +45,7 @@ public class 单品抽奖_中鼓励奖_AccessTest extends DuibaTestBase {
if(method.getName().equals("鼓励奖限制测试")) {
result = new Object[][]{
new Object[]{1, "27128", "1", "","鼓励奖优惠券数量1,数量用完则判断是否可中主奖"},
new Object[]{2, "27000", "99999", "1","鼓励奖限制,数量用完后用户无法再中鼓励奖"},
// new Object[]{2, "27000", "99999", "1","鼓励奖限制,数量用完后用户无法再中鼓励奖"},
};
}
return result;
......
......@@ -77,9 +77,9 @@ public class 自有单品抽奖_AccessTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("showUse"), "true", "校验是否展示马上使用失败");
Assert.assertEquals(response.jsonPath().getString("useBtnText"), "马上使用", "校验按钮文案展示失败");
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{
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成功");
break;
......
......@@ -154,7 +154,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT
String desc = response.jsonPath().getString("desc");
logger.info("code:"+code+",desc:"+desc);
//校验
Assert.assertEquals(code,"1001003","ZDH权益已过期 有问题" );
Assert.assertEquals(code,"1001029","ZDH权益已过期 有问题" );
response.prettyPrint();
logger.info(" ZDH核销二期权益已过期-->结束了");
}
......@@ -286,7 +286,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT
String desc = response.jsonPath().getString("desc");
logger.info("code:"+code+",desc:"+desc);
//校验
Assert.assertEquals(code,"1001002","2-ZDH权益未开始进行兑换( 有问题" );
Assert.assertEquals(code,"1001028","2-ZDH权益未开始进行兑换( 有问题" );
response.prettyPrint();
logger.info(" 2-ZDH权益未开始进行兑换(-->结束了");
}
......
......@@ -331,6 +331,31 @@ public class NewActivityService {
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 {
Map<String,String> map = new HashMap<>();
map.put("orderId",orderId);
......@@ -515,12 +540,12 @@ public class NewActivityService {
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.put("orderId",orderId);
map.put("answerData","[{\"id\":465,\"option\":3}]");
map.put("answerData","[{\"id\":463,\"option\":1}]");
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{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
......
......@@ -28,7 +28,10 @@ db.password= 2Fe36uDap8TMqtfzob3f1u8r2aK8qjdnwPP
//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://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
......
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