Commit ff03c592 authored by 龚小红's avatar 龚小红

增加优惠码绑定和邀请关系绑定,并支付成功

parent 6503093a
......@@ -53,9 +53,9 @@ public class NoviceGuidance implements Authorization {
@Test(description = "小葡萄关注公众号并切换为会员", priority = 2)
public void 小葡萄关注公众号并切换为会员() throws SQLException {
//关注公众号
userId = (long) subscribe();
subscribe();
//切换会员
updateTypeOrDate(userId,true);
updateTypeOrDate(0L,true);
}
@Test(description = "创建资料包", priority = 3)
......
package com.kjj.cases.assistant.pay;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.apache.commons.lang3.StringUtils;
......@@ -12,81 +13,80 @@ import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.config.BasicConfig.PAY_CALLOUT;
import static com.kjj.utils.BaseUtils.updateTypeOrDate;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class Cashback implements Authorization {
public String tradeNo;
@BeforeClass
public void setUp() {
userTku();
userTku2();
BaseUtils.ssoLogin();
}
public String comboId;
// @Test(description = "用户绑定分享关系",priority = 1)
// public void 用户绑定分享关系() {
// Map<String, Object> Params = new HashMap<String, Object>();
// Params.put("fromStr",1);
// Params.put("inviterSid",2991);
// Params.put("accessSource",22);
// Response response = network.getResponse(Params,PAY_distribute);
// System.out.println(response.body().asString());
// boolean data=response.jsonPath().getBoolean("data");
// Assert.assertTrue(data,network.message(PAY_distribute,"用户绑定失败",response.body().asString()));
//
// }
// @Test (description = "用户支付后是否有180天打卡权限",priority = 2)
// public void 用户支付后是否有180天打卡权限() {
// Response response = network.getResponse(PAY_clockPayInfo);
// System.out.println(response.body().asString());
// boolean isClockPay=response.jsonPath().getBoolean("data.isClockPay");
// Assert.assertFalse(isClockPay,network.message(PAY_clockPayInfo,"有180天打卡权限",response.body().asString()));
// }
//
// @Test (description = "默认付费_邀请付费页",priority = 3) //priority 方法执行优先级
// public void 默认付费_邀请付费页() {
// updateTypeOrDate(5495,false);
// //代理人续费状态
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.put("entryDiscountType",3); //入口折扣类型,1-普通,3-邀请,4-优惠码
// Response response = network.getResponse(PAY_info);
// int discountType = response.jsonPath().getInt("data.discountType");
// int validity = response.jsonPath().getInt("data.validity");
// int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
// Assert.assertEquals(discountType,3,network.message(PAY_info,"非邀请付费逻辑",response.body().asString()));
// Assert.assertEquals(validity,12,network.message(PAY_info,"增加会员时长非12个月",response.body().asString()));
// Assert.assertEquals(preferentialPrice,3,network.message(PAY_info,"邀请价格非0.03",response.body().asString()));
// }
@Test(description = "用户绑定分享关系",priority = 1)
public void 用户绑定分享关系() {
updateTypeOrDate(3054,false);
Map<String, Object> params = new HashMap<String, Object>();
params.put("sellerId",3054);
params.put("inviterSid",2991);
params.put("openId","osi5w5pQIuvXWnUoN4EV23DAcL-4");
params.put("userId",5577);
params.put("oaId",1);
params.put("scene",1);
Response response = network.postResponse(params,PAY_bind);
boolean bindResult=response.jsonPath().getBoolean("data.bindResult");
Assert.assertTrue(bindResult,network.message(PAY_bind,"用户绑定失败",response.body().asString()));
}
@Test (description = "默认付费_邀请付费页",priority = 3) //priority 方法执行优先级
public void 默认付费_邀请付费页() {
//代理人续费状态
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("entryDiscountType",1); //入口折扣类型,1-普通,3-邀请,4-优惠码
Response response = network.getResponse(PAY_info);
int discountType = response.jsonPath().getInt("data.discountType");
int validity = response.jsonPath().getInt("data.validity");
int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
Assert.assertEquals(discountType,3,network.message(PAY_info,"非邀请付费逻辑",response.body().asString()));
Assert.assertEquals(validity,12,network.message(PAY_info,"增加会员时长非12个月",response.body().asString()));
Assert.assertEquals(preferentialPrice,3,network.message(PAY_info,"邀请价格非0.03",response.body().asString()));
}
// @Test (description = "返现用户付费_微信支付后回调",priority = 3)
// @Test (description = "返现用户付费_微信支付后回调",priority = 4)
// public void 返现用户付费_微信支付后回调() {
// //获取付费价格
// Response actualPayMoneyResponse = network.getResponse(PAY_combo);
// System.out.println(actualPayMoneyResponse.body().asString());
// comboId=actualPayMoneyResponse.jsonPath().getString("data[0].id");
// Assert.assertNotNull(comboId,network.message(PAY_combo,"套餐ID为null",actualPayMoneyResponse.body().asString()));
// String actualPayMoney = actualPayMoneyResponse.jsonPath().getString("data[0].actualPayMoney");
// Assert.assertEquals(actualPayMoney,"0.01",network.message(PAY_combo,"获取付费价格:价格不是365",actualPayMoneyResponse.body().asString()));
//
// //创建支付
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.put("userVersion", 2); // 1 通用版 2 保险版
// payParams.put("comboId", comboId);
// payParams.put("oaId", "1");
// payParams.put("paySource", "2");
// Response response = network.postResponse(payParams, PAY_create);
// String tradeNo = response.jsonPath().getString("data.tradeNo");
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("entryDiscountType",1);
// params.put("discountType",3); //实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
// params.put("paySource","2");
// Response response = network.postResponse(params,PAY_create);
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(params, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
//
// params.clear();
// int data = 2;
// int i = 0;
// try {
// // 轮训下单接口
// while (data == 2){
// sleep(2000);
//
// // mock微信回调失败
// Map<String, Object> callbackParams = new HashMap<String, Object>();
// callbackParams.put("tradeNo", tradeNo);
// callbackParams.put("payResult", true);
// callbackParams.put("payTradeNo", "test");
// response = network.getResponse(callbackParams, PAY_CALLOUT);
// boolean result = response.jsonPath().getBoolean("data");
// Assert.assertTrue(result, network.message(callbackParams, PAY_CALLOUT, "mock微信支付回调成功,但我们订单处理失败", response.body().asString()));
// params.put("tradeNo",tradeNo);
// response = network.getResponse(params,PAY_result);
// data = response.jsonPath().getInt("data");//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
// i++;
// if (i == 10){
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "轮训支付结果超过10次", response.body().asString()));
// break;
// }
// }
// }catch (Exception e){
// e.printStackTrace();
// Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "获取数据失败", response.body().asString()));
// }
//
//
// }
......@@ -170,8 +170,6 @@ public class Cashback implements Authorization {
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(PAY_withdraw, "提现失败", response.body().asString()));
}
}
}
package com.kjj.cases.assistant.pay;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.BaseUtils.tku;
import static com.kjj.utils.BaseUtils.updateTypeOrDate;
import static com.kjj.utils.ThreadSleepUtils.sleep;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -24,18 +21,14 @@ public class Pay implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
agentTku();
}
public String comboId;
public long id;
public String promotionCode;
public String tradeNo;
public String promotionCode;
@Test (description = "默认付费_续费页",priority = 1) //priority 方法执行优先级
public void 默认付费_续费页() {
//切换会员为会员状态
updateTypeOrDate(5495,true);
network.agentCookies.put("tku", tku);
//代理人续费状态
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("entryDiscountType",3); //入口折扣类型,1-普通,3-邀请,4-优惠码
......@@ -66,9 +59,9 @@ public class Pay implements Authorization {
@Test (description = "默认付费_正常付费页",priority = 3) //priority 方法执行优先级
public void 默认付费_正常付费页() {
//切换会员为非会员状态
updateTypeOrDate(5495,false);
userTku();
updateTypeOrDate(2105,false);
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("entryDiscountType",1); //入口折扣类型,1-普通,3-邀请,4-优惠码
Response response = network.getResponse(PAY_info);
......@@ -90,16 +83,15 @@ public class Pay implements Authorization {
Response response = network.postResponse(payParams,PAY_create);
tradeNo = response.jsonPath().getString("data.tradeNo");
Assert.assertNotNull(tradeNo,network.message(payParams, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
}
@Test (description = "默认付费_查询订单状态",priority = 5)
public void 默认付费_查询订单状态() {
Map<String, Object> cancelParams = new HashMap<String, Object>();
cancelParams.put("tradeNo",tradeNo);
Response response = network.getResponse(cancelParams,PAY_result);
Map<String, Object> params = new HashMap<String, Object>();
params.put("tradeNo",tradeNo);
Response response = network.getResponse(params,PAY_result);
int data = response.jsonPath().getInt("data");//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
Assert.assertEquals(data,2,network.message(cancelParams, PAY_result,"订单状态不为待付款",response.body().asString()));
Assert.assertEquals(data,2,network.message(params, PAY_result,"订单状态不为待付款",response.body().asString()));
}
@Test (description = "好友代付_弹窗信息",priority = 6)
......@@ -130,168 +122,120 @@ public class Pay implements Authorization {
int data = response.jsonPath().getInt("data");
Assert.assertEquals(data,5,network.message(cancelParams, PAY_result,"取消支付:取消支付失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
}
//
@Test (description = "创建优惠码",priority = 9)
public void 创建优惠码 () {
//优惠码类型列表
Response response=network.getResponse(MANAGER_typeList);
System.out.println(response.body().asString());
Object data=response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data,network.message(MANAGER_typeList,"优惠码类型列表为null",response.body().asString()));
//创建优惠码
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("comboId",1);
Params.put("codeTotal",10);
Params.put("startTime",System.currentTimeMillis());
Params.put("deadline",System.currentTimeMillis() + 1000*60*60*24*30L);
Params.put("price",365);
Params.put("promotionType",5);
Params.put("remark","优惠码"+ RandomUtils.nextInt(1, 100));
Params.put("userVersion",2);
Params.put("validityDuration",12);
response = network.postResponse(Params,MANAGER_batchCreateV2);
System.out.println( response.body().asString());
id=response.jsonPath().getLong("data.id");
Assert.assertNotNull(id,network.message(MANAGER_batchCreateV2,"优惠码批次ID未获取到",response.body().asString()));
}
@Test (description = "默认付费_切换会员类型为保险版",priority = 9)
public void 默认付费_切换为保险版会员类型(){
//会员类型版本判断
@Test (description = "优惠券_优惠码绑定",priority = 10)
public void 优惠券_优惠码绑定 () {
agentTku();
//吉吉切换非会员
updateTypeOrDate(2991,false);
//绑定优惠码
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response response = network.getResponse(params,version_info);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
int changeVersion = userVersion == 1 ? 2 : 1; // 判断当前开启的版本,如果当前版本是1,则改为2,反之;
params.put("sellerId",2991);
params.put("promId",id);
params.put("openId","osi5w5ggFiEXk0tPJH9b0KO_XU08");
params.put("userId",5495);
params.put("oaId",1);
params.put("scene",2);
Response response = network.postResponse(params,PAY_distribute);
boolean distributeResult = response.jsonPath().getBoolean("data.distributeResult");
String promotionCode = response.jsonPath().getString("data.promotionCode");
Assert.assertTrue(distributeResult,network.message(params, PAY_distribute,"绑定失败",response.body().asString()));
Assert.assertNotNull(promotionCode,network.message(params, PAY_distribute,"绑定的优惠码为空",response.body().asString()));
//优惠码列表
sleep(3000);
Map<String, Object> codeListParam = new HashMap<String, Object>();
codeListParam.put("batchId",id);
codeListParam.put("pageIndex",1);
codeListParam.put("pageSize",20);
response =network.getResponse(codeListParam,MANAGER_codeList);
String nickName=response.jsonPath().getString("data.list[0].nickName");
Assert.assertEquals(nickName,"吉吉",network.message(params, PAY_distribute,"用户绑定失败",response.body().asString()));
}
@Test (description = "默认付费_优惠码付费页",priority = 11) //priority 方法执行优先级
public void 默认付费_优惠码付费页() {
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("entryDiscountType",1); //入口折扣类型,1-普通,3-邀请,4-优惠码
Response response = network.getResponse(PAY_info);
int discountType = response.jsonPath().getInt("data.discountType");
int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
Assert.assertEquals(discountType,4,network.message(PAY_info,"非优惠码付费逻辑",response.body().asString()));
Assert.assertEquals(preferentialPrice,36500,network.message(PAY_info,"优惠码价格非365",response.body().asString()));
promotionCode = response.jsonPath().getString("data.promotion.promotionCode");
}
//切换版本
Map<String, Object> versionParams = new HashMap<String, Object>();
versionParams.put("targetVersion",changeVersion);
response = network.postResponse(versionParams,PAY_exchange);
String result = response.jsonPath().getString("desc");
Assert.assertEquals(result,"OK",network.message(versionParams,PAY_exchange,"会员类型切换:切换失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
//会员类型再次判断
params.put("t",System.currentTimeMillis());
response = network.getResponse(params,version_info);
userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,changeVersion,network.message(params, version_info,"会员类型版本判断:判断错误,此版本为尊享版",response.body().asString()));
if(userVersion == 1){//切换回保险专用版
versionParams.put("targetVersion",2);
response = network.postResponse(versionParams,PAY_exchange);
result = response.jsonPath().getString("desc");
Assert.assertEquals(result,"OK",network.message(versionParams,PAY_exchange,"会员类型切换:切换失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
@Test (description = "默认付费_微信支付后回调",priority = 13)
public void 默认付费_微信支付后回调() {
//创建支付
Map<String, Object> params = new HashMap<String, Object>();
params.put("entryDiscountType",1);
params.put("discountType",4); //实际折扣类型,1-普通,2-续费,3-邀请,4-优惠码
params.put("promotionCode",promotionCode);
params.put("paySource","2");
Response response = network.postResponse(params,PAY_create);
tradeNo = response.jsonPath().getString("data.tradeNo");
Assert.assertNotNull(tradeNo,network.message(params, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
params.clear();
int data = 2;
int i = 0;
try {
// 轮训下单接口
while (data == 2){
sleep(2000);
params.put("tradeNo",tradeNo);
response = network.getResponse(params,PAY_result);
data = response.jsonPath().getInt("data");//1-待付款,2-付款中,3-付款成功,4-付款失败,5-取消支付,6-支付异常
i++;
if (i == 10){
Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "轮训支付结果超过10次", response.body().asString()));
break;
}
}
}catch (Exception e){
e.printStackTrace();
Assert.fail(network.message(params, BasicConfig.MOBILE_secondKill_goodsOrderResult, "获取数据失败", response.body().asString()));
}
//切换会员为会员状态
updateTypeOrDate(5495,true);
// 检查会员开通结果
response = network.getResponse(USER_INFO);
boolean isVip = response.jsonPath().getBoolean("data.vipValid");
Assert.assertTrue(isVip,network.message(USER_INFO,"微信支付成功,但是接口返回还是非会员状态",response.body().asString()));
// 检查会员版本类型
response = network.getResponse(version_info);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1为通用版 2为保险版
Assert.assertEquals(userVersion,2,network.message(version_info,"会员类型版本判断:判断错误,此版本为通用版",response.body().asString()));
}
//
// @Test (description = "创建优惠码",priority = 11)
// public void 创建优惠码 () {
//
// //优惠码类型列表
// Response response=network.getResponse(MANAGER_typeList);
// System.out.println(response.body().asString());
// Object data=response.jsonPath().getJsonObject("data");
// Assert.assertNotNull(data,network.message(MANAGER_typeList,"优惠码类型列表为null",response.body().asString()));
//
// //创建优惠码
// Map<String, Object> Params = new HashMap<String, Object>();
// Params.put("comboId",1);
// Params.put("codeTotal",10);
// Params.put("startTime",System.currentTimeMillis());
// Params.put("deadline",System.currentTimeMillis() + 1000*60*60*24*30L);
// Params.put("price",365);
// Params.put("promotionType",5);
// Params.put("remark","优惠码"+ RandomUtils.nextInt(1, 100));
// Params.put("userVersion",2);
// Params.put("validityDuration",12);
// response = network.postResponse(Params,MANAGER_batchCreateV2);
// System.out.println( response.body().asString());
// id=response.jsonPath().getLong("data.id");
// Assert.assertNotNull(id,network.message(MANAGER_batchCreateV2,"优惠码批次ID未获取到",response.body().asString()));
//
// //优惠码列表
// Map<String, Object> codeListParam = new HashMap<String, Object>();
// codeListParam.put("batchId",id);
// codeListParam.put("promotionCodeStatus",0); //0 未使用
// codeListParam.put("pageIndex",1);
// codeListParam.put("pageSize",20);
// response =network.getResponse(codeListParam,MANAGER_codeList);
// promotionCode=response.jsonPath().getString("data.list[0].promotionCode");
// }
//
//
// @Test (description = "优惠券_付费页",priority = 12)
// public void 优惠券_付费页 () {
// //创建支付订单
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.clear();
// payParams.put("entryDiscountType",4);
// payParams.put("promotionCode",promotionCode);
// payParams.put("discountType",4);
// payParams.put("paySource","2");
// Response response = network.postResponse(payParams,PAY_create);
// System.out.println(response.body().asString());
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(payParams, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
//
// //付费页
// payParams.clear();
// payParams.put("entryDiscountType",4);
// response = network.getResponse(PAY_info);
// int discountType = response.jsonPath().getInt("data.discountType");
// int validity = response.jsonPath().getInt("data.validity");
// int preferentialPrice = response.jsonPath().getInt("data.preferentialPrice");
// Assert.assertEquals(discountType,2,network.message(PAY_info,"非续费逻辑",response.body().asString()));
// Assert.assertEquals(validity,14,network.message(PAY_info,"增加会员时长非14个月",response.body().asString()));
// Assert.assertEquals(preferentialPrice,36500,network.message(PAY_info,"优惠码价格非365",response.body().asString()));
// }
//
// @Test (description = "默认付费_微信支付后回调",priority = 13)
// public void 默认付费_微信支付后回调() {
// // mock微信回调失败
// Map<String, Object> callbackParams = new HashMap<String, Object>();
// callbackParams.put("tradeNo",tradeNo);
// callbackParams.put("payTradeNo","test");
// callbackParams.put("payResult",false);
// Response response = network.getResponse(callbackParams,PAY_CALLOUT);
// boolean result = response.jsonPath().getBoolean("data");
// Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"mock微信支付回调失败,但我们订单处理也失败",response.body().asString()));
//
// // mock微信回调成功
// response = network.postResponse(callbackParams,PAY_create);
// tradeNo = response.jsonPath().getString("data.tradeNo");
// callbackParams.put("tradeNo",tradeNo);
// callbackParams.put("payResult",true);
// response = network.getResponse(callbackParams,PAY_CALLOUT);
// result = response.jsonPath().getBoolean("data");
// Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"mock微信支付回调成功,但我们订单处理失败",response.body().asString()));
//
// //查询订单状态
// Map<String, Object> statusParams = new HashMap<String, Object>();
// statusParams.put("tradeNo",tradeNo);
// response = network.getResponse(statusParams,PAY_result);
// System.out.println(response.body().asString());
// int data = response.jsonPath().getInt("data");
// Assert.assertTrue(data==3,network.message(statusParams, PAY_result,"支付成功的订单状态不对",response.body().asString()));
//
//
// // 检查会员开通结果
// response = network.getResponse(USER_INFO);
// boolean isVip = response.jsonPath().getBoolean("data.vipValid");
// Assert.assertTrue(isVip,network.message(USER_INFO,"微信支付成功,但是接口返回还是非会员状态",response.body().asString()));
//
// // 检查会员版本类型
// response = network.getResponse(version_info);
// int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1为通用版 2为保险版
// Assert.assertEquals(userVersion,2,network.message(version_info,"会员类型版本判断:判断错误,此版本为通用版",response.body().asString()));
//
// // 重复提交
// //创建支付订单
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.clear();
// payParams.put("entryDiscountType",4);
// payParams.put("promotionCode",promotionCode);
// payParams.put("discountType",4);
// payParams.put("paySource","2");
// response = network.postResponse(payParams,PAY_create);
// System.out.println(response.body().asString());
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(payParams, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
// }
//
// @Test (description = "优惠券_重复提交订单",priority = 12)
// public void 优惠券_重复提交订单 () {
// //创建支付订单
// Map<String, Object> payParams = new HashMap<String, Object>();
// payParams.clear();
// payParams.put("entryDiscountType",4);
// payParams.put("promotionCode",promotionCode);
// payParams.put("discountType",4);
// payParams.put("paySource","2");
// Response response = network.postResponse(payParams,PAY_create);
// System.out.println(response.body().asString());
// tradeNo = response.jsonPath().getString("data.tradeNo");
// Assert.assertNotNull(tradeNo,network.message(payParams, PAY_create,"拉起支付:拉起微信支付失败",response.body().asString())); //判断订单号是否为空
// }
}
......@@ -780,14 +780,10 @@ public class BasicConfig {
public static final String PAY_create = HOST + "/kjj/vip/order/create";
public static final String PAY_cancel = HOST + "/kjj/vip/order/cancel";
public static final String PAY_CALLOUT = HOST + "/kjj/order/payCallout";
public static final String PAY_exchange= HOST + "/kjy/mp/version/exchange";
public static final String PAY_status= HOST + "/kjy/order/status";
public static final String PAY_isRenewCondition= HOST + "/kjy/mp/combo/isRenewCondition";
public static final String MANAGER_typeList = MANAGER_HOST + "/kjy/manager/promotionCode/typeList";
public static final String MANAGER_batchCreateV2 = MANAGER_HOST + "/kjy/manager/promotionCode/batchCreateV2";
public static final String PAY_distribute = HOST + "/kjy/sp/visitorPayment/distribute";
public static final String PAY_clockPayInfo = HOST + "/kjy/mp/combo/clockPayInfo";
public static final String PAY_accInfo = HOST + "/kjy/sp/seller/acc/info";
public static final String PAY_clockPayInfo = HOST + "/kjy/mp/combo/clockPayInfo";
public static final String PAY_distributionList = HOST + "/kjy/sp/seller/distributionList";
public static final String PAY_accDetail = HOST + "/kjy/sp/seller/acc/detail";
public static final String PAY_withdraw = HOST + "/kjy/sp/seller/acc/withdraw";
......@@ -795,6 +791,8 @@ public class BasicConfig {
public static final String PAY_list = HOST + "/kjj/vip/order/success/list";
public static final String PAY_result = HOST + "/kjj/vip/order/pay/result";
public static final String PAY_popup = HOST + "/kjj/vip/order/other/popup";
public static final String PAY_distribute = HOST + "/kjj/auto/test/proCode/distribute";
public static final String PAY_bind = HOST + "/kjj/auto/test/invitation/bind";
// *************** 名片 ***************
public static final String SELLERCARD_topOfDetail = HOST + "/kjy/mp/sellerCardV5/topOfDetail";
......
......@@ -54,7 +54,7 @@ public class BaseUtils {
/**
* 小葡萄关注客集集微信公众号
*/
public static Object subscribe() throws SQLException {
public static void subscribe() throws SQLException {
//关注公众号
// network.agentHeaders.put("Content-Type","text/plain");
String str = "<xml><ToUserName><![CDATA[gh_3b9884c7b0ee]]></ToUserName><FromUserName><![CDATA[osi5w5kT-smQ42Fc-ByO4G8C-E1M]]></FromUserName><CreateTime>1628040971</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[subscribe]]></Event></xml>";
......@@ -75,7 +75,6 @@ public class BaseUtils {
tku = response.jsonPath().getString("data");
network.agentCookies.put("tku", tku);
System.out.println("小葡萄tku:" + tku);
return userId;
}
/**
......@@ -111,12 +110,18 @@ public class BaseUtils {
* 切换会员
* choice-1切换为非会员,choice为其他切换为会员
*/
public static void updateTypeOrDate(long userId,boolean choice){
//找到用户的sellerid
public static void updateTypeOrDate(long sId,boolean choice){
Response response;
long sellerId;
Map<String, Object> params = new HashMap<String, Object>();
Response response = network.getResponse(USER_INFO);
int sellerId = response.jsonPath().getInt("data.sellerId");
Assert.assertNotNull(response.jsonPath().getJsonObject("data"),network.message(USER_INFO,"获取用户信息失败",response.body().asString()));
if(choice) {
//找到用户的sellerid
response = network.getResponse(USER_INFO);
sellerId = response.jsonPath().getLong("data.sellerId");
Assert.assertNotNull(response.jsonPath().getJsonObject("data"), network.message(USER_INFO, "获取用户信息失败", response.body().asString()));
}else {
sellerId = sId;
}
//切换代理人公司
params.clear();
......@@ -126,7 +131,6 @@ public class BaseUtils {
System.out.println(params.toString());
boolean success = response.jsonPath().getBoolean("success");
boolean result = response.jsonPath().getBoolean("data");
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(params,MANAGER_changeCompany,"接口返回失败",response.body().asString()));
Assert.assertTrue(result,network.message(params,MANAGER_changeCompany,"返回数据为空",response.body().asString()));
......
......@@ -27,6 +27,8 @@ public class NetworkUtils {
private NetworkUtils(){
//cookies中的tku
agentCookies.put("tku",AGENT_TKU);
//多场景测试标志
agentCookies.put("_duibaServiceGroupKey","miria-2652");
//json类型的headers
agentHeaders.put("Content-Type","application/json");
//二进制文件的headers
......
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