Commit e8a8d5f3 authored by 赵然's avatar 赵然

zr

parents 81dea709 52a2b2fd
......@@ -66,7 +66,7 @@ public class MysqlConnPool {
* @throws SQLException
*/
public Map<String, Object> findSimpleResult(String sql, Object ...params) throws SQLException {
log.info("findSimpleResult开始~~~~~~~~~~~~~~~~~~~~~");
log.info("findSimpleResult开始~~~~~~~~~~~~~~~~~~~~~"+sql);
Map<String, Object> map = null;
try(Connection conn = bds.getConnection()){
......@@ -107,6 +107,7 @@ public class MysqlConnPool {
log.info("findSimpleResult"+e.toString());
log.info("test");
log.info("bds"+bds.toString());
throw e;
}
log.info("findSimpleResult结束~~~~~~~~~~~~~~~~~~~~~");
......@@ -120,6 +121,7 @@ public class MysqlConnPool {
* @throws SQLException
*/
public boolean update(String sql, Object ...params) throws SQLException{
log.info("update开始~~~~~~~~~~~~~~~~~~~~~"+sql);
Connection conn=null;
boolean flag = false;
try{
......@@ -136,6 +138,7 @@ public class MysqlConnPool {
flag = result > 0 ? true : false;
}catch(Exception e){
e.printStackTrace();
throw e;
}finally {
if(conn!=null) conn.close();
}
......@@ -150,6 +153,8 @@ public class MysqlConnPool {
* @throws SQLException
*/
public List<Map<String, Object>> findModeResult(String sql, Object ...params) throws SQLException{
log.info("findModeResult开始~~~~~~~~~~~~~~~~~~~~~"+sql);
Connection conn=null;
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
try{
......@@ -178,6 +183,7 @@ public class MysqlConnPool {
}
}catch (Exception e){
e.printStackTrace();
throw e;
}finally {
if(conn!=null) conn.close();
}
......
......@@ -33,7 +33,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public void 出奖自有实物() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900849714500524");
int remaining = (int)map.get("stock");
long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("21803","h5ps61");
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId);
......@@ -61,7 +61,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread.sleep(1000);
map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900849714500524");
int remainingNew = (int)map.get("stock");
long remainingNew = (long)map.get("stock");
Assert.assertEquals(remaining-1,remainingNew,"扣库存失败");
......@@ -170,7 +170,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public void 出奖自有虚拟商品() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900860200070105");
int remaining = (int)map.get("stock");
long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("21793","h5ps61");
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId);
......@@ -198,7 +198,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread.sleep(1000);
map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900860200070105");
int remainingNew = (int)map.get("stock");
long remainingNew = (long)map.get("stock");
Assert.assertEquals(remaining-1,remainingNew,"扣库存失败");
}
......@@ -206,7 +206,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test
public void 出奖兑吧实物() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900440770170322 ");
int remaining = (int)map.get("stock");
long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("22637","h5ps61");
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId);
......@@ -233,7 +233,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread.sleep(1000);
map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900440770170322 ");
int remainingNew = (int)map.get("stock");
long remainingNew = (long)map.get("stock");
Assert.assertEquals(remaining-1,remainingNew,"扣库存失败");
......
package http.cases.ExchangeTest;
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import base.DuibaBase;
import base.DuibaBases;
import http.cases.ExchangeTest.CheckTemplet;
import http.service.Activity.ManagerService;
import http.service.Authorization;
import http.service.app.*;
......@@ -108,6 +109,8 @@ public class Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
Assert.assertTrue(status.equals("success"),"校验订单状态失败");
logger.info("校验兑换订单状态正确");
}
@Test
public void qbExchange_积分不足() throws Exception {
int uid = 3086;
......@@ -130,6 +133,8 @@ public class Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test
public void 开发者余额不足测试() throws Exception{
int uid = 3490;
......
package http.cases.ExchangeTest;
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import base.DuibaLog;
import http.cases.ExchangeTest.CheckTemplet;
import http.service.Activity.ManagerService;
import http.service.Authorization;
import http.service.app.*;
......
package http.cases.ExchangeTest;
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import http.cases.ExchangeTest.CheckTemplet;
import http.service.Authorization;
import http.service.app.CouponExchangeService;
import http.service.app.CrecordService;
......
package http.cases.ExchangeTest;
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import base.DuibaBase;
import base.DuibaBases;
import http.cases.ExchangeTest.CheckTemplet;
import http.cases.ExchangeTest.Database;
import http.service.Authorization;
import http.service.Manager.ADeveloperService;
import http.service.app.AlipayExchangeService;
......@@ -87,8 +89,9 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("订单号:" + orderId);
//订单审核,判断是否在待审核节点
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"));
Thread.sleep(300);
logger.info("数据库订单节点:" + flowWork);
Assert.assertEquals(flowWork,"Audit-started","校验订单审核节点失败");
String orderIdmain = String.valueOf(mapOrder.get("order_num"));
......
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import http.cases.ExchangeTest.CheckTemplet;
import http.service.Authorization;
import http.service.app.gawService;
import http.service.app.MobileService;
import http.service.app.tawService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import utils.MatcherString;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
/**
* Created by lvwenyan on 2019/5/30
*/
public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTemplet {
@Autowired
gawService gawService;
@Autowired
Authorization authorization;
@Autowired
tawService tawService;
@Autowired
MobileService mobileService;
@Test(description = "1元话费用户兑换限制永久1次")
public void 话费用户永久兑换限制测试() throws Exception{
int uid = 7280;
String actualCredits = "10";
String degreeId = "1";
String appItemId = "195998";
String credits = "10";
String message = "";
try{
//支付宝兑换
Response response = this.话费兑换(uid,actualCredits,degreeId,appItemId,credits);
Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败");
logger.info("用户成功兑换一次");
//再次兑换
Thread.sleep(3000);
try{
response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
//获取按钮状态
Response detailResponse = mobileService.detail(authorization.dafuwengLogin(uid),"1");
String btnText = MatcherString.getString(detailResponse.asString(), "\"1\":\\{\"btnText\":\"(.*?)\",", 1);
logger.info("再次兑换按钮:" + btnText);
Assert.assertTrue(message.contains("\"desc\":\"已兑完\""),"校验用户兑换限制失败");
Assert.assertEquals(btnText,"已兑换","校验马上兑换按钮状态失败");
logger.info("校验话费1元用户永久兑换限制成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 1 and consumer_id = 100147134 and sub_key = 1");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 1 and consumer_id = 100147134 and sub_key = 1");
}
}
@Test(description = "2元话费用户兑换限制每天1次")
public void 话费用户每天兑换限制测试() throws Exception{
int uid = 7281;
String actualCredits = "20";
String degreeId = "2";
String appItemId = "195998";
String credits = "20";
String message = "";
try{
//支付宝兑换
Response response = this.话费兑换(uid,actualCredits,degreeId,appItemId,credits);
Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败");
logger.info("用户成功兑换一次");
//再次兑换
Thread.sleep(3000);
try{
response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
//获取按钮状态
Response detailResponse = mobileService.detail(authorization.dafuwengLogin(uid),"1");
String btnText = MatcherString.getString(detailResponse.asString(), "\"2\":\\{\"btnText\":\"(.*?)\",", 1);
logger.info("再次兑换按钮:" + btnText);
Assert.assertTrue(message.contains("\"desc\":\"已兑完\""),"校验用户兑换限制失败");
Assert.assertEquals(btnText,"今日已兑换","校验马上兑换按钮状态失败");
logger.info("校验话费2元用户每天兑换限制成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
//获取当前日期时间,再减一天
Date date=new Date();
Calendar calendar=Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -1);
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
logger.info("当前时间-1天:" + dateFormat.format(calendar.getTime()));
//更新表记录,修改记录为前一天
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 1 and consumer_id = 100147136 ORDER BY id DESC LIMIT 1";
jdbc.update(sql);
}
}
@Test(description = "10元话费用户兑换限制每月1次")
public void 话费用户每月兑换限制测试() throws Exception{
int uid = 7282;
String actualCredits = "50";
String degreeId = "10";
String appItemId = "195998";
String credits = "50";
String message = "";
try{
//支付宝兑换
Thread.sleep(3000);
Response response = this.话费兑换(uid,actualCredits,degreeId,appItemId,credits);
Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败");
logger.info("用户成功兑换一次");
//再次兑换
Thread.sleep(3000);
try{
response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
//获取按钮状态
Response detailResponse = mobileService.detail(authorization.dafuwengLogin(uid),"1");
String btnText = MatcherString.getString(detailResponse.asString(), "\"10\":\\{\"btnText\":\"(.*?)\",", 1);
logger.info("再次兑换按钮:" + btnText);
Assert.assertTrue(message.contains("\"desc\":\"已兑完\""),"校验用户兑换限制失败");
Assert.assertEquals(btnText,"已兑换","校验马上兑换按钮状态失败");
logger.info("校验话费10元用户每月兑换限制成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
//获取当前日期时间,再减30天
Date date=new Date();
Calendar calendar=Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -30);
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
logger.info("当前时间-30天:" + dateFormat.format(calendar.getTime()));
//更新表记录,修改记录为前一个月
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 1 and consumer_id = 100147137 ORDER BY id DESC LIMIT 1";
jdbc.update(sql);
}
}
@Test(description = "话费会员等级限制LV5")
public void 话费会员等级测试() throws Exception{
int uid = 7282;
String actualCredits = "20";
String degreeId = "20";
String appItemId = "195998";
String credits = "20";
String message = "";
//用户登录, vip=5
Map cookies = authorization.generateSignAutoLogin("SvSQyVi2iLSoXgaRutJgK1UCkWb",7273);
//会员符合条件,兑换
Response response = this.话费兑换(uid,actualCredits,degreeId,appItemId,credits);
Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败");
logger.info("用户等级LV0成功兑换一次");
//会员不符合条件,兑换,vip=5
try{
response = gawService.phonebillExchange(cookies,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"未达到会员等级要求\""),"校验message失败");
logger.info("校验话费会员等级兑换成功");
}
public Response 话费兑换(int uid, String actualCredits, String degreeId, String appItemId, String credits) throws Exception {
Response response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
//查看兑换结果
response = tawService.orderStatus(orderId,uid);
response.prettyPrint();
String status = response.jsonPath().getString("data.status");
//异步接口
int i = 10;
while (i > 0 && status.equals("processing")) {
Thread.sleep(1000);
response = tawService.orderStatus(orderId,uid);
response.prettyPrint();
status = response.jsonPath().getString("data.status");
i--;
}
return response;
}
}
package http.cases.ExchangeTest;
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import http.cases.ExchangeTest.CheckTemplet;
import http.service.Authorization;
import http.service.app.CouponExchangeService;
import http.service.app.CrecordService;
......@@ -22,7 +23,7 @@ import static io.restassured.RestAssured.given;
/**
* Created by mabo on 2019/2/28
*/
public class 话费_兑换限制测试_ExchangeTest extends CheckTemplet{
public class 话费_兑换限制测试_ExchangeTest extends CheckTemplet {
@Autowired
private MobileService mobileService;
@Autowired
......
......@@ -446,6 +446,30 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
@Test(description = "新实物确认下单页面")
public void 实物确认下单测试() throws Exception{
int uid = 7284;
String appItemId = "196093";
String appSkuId = "154";
Response response = gawService.confirmItemDetail(uid,appItemId,appSkuId);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.attr[0].value"),"白色","校验sku信息颜色失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.attr[1].value"),"S","校验sku信息尺寸失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].sku.credits"),"200","校验sku商品积分失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].multiImage"),"//yun.dui88.com/images/201905/h8x0e1talx.png","校验图片信息失败");
Assert.assertEquals(response.jsonPath().getString("data.items[0].title"),"【自动化勿动】自有实物sku","校验实物名称失败");
Assert.assertEquals(response.jsonPath().getString("data.orderCredits"),"200","校验订单积分失败");
Assert.assertEquals(response.jsonPath().getString("data.expressPrice"),"500","校验订单运费金额失败");
Assert.assertEquals(response.jsonPath().getString("data.consumerPayPrice"),"500","校验订单支付金额失败");
logger.info("校验新实物确认下单页正确");
}
......
......@@ -42,7 +42,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
private static Integer uid1 = 5171;
private static Integer uid2 = 5172;
private static Integer uid3 = 5173;
private static String betId;
private static String betId = "4791";
private static String optionId1;
private static String optionId2;
......@@ -207,7 +207,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Assert.assertEquals(response.jsonPath().getString("data.unitName"),"金币","积分单位校验失败");
Response response2 = pkService.popup(uid1);
response.prettyPrint();
response2.prettyPrint();
Assert.assertEquals(response2.jsonPath().getString("data.prizeList"),null,"中奖弹窗积分校验失败");
Assert.assertEquals(response2.jsonPath().getString("data.show"),"false","展示弹窗校验失败");
}
......
......@@ -239,7 +239,6 @@ public class 插件场景测试_pluginTest extends DuibaTestBase {
int uid = 6552;
String appId = "22475";
String signType = "0";
String url = "chome";
//创建插件活动
......@@ -255,9 +254,9 @@ public class 插件场景测试_pluginTest extends DuibaTestBase {
Response ajaxResponse = activityPlugin.ajaxBanners(uid,url);
ajaxResponse.prettyPrint();
int i =40;
while(!ajaxResponse.jsonPath().getString("default.activityId").equals(id) && i > 0){
while(!ajaxResponse.jsonPath().getString("success").equals("true") && i > 0){
Thread.sleep(3000);
Thread.sleep(5000);
ajaxResponse = activityPlugin.ajaxBanners(uid,url);
i--;
}
......
......@@ -55,7 +55,7 @@ public class 补给站_商品_DuibaTest extends AbstractTestNGSpringContextTests
//上架
Response response2 = developerBJZ.ajaxDirectUp2(appId2, id);
//接口提示,至尊版专享,不能上架
Assert.assertEquals(response2.jsonPath().getString("desc"), "至尊版专享", "校验接口上架失败");
Assert.assertEquals(response2.jsonPath().getString("desc"), "您暂无使用权限哦,若想获得使用权限,请与您的商务联系", "校验接口上架失败");
}
......@@ -100,7 +100,7 @@ public class 补给站_商品_DuibaTest extends AbstractTestNGSpringContextTests
//上架
Response response2 = developerBJZ.ajaxDirectUp2(appId2, id);
//接口提示,至尊版专享,不能上架
Assert.assertEquals(response2.jsonPath().getString("desc"), "至尊版专享", "校验接口上架失败");
Assert.assertEquals(response2.jsonPath().getString("desc"), "您暂无使用权限哦,若想获得使用权限,请与您的商务联系", "校验接口上架失败");
}
@Test(description = "//添加直冲类")
......
......@@ -28,8 +28,8 @@ public class 开发者签到编辑_signTest extends AbstractTestNGSpringContextT
Response response = signService.selectsignOperList("19515");
response.print();
Assert.assertEquals(response.jsonPath().getString("data.list[0].openToDev"),"false","来自Duiba的签到编辑权限失败");
Assert.assertEquals(response.jsonPath().getString("data.list[1].openToDev"),"true","来自开发者自有的签到编辑权限失败");
Assert.assertEquals(response.jsonPath().getString("data.list[1].openToDev"),"false","来自Duiba的签到编辑权限失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].openToDev"),"true","来自开发者自有的签到编辑权限失败");
Assert.assertEquals(response.jsonPath().getString("data.list[2].openToDev"),"true","来自开发者自有的签到编辑权限失败");
logger.info("开发者签到编辑权限校验成功");
......
......@@ -4,6 +4,7 @@ import base.DuibaLog;
import base.DuibaTestBase;
import http.cases.ExchangeTest.Database;
import http.service.hd.DevItemNewService;
import http.service.app.ChwVisualEditorService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
......@@ -28,6 +29,8 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
DevItemNewService devItemNewService;
@Autowired
Authorization authorization;
@Autowired
ChwVisualEditorService chwVisualEditorService;
@DataProvider
public Object[][] providerMethod(Method method) {
......@@ -44,6 +47,12 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
new Object[]{2, "2125", "22542", "商品分组-自有老商品"}, //case2
};
}
if (method.getName().equals("手机端商品分组组件新商品展示")) {
result = new Object[][]{
new Object[]{1, "2102", "商品分组-兑吧新商品"}, //case1
new Object[]{2, "2104", "商品分组-自有新商品"}, //case2
};
}
return result;
}
......@@ -166,4 +175,69 @@ 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 + "---");
Map cookies = authorization.dafuwengLogin(7126);
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;
}
}
}
......@@ -258,6 +258,7 @@ public class ActivityPlugin {
Map<String,String> map = new HashMap<>();
map.put("url",url);
map.put("preview","false");
logger.info("请求ajaxbanners接口,url="+url);
Response response = given().cookies(authorization.dafuwengLogin(uid,true)).params(map).post(activityHost+"/activityPlugin/ajaxBanners");
......
......@@ -132,7 +132,7 @@ public class DeveloperBJZ {
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas(appId)).params(map).post(url);
response.prettyPrint();
try {
Assert.assertEquals(response.jsonPath().getString("desc"), "至尊版专享");
Assert.assertEquals(response.jsonPath().getString("desc"), "您暂无使用权限哦,若想获得使用权限,请与您的商务联系");
} catch (Exception e) {
throw new Exception("创建接口1失败,返回信息:" + response.asString());
} catch (Error er) {
......
package http.service.app;
import base.DuibaLog;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static io.restassured.RestAssured.given;
@Service
public class ChwVisualEditorService {
@Value("${home.host}")
private String homeHost;
private DuibaLog logger = DuibaLog.getLogger();
@Autowired
Authorization authorization;
//手机端商品分组组件
public Response itemsList(Map cookies, String classifyId) throws Exception{
String url = "http://" + homeHost + "/chw/visual-editor/items/list";
Map<String,String> map = new HashMap<>();
map.put("classifyId",classifyId);
map.put("pageNo","1");
map.put("pageSize","300");
map.put("sort","custom");
logger.info("请求/chw/visual-editor/items/list接口");
Response response = given().contentType("application/json; charset=UTF-8").cookies(cookies).params(map).get( url);
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/chw/visual-editor/items/list接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/chw/visual-editor/items/list接口返回异常,返回信息:"+response.asString());
}
return response;
}
}
......@@ -24,8 +24,12 @@ trade.host = activity.m.duibatest.com.cn
//\u6570\u636E\u5E93\u914D\u7F6E
db.name = FjrtzzH
db.password= 2Fe36uDap8TMqtfzob3f1u8r2aK8qjdnwPP
<<<<<<< HEAD
//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://47.97.127.67:13001/?tinyInt1isBit=false&connectTimeout=60000&socketTimeout=20000
>>>>>>> master
db.driver= com.mysql.cj.jdbc.Driver
db.maxtotal = 6
......
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