Commit 9fd3d239 authored by 马博's avatar 马博

Merge remote-tracking branch 'origin/master'

parents 1c8cea36 7d9b4b97
......@@ -5,18 +5,21 @@ public class Database {
//主订单库
public static String orders_consumer = "orders_consumer";
//主订单分表
public static String orders = "orders_0614";
public static String orders2 = "orders_0874";
public static String orders3 = "orders_0693";
public static String orders4 = "orders_0208";
public static String orders5 = "orders_0209";
public static String orders6 = "orders_0210";
public static String orders7 = "orders_0211";
public static String orders8 = "orders_0090";
public static String orders9 = "orders_0203";
public static String orders10 = "orders_0411";
public static String orders11 = "orders_0182";
public static String orders12 = "orders_0715";
public static String orders13 = "orders_0717";
public static String orders14 = "orders_0712";
public static String orders15 = "orders_0718";
public static String orders16 = "orders_0721";
......
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import http.cases.ExchangeTest.CheckTemplet;
import http.cases.ExchangeTest.Database;
import http.service.Authorization;
import http.service.app.gawService;
import http.service.app.MobileService;
......@@ -146,6 +147,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "3个Q币用户兑换限制每月1次")
public void Q币用户每月兑换限制测试() throws Exception{
......@@ -164,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("用户成功兑换一次");
//再次兑换
Thread.sleep(3000);
Thread.sleep(4000);
try{
response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,"123456789");
response.prettyPrint();
......@@ -242,6 +244,86 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "Q币档位篡改测试")
public void Q币档位篡改测试() throws Exception{
int uid = 7293;
String actualCredits = "3";
String degreeId = "100";
String appItemId = "196922";
String credits = "3";
String qq = "806854056";
String message = "";
//Q币兑换,档位参数不存在
try{
Response response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"档位不存在\""),"校验message失败");
logger.info("校验Q币档位篡改无法兑换成功");
}
@Test(description = "Q币用户id篡改测试")
public void Q币用户id篡改测试() throws Exception{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int uid1 = 7084;
int uid2 = 7292;
String actualCredits = "3";
String degreeId = "3";
String appItemId = "196922";
String credits = "3";
String qq = "806854056";
String message = "";
//话费兑换, 大富翁app已上架Q币
Response response = gawService.qbExchange(uid1,actualCredits,degreeId,appItemId,credits,qq);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
//查询数据库
Thread.sleep(3000);
Map<String,Object> mapOrderId = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+ Database.orders16 + " where id = " + orderId);
String orderStatus = String.valueOf(mapOrderId.get("status"));
String orderappId = String.valueOf(mapOrderId.get("app_id"));
String orderCredits = String.valueOf(mapOrderId.get("credits"));
logger.info("订单积分:" + orderCredits);
Assert.assertEquals(orderStatus,"consume_success","校验status失败");
Assert.assertEquals(orderappId,"1","校验appId失败");
Assert.assertEquals(orderCredits,"300","校验credits失败");
logger.info("校验Q币用户id1篡改兑换成功");
//Q币兑换,lv测试应用88app未上架Q币
try{
Response response2 = gawService.qbExchange(uid2,actualCredits,degreeId,appItemId,credits,qq);
response2.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"兑吧加钱购商品不可以加入到开发者商品中\""),"校验message失败"); //这个提示很奇怪
logger.info("校验Q币用户id2篡改无法兑换成功");
}
public Response Q币兑换(int uid, String actualCredits, String degreeId, String appItemId, String credits, String qq) throws Exception {
Response response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq);
......
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import http.cases.ExchangeTest.CheckTemplet;
import http.cases.ExchangeTest.Database;
import http.service.Authorization;
import http.service.app.gawService;
import http.service.app.MobileService;
......@@ -240,6 +241,86 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
@Test(description = "话费档位篡改测试")
public void 话费档位篡改测试() throws Exception{
int uid = 7268;
String actualCredits = "2";
String degreeId = "100";
String appItemId = "196923";
String credits = "2";
String message = "";
//话费兑换,档位参数不存在
try{
Thread.sleep(3000);
Response response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"档位不存在\""),"校验message失败");
logger.info("校验话费档位篡改无法兑换成功");
}
@Test(description = "话费用户id篡改测试")
public void 话费用户id篡改测试() throws Exception{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int uid1 = 7085;
int uid2 = 7292;
String actualCredits = "5";
String degreeId = "10";
String appItemId = "196923";
String credits = "5";
String message = "";
//话费兑换, 大富翁app已上架话费
Response response = gawService.phonebillExchange(uid1,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
//查询数据库
Thread.sleep(3000);
Map<String,Object> mapOrderId = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+ Database.orders15 + " where id = " + orderId);
String orderStatus = String.valueOf(mapOrderId.get("status"));
String orderappId = String.valueOf(mapOrderId.get("app_id"));
String orderCredits = String.valueOf(mapOrderId.get("credits"));
logger.info("订单积分:" + orderCredits);
Assert.assertEquals(orderStatus,"consume_success","校验status失败");
Assert.assertEquals(orderappId,"1","校验appId失败");
Assert.assertEquals(orderCredits,"1000","校验credits失败");
logger.info("校验话费用户id1篡改兑换成功");
//话费兑换,lv测试应用88app未上架话费
try{
Response response2 = gawService.phonebillExchange(uid2,actualCredits,degreeId,appItemId,credits);
response2.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
logger.info("校验话费用户id2篡改无法兑换成功");
}
public Response 话费兑换(int uid, String actualCredits, String degreeId, String appItemId, String credits) throws Exception {
Response response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
......
......@@ -302,6 +302,56 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "支付宝用户id修改测试")
public void 支付宝用户id篡改测试() throws Exception{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int uid1 = 7204;
int uid2 = 7291;
String actualCredits = "10";
String degreeId = "10";
String appItemId = "196921";
String credits = "10";
String message = "";
//支付宝兑换, 大富翁app已上架支付宝
Response response = gawService.alipayExchange(uid1,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
//查询数据库
Thread.sleep(3000);
Map<String,Object> mapOrderId = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+ Database.orders13 + " where id = " + orderId);
String orderStatus = String.valueOf(mapOrderId.get("status"));
String orderappId = String.valueOf(mapOrderId.get("app_id"));
String orderCredits = String.valueOf(mapOrderId.get("credits"));
logger.info("订单积分:" + orderCredits);
Assert.assertEquals(orderStatus,"consume_success","校验status失败");
Assert.assertEquals(orderappId,"1","校验appId失败");
Assert.assertEquals(orderCredits,"1000","校验credits失败");
logger.info("校验支付宝用户id1篡改兑换成功");
//支付宝兑换,lv测试应用88app未上架支付宝
try{
Response response2 = gawService.alipayExchange(uid2,actualCredits,degreeId,appItemId,credits);
response2.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"商家未采购商品\""),"校验message失败");
logger.info("校验支付宝用户id2篡改无法兑换成功");
}
......
......@@ -506,6 +506,64 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "兑吧卡密用户id篡改测试")
public void 卡密用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 11;
String appItemId = "197045";
String itemId = "32657";
String skuId = "173";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//卡密兑换
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验卡密用户id篡改无法兑换成功");
}
@Test(description = "兑吧卡密skuId篡改测试")
public void 卡密skuId篡改测试() throws Exception{
String appItemId = "197045";
String itemId = "32657";
String skuId = "106";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验卡密skuId篡改无法兑换成功");
}
}
......@@ -498,5 +498,62 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
@Test(description = "新优惠券用户id篡改测试")
public void 优惠券用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 10;
String appItemId = "197044";
String itemId = "32656";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,"172");
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验优惠券用户id篡改无法兑换成功");
}
@Test(description = "新优惠券skuId篡改测试")
public void 优惠券skuId篡改测试() throws Exception{
int uid = 7289;
String appItemId = "197044";
String itemId = "32656" ;
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,"105");
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验优惠券skuId篡改无法兑换成功");
}
}
......@@ -218,7 +218,6 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
this.优惠券兑换("174928","30319",uid);
//每日限额用完,无法再次兑换
Thread.sleep(3000);
Map<String,String> map = new HashMap<>();
map.put("appItemId","174928");
map.put("itemId","30319");
......@@ -230,7 +229,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
//获取按钮状态
Response detailResponse = mobileService.detail(authorization.dafuwengLogin(uid),"30319");
detailResponse.prettyPrint();
// detailResponse.prettyPrint();
String exchangeText = MatcherString.getString(detailResponse.asString(), "\"exchangeText\":\"(.*?)\",", 1);
Assert.assertEquals(response.jsonPath().getString("message"),"今日已兑完,明天再来哦(14)","校验message失败");
......
......@@ -576,5 +576,59 @@ public class 自有新优惠券_兑换限制测试_ExchangeTest extends CheckTem
@Test(description = "新优惠券用户id篡改测试")
public void 优惠券用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 6999;
String appItemId = "197048";
String message = "";
//优惠券兑换
try{
Response response = gawService.couponExchange(uid,appItemId,175);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验优惠券用户id篡改无法兑换成功");
}
@Test(description = "新优惠券skuId篡改测试")
public void 优惠券skuId篡改测试() throws Exception{
int uid = 7028;
String appItemId = "197048";
String message = "";
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(uid,appItemId,105);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验优惠券skuId篡改无法兑换成功");
}
}
......@@ -480,6 +480,58 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
@Test(description = "卡密用户id篡改测试")
public void 卡密用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 6997;
String appItemId = "197049";
String message = "";
//卡密兑换
try{
Response response = gawService.couponExchange(uid,appItemId,176);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验卡密用户id篡改无法兑换成功");
}
@Test(description = "卡密skuId篡改测试")
public void 卡密skuId篡改测试() throws Exception{
int uid = 7294;
String appItemId = "197049";
String message = "";
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(uid,appItemId,105);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验卡密skuId篡改无法兑换成功");
}
}
......@@ -443,4 +443,61 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec
}
@Test(description = "新虚拟商品用户id篡改测试")
public void 虚拟商品用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 6970;
String appItemId = "197050";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//虚拟商品兑换
try{
Response response = gawService.virtualExchange(cookies, appItemId,177);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验虚拟商品用户id篡改无法兑换成功");
}
@Test(description = "新虚拟商品skuId篡改测试")
public void 虚拟商品skuId篡改测试() throws Exception{
int uid = 7295;
String appItemId = "197050";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.virtualExchange(cookies, appItemId,105);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验虚拟商品skuId篡改无法兑换成功");
}
}
......@@ -201,7 +201,7 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
@Test(description = "优惠券--活动未开始")
public void 优惠券活动未开始() throws Exception{
String appItemId="195542";
String appItemId="195541";
String itemId=null;
String message = "";
String actId = "29";
......@@ -240,7 +240,7 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
@Test(description = "优惠券--活动已结束")
public void 优惠券活动已结束() throws Exception{
String appItemId="195543";
String appItemId="195542";
String itemId=null;
String message = "";
String actId = "30";
......
......@@ -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积分&nbsp;+&nbsp;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;
}
}
}
......@@ -60,6 +60,7 @@ public class RedisUtil {
map.put("key",key);
Response response = given().params(map).get("http://activity.m.duibatest.com.cn/seedRedPacket/clearObjectKey");
response.prettyPrint();
}
public static void main(String[] args) {
......
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