Commit e022ced0 by yangjian

Merge remote-tracking branch 'origin/master'

parents 8d6c301a 1a53dd1d
......@@ -22,7 +22,7 @@ public class OrderCTools extends XMBaseTest {
* @param receivableAmount:应收金额
* @author: yangfangfang
**/
public JSONObject purchaseCard(String activatePattern, String cardId, String cardSnapshotId, String memberId, BigDecimal receivableAmount, DataUserInfo...dataUserInfos) {
public JSONObject purchaseCard(String activatePattern, String cardId, String cardSnapshotId, String memberId, BigDecimal receivableAmount, String commodityCardType,DataUserInfo...dataUserInfos) {
dataApi.setApiModule(ApiModule.Lunar_Order)
.setApiName("API_purchaseCard")
......@@ -34,7 +34,7 @@ public class OrderCTools extends XMBaseTest {
jsonObject.put("cardId",cardId);
jsonObject.put("cardSnapshotId",cardSnapshotId);
jsonObject.put("memberId",memberId);
jsonObject.put("memo", RandomStringUtil.randomString(6));
jsonObject.put("memo", "");
jsonObject.put("receivableAmount",receivableAmount);
jsonObject.put("studioId",dataApi.getLoginInfo().getStudioId());
jsonObject.put("objectId", RandomStringUtil.randomString(16));
......
......@@ -12,14 +12,13 @@ import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.math.BigDecimal;
public class TestMiniPay extends BaseTestImpl {
public class TestMiNiPay extends BaseTestImpl {
String memberId;
......@@ -44,7 +43,7 @@ public class TestMiniPay extends BaseTestImpl {
@Test(description = "小程序支付")
public void testListByVoucherId() {
public void testMiNiPay() {
//获取会员信息
......@@ -61,14 +60,14 @@ public class TestMiniPay extends BaseTestImpl {
BigDecimal price=new BigDecimal(minCardTools.fetchOnSaleMemberCard("次卡").getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("price"));
try {
Thread.sleep(1000);
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
//购买C端非0元会员卡
JSONObject purchaseCardResult=orderCTools.purchaseCard("PURCHASE",cardId,cardId,memberId,price);
String voucherId=purchaseCardResult.getString("result");//订单ID
JSONObject purchaseCardResult=orderCTools.purchaseCard("PURCHASE",cardId,cardId,memberId,price,"MEMBER_CARD");
String voucherId=purchaseCardResult.getJSONObject("result").getString("voucherId");//订单ID
try {
Thread.sleep(1000);
......@@ -79,6 +78,7 @@ public class TestMiniPay extends BaseTestImpl {
//小程序支付失败
JSONObject jsonObject=new JSONObject();
jsonObject.put("appId",xmAppApi.getLoginInfo().getWechatAppId());
System.out.println("yff"+xmAppApi.getLoginInfo().getWechatAppId());
jsonObject.put("openId",xmAppApi.getLoginInfo().getOpenId());
jsonObject.put("voucherId",voucherId);
......
......@@ -78,7 +78,7 @@ public class TestPurchaseCard extends BaseTestImpl {
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toString(),headers).assetsSuccess(true);
JSONObject response=xmAppApi.getBodyInJSON();
String success=response.getString("success");
String signId=response.getString("result");//订单ID
String signId=response.getJSONObject("result").getString("voucherId");//订单ID
Assert.assertEquals(success,"true","C端创建0元签单失败");
try {
......
......@@ -11,7 +11,6 @@ import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.annotation.Resource;
/**
......@@ -58,8 +57,8 @@ public class TestGetApply extends XMBaseTest {
//若有数据,检验详情里的场馆信息跟品牌信息匹配;若无返回报错
if (total != 0) {
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "操作成功!");
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.brandId"), xmAppApi.getLoginInfo().getStudioId());
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.studioId"), xmAppApi.getLoginInfo().getStudioId());
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.companyType"), "PRIVATE");
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.openState"), "SUCCESS");
} else {
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "数据不存在");
}
......
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