Commit 99064857 authored by wangxiaoshuang's avatar wangxiaoshuang

wxs

parent 13d49538
...@@ -35,18 +35,21 @@ public class 秒杀商品_自有新优惠券兑换 extends DuibaTestBase { ...@@ -35,18 +35,21 @@ public class 秒杀商品_自有新优惠券兑换 extends DuibaTestBase {
public void beforeMethod(){ public void beforeMethod(){
try { try {
//秒杀 //秒杀
// jdbc.update("UPDATE tb_stock set stock = 100 where stock_id = 965636062781920123");//每次设置商品库存,防止售罄无法兑换 jdbc.update("UPDATE stock.tb_stock set stock = 100 where stock_id = 965676925749670068");//每次设置商品库存,防止售罄无法兑换
// jdbc.update("UPDATE tb_seckill_act_sku_data set sec_limit = 9999 where act_id = 25 and id = 14");//每次设置活动秒杀上限数,防止兑换达到上限无法兑换 jdbc.update("UPDATE seckill.tb_seckill_act_sku_data set sec_limit = 9999 where act_id = 25 and id = 14");//每次设置活动秒杀上限数,防止兑换达到上限无法兑换
// jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 25 and app_id =22563 and app_item_id=195538"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 25 and app_id =22563 and app_item_id=195538");
//秒杀限制 //秒杀限制
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 17 and app_id =22563 and app_item_id=195468"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 17 and app_id =22563 and app_item_id=195468");
//sku上限 //sku上限
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 19 and app_id =22563 and app_item_id=195533"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 19 and app_id =22563 and app_item_id=195533");
//商品售罄 //商品售罄
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 20 and app_id =22563 and app_item_id=195534"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 20 and app_id =22563 and app_item_id=195534");
Thread.sleep(2000);
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} }
} }
...@@ -62,6 +65,7 @@ public class 秒杀商品_自有新优惠券兑换 extends DuibaTestBase { ...@@ -62,6 +65,7 @@ public class 秒杀商品_自有新优惠券兑换 extends DuibaTestBase {
//秒杀 //秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId); Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
String orderId = response.jsonPath().getString("data.orderId"); String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000);
response = seckillNewService.orderStatus(orderId,uid); response = seckillNewService.orderStatus(orderId,uid);
String status = response.jsonPath().getString("data.status"); String status = response.jsonPath().getString("data.status");
String payCreditsStatus = response.jsonPath().getString("data.payCreditsStatus"); String payCreditsStatus = response.jsonPath().getString("data.payCreditsStatus");
......
...@@ -32,19 +32,19 @@ public class 秒杀商品_自有新商家充值兑换 extends DuibaTestBase { ...@@ -32,19 +32,19 @@ public class 秒杀商品_自有新商家充值兑换 extends DuibaTestBase {
String endtiem = DateUtils.getDayStr(date) + " 23:59:59"; String endtiem = DateUtils.getDayStr(date) + " 23:59:59";
@BeforeMethod @BeforeMethod
public void beforeMethod(){ public void beforeMethod() throws InterruptedException {
try { try {
//正常秒杀 //正常秒杀
// jdbc.update("UPDATE tb_stock set stock = 100 where stock_id = 965636062781920123");//每次设置商品库存,防止售罄无法兑换 jdbc.update("UPDATE stock.tb_stock set stock = 100 where stock_id = 965677775095420125");//每次设置商品库存,防止售罄无法兑换
// jdbc.update("UPDATE tb_seckill_act_sku_data set sec_limit = 9999 where act_id = 26 and id = 15");//每次设置活动秒杀上限数,防止兑换达到上限无法兑换 jdbc.update("UPDATE seckill.tb_seckill_act_sku_data set sec_limit = 9999 where act_id = 26 and id = 15");//每次设置活动秒杀上限数,防止兑换达到上限无法兑换
// jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 26 and app_id =22563 and app_item_id=195539"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 26 and app_id =22563 and app_item_id=195539");
//秒杀限制 //秒杀限制
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 23 and app_id =22563 and app_item_id=195536"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 23 and app_id =22563 and app_item_id=195536");
//sku上限 //sku上限
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 22 and app_id =22563 and app_item_id=195535"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 22 and app_id =22563 and app_item_id=195535");
//商品售罄 //商品售罄
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 21 and app_id =22563 and app_item_id=195532"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 21 and app_id =22563 and app_item_id=195532");
Thread.sleep(2000);
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -63,6 +63,7 @@ public class 秒杀商品_自有新商家充值兑换 extends DuibaTestBase { ...@@ -63,6 +63,7 @@ public class 秒杀商品_自有新商家充值兑换 extends DuibaTestBase {
//秒杀 //秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId); Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
String orderId = response.jsonPath().getString("data.orderId"); String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000);
response = seckillNewService.orderStatus(orderId,uid); response = seckillNewService.orderStatus(orderId,uid);
String status = response.jsonPath().getString("data.status"); String status = response.jsonPath().getString("data.status");
String payCreditsStatus = response.jsonPath().getString("data.payCreditsStatus"); String payCreditsStatus = response.jsonPath().getString("data.payCreditsStatus");
...@@ -76,9 +77,15 @@ public class 秒杀商品_自有新商家充值兑换 extends DuibaTestBase { ...@@ -76,9 +77,15 @@ public class 秒杀商品_自有新商家充值兑换 extends DuibaTestBase {
status = response.jsonPath().getString("data.status"); status = response.jsonPath().getString("data.status");
i--; i--;
} }
//校验成功 //待发货或直接成功校验成功
if(status.equals("wait_delivery")){
Assert.assertEquals(status,"wait_delivery","校验轮询结果status失败"); Assert.assertEquals(status,"wait_delivery","校验轮询结果status失败");
Assert.assertEquals(payCreditsStatus,"1","校验轮询结果payCreditsStatus失败"); Assert.assertEquals(payCreditsStatus,"1","校验轮询结果payCreditsStatus失败");
}
else if(status.equals("success")) {
Assert.assertEquals(status,"success","校验轮询结果status失败");
Assert.assertEquals(payCreditsStatus,"1","校验轮询结果payCreditsStatus失败");
}
logger.info("校验秒杀商品--秒杀成功"); logger.info("校验秒杀商品--秒杀成功");
} }
......
...@@ -37,18 +37,20 @@ public class 秒杀商品_自有新实物兑换 extends DuibaTestBase { ...@@ -37,18 +37,20 @@ public class 秒杀商品_自有新实物兑换 extends DuibaTestBase {
public void beforeMethod(){ public void beforeMethod(){
try { try {
//正常秒杀 //正常秒杀
jdbc.update("UPDATE tb_stock set stock = 100 where stock_id = 965636062781920123");//每次设置商品库存,防止售罄无法兑换 jdbc.update("UPDATE stock.tb_stock set stock = 100 where stock_id = 965636062781920123");//每次设置商品库存,防止售罄无法兑换
jdbc.update("UPDATE tb_seckill_act_sku_data set sec_limit = 9999 where act_id = 24 and id = 13");//每次设置活动秒杀上限数,防止兑换达到上限无法兑换 jdbc.update("UPDATE seckill.tb_seckill_act_sku_data set sec_limit = 9999 where act_id = 24 and id = 13");//每次设置活动秒杀上限数,防止兑换达到上限无法兑换
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 13 and app_id =22563 and app_item_id=195537"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 24 and app_id =22563 and app_item_id=195537");
//秒杀限制 //秒杀限制
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 13 and app_id =22563 and app_item_id=195387"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 13 and app_id =22563 and app_item_id=195387");
//sku上限 //sku上限
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 14 and app_id =22563 and app_item_id=195385"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 14 and app_id =22563 and app_item_id=195385");
//商品售罄 //商品售罄
jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 15 and app_id =22563 and app_item_id=195410"); jdbc.update("UPDATE seckill.tb_seckill_act_conf set gmt_start = '"+starttime+"', gmt_end = '"+endtiem+"' WHERE id = 15 and app_id =22563 and app_item_id=195410");
Thread.sleep(2000);
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} }
} }
...@@ -64,6 +66,7 @@ public class 秒杀商品_自有新实物兑换 extends DuibaTestBase { ...@@ -64,6 +66,7 @@ public class 秒杀商品_自有新实物兑换 extends DuibaTestBase {
//秒杀 //秒杀
Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId); Response response = seckillNewService.exchange(itemId,appItemId,uid,skuId,actId);
String orderId = response.jsonPath().getString("data.orderId"); String orderId = response.jsonPath().getString("data.orderId");
Thread.sleep(1000);
response = seckillNewService.orderStatus(orderId,uid); response = seckillNewService.orderStatus(orderId,uid);
String status = response.jsonPath().getString("data.status"); String status = response.jsonPath().getString("data.status");
String payCreditsStatus = response.jsonPath().getString("data.payCreditsStatus"); String payCreditsStatus = response.jsonPath().getString("data.payCreditsStatus");
......
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