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

Merge branch 'duiba_wenyan'

parents 7a48f336 53fcc10f
......@@ -50,9 +50,9 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
Object[][] result = null;
if (method.getName().equals("日期兑换限制测试")) {
result = new Object[][]{
new Object[]{1, "193805", "32506", "兑吧新实物日期兑换限制未开始"}, //case1
new Object[]{2, "193806", "32507", "兑吧新实物日期兑换限制进行中"}, //case2
new Object[]{3, "193807", "32508", "兑吧新实物日期兑换限制已结束"}, //case3
new Object[]{1, "193805", "32506", "27", "兑吧新实物日期兑换限制未开始"}, //case1
new Object[]{2, "193806", "32507", "28","兑吧新实物日期兑换限制进行中"}, //case2
new Object[]{3, "193807", "32508", "29","兑吧新实物日期兑换限制已结束"}, //case3
};
}
return result;
......@@ -64,10 +64,11 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String appItemId = "192950";
String itemId = "32439";
String skuId = "16";
String message = "";
try{
//第一次兑换
Response response = gawService.objectExchange(uid,appItemId,itemId);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
response = tawService.orderStatus(orderId,uid);
......@@ -91,7 +92,7 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
//第二次兑换
Thread.sleep(3000);
try{
response = gawService.objectExchange(uid,appItemId,itemId);
response = gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -123,11 +124,12 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String appItemId = "193756";
String itemId = "32500";
String skuId = "18";
String message = "";
try{
//第一次兑换
Response response = gawService.objectExchange(uid,appItemId,itemId);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
response = tawService.orderStatus(orderId,uid);
......@@ -151,7 +153,7 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
//第二次兑换
Thread.sleep(3000);
try{
response = gawService.objectExchange(uid,appItemId,itemId);
response = gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -185,11 +187,12 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String appItemId = "193757";
String itemId = "32501";
String skuId = "19";
String message = "";
try{
//第一次兑换
Response response = gawService.objectExchange(uid,appItemId,itemId);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
response = tawService.orderStatus(orderId,uid);
......@@ -213,7 +216,7 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
//第二次兑换
Thread.sleep(3000);
try{
response = gawService.objectExchange(uid,appItemId,itemId);
response = gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -247,11 +250,12 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String appItemId = "193801";
String itemId = "32505";
String skuId = "23";
String message = "";
try{
//第一次兑换
Response response = gawService.objectExchange(uid,appItemId,itemId);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
response = tawService.orderStatus(orderId,uid);
......@@ -275,7 +279,7 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
//第二次兑换
Thread.sleep(3000);
try{
response = gawService.objectExchange(uid,appItemId,itemId);
response = gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -307,18 +311,19 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
* @param caseNum 用例编号
* @param appItemId 商品入库Id
* @param itemId 商品id
* @param skuId skuId
* @param caseName 用例名称打印
* @throws Exception
*/
@Test(dataProvider = "providerMethod")
public void 日期兑换限制测试(int caseNum, String appItemId, String itemId, String caseName) throws Exception{
public void 日期兑换限制测试(int caseNum, String appItemId, String itemId, String skuId, String caseName) throws Exception{
String message = "";
logger.info(caseName);
//兑换
try{
Response response = gawService.objectExchange(uid,appItemId,itemId);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -362,11 +367,12 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String appItemId = "193808";
String itemId = "32509";
String skuId = "30";
String message = "";
//会员等级无法兑换
try{
Response response =gawService.objectExchange(uid,appItemId,itemId);
Response response =gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -375,7 +381,7 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
logger.info(message);
//会员等级可兑换,vip=5
Response response = gawService.objectExchange(authorization.generateSignAutoLogin("vc2HvzM439YBQiB6LVy4uxC4uWm",7001),appItemId,itemId,"16");
Response response = gawService.objectExchange(authorization.generateSignAutoLogin("vc2HvzM439YBQiB6LVy4uxC4uWm",7001),appItemId,itemId,skuId);
response.prettyPrint();
Assert.assertTrue(message.contains("未达到会员等级要求"),"校验message失败");
......@@ -454,12 +460,13 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
int uid = 8;
String appItemId = "197040";
String itemId = "32655" ;
String skuId = "163";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//实物兑换
try{
Response response = gawService.objectExchange(cookies,appItemId,itemId,"163");
Response response = gawService.objectExchange(cookies,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......
......@@ -36,9 +36,9 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
Object[][] result = null;
if (method.getName().equals("日期兑换限制测试")) {
result = new Object[][]{
new Object[]{1, "193809", "", "兑吧新实物日期兑换限制未开始"}, //case1
new Object[]{2, "194143", "", "兑吧新实物日期兑换限制进行中"}, //case2
new Object[]{3, "194144", "", "兑吧新实物日期兑换限制已结束"}, //case3
new Object[]{1, "193809", "", "31","兑吧新实物日期兑换限制未开始"}, //case1
new Object[]{2, "194143", "", "72","兑吧新实物日期兑换限制进行中"}, //case2
new Object[]{3, "194144", "", "73", "兑吧新实物日期兑换限制已结束"}, //case3
};
}
return result;
......@@ -171,6 +171,8 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
}
@Test(description = "新自有实物每人限购---周期限制")
public void 每人限购周期限制() throws Exception{
String appItemId = "193803";
......@@ -274,22 +276,25 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
}
/**
* @param caseNum 用例编号
* @param appItemId 商品入库Id
* @param itemId 商品id
* @param skuId skuId
* @param caseName 用例名称打印
* @throws Exception
*/
@Test(dataProvider = "providerMethod")
public void 日期兑换限制测试(int caseNum, String appItemId, String itemId, String caseName) throws Exception{
public void 日期兑换限制测试(int caseNum, String appItemId, String itemId, String skuId, String caseName) throws Exception{
String message = "";
logger.info(caseName);
//兑换
try{
Thread.sleep(3000);
Response response = gawService.objectExchange(uid,appItemId,itemId);
Response response = gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
......@@ -362,12 +367,12 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
String appItemId = "193810";
String itemId = "null";
String message = "";
String skuId="27";
String skuId="32";
//会员等级无法兑换
try{
//会员等级可兑换,vip=5
Thread.sleep(3000);
Response response =gawService.objectExchange(uid,appItemId,itemId);
Response response =gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -415,11 +420,12 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
int uid = 7204;
String appItemId = "197041";
String itemId = null ;
String skuId = "159";
String message = "";
//实物兑换
try{
Response response =gawService.objectExchange(uid,appItemId,itemId);
Response response =gawService.objectExchange(uid,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
......@@ -441,9 +447,11 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
int uid = 7288;
String appItemId = "197041";
String itemId = null ;
String skuId = "159";
//实物兑换,积分传0
Response response =gawService.objectExchange(uid,appItemId,itemId,"159","0","0");
Response response =gawService.objectExchange(uid,appItemId,itemId,skuId,"0","0");
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
......
......@@ -53,6 +53,13 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
new Object[]{2, "2104", "商品分组-自有新商品"}, //case2
};
}
if (method.getName().equals("手机端商品分组组件老商品展示")){
result = new Object[][]{
new Object[]{1, "2124", "商品分组-兑吧老商品"}, //case1
new Object[]{2, "2125", "商品分组-自有老商品"}, //case2
};
}
return result;
}
......@@ -177,7 +184,7 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
/**
/**
* @param caseNum 用例编号
* @param classifyId 商品分组Id
* @param caseName 用例名称打印
......@@ -239,5 +246,68 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
/**
* @param caseNum 用例编号
* @param classifyId 商品分组Id
* @param caseName 用例名称打印
* @throws Exception
*/
@Test(dataProvider = "providerMethod")
public void 手机端商品分组组件老商品展示(int caseNum, String classifyId, String caseName) throws Exception{
logger.info("---" + caseName + "---");
//app:lv测试应用33
Map cookies = authorization.dafuwengLogin(6569);
Response response = chwVisualEditorService.itemsList(cookies,classifyId);
response.prettyPrint();
switch (caseNum){
case 1:
//手机端接口排序与前端不一致
Assert.assertEquals(response.jsonPath().getString("data.list[0].title"),"【自动化勿动】兑吧新优惠券普通券码跳转","校验第一个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].titleDownTxt"),"100积分","校验第一个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[1].title"),"【自动化勿动】兑吧卡密跳转按钮","校验第二个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[1].titleDownTxt"),"200积分","校验第二个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[2].title"),"【自动化勿动】兑吧新实物","校验第三个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[2].titleDownTxt"),"300积分","校验第三个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[3].title"),"支付宝充值","校验第四个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[3].titleDownTxt"),"10万积分","校验第四个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[4].title"),"10元话费","校验第五个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[4].titleDownTxt"),"1000积分","校验第五个商品credits失败");
logger.info("校验商品分组1-兑吧新商品成功");
break;
case 2:
Assert.assertEquals(response.jsonPath().getString("data.list[0].title"),"【自动化勿动】自有新优惠券跳转链接","校验第一个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].titleDownTxt"),"100积分","校验第一个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[1].title"),"【自动化勿动】自有新实物加钱购","校验第二个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[1].titleDownTxt"),"150积分 + 10.00元","校验第二个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[2].title"),"【自动化勿动】自有充值商品","校验第三个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[2].titleDownTxt"),"300积分","校验第三个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.list[3].title"),"【自动化勿动】自有卡密","校验第四个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.list[3].titleDownTxt"),"550积分","校验第四个商品credits失败");
logger.info("校验商品分组2-自有新商品成功");
break;
}
}
}
......@@ -31,13 +31,13 @@ public class gawService {
//普通实物兑换接口
public Response objectExchange(int uid, String appItemId,String itemId) throws Exception {
public Response objectExchange(int uid, String appItemId,String itemId, String skuId) throws Exception {
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
List<Map> list = new ArrayList<>();
mapList.put("itemId",itemId);
mapList.put("skuId",16);
mapList.put("skuId",skuId);
mapList.put("appItemId",appItemId);
mapList.put("credits","100");
mapList.put("price",0);
......
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