Commit 46ba5753 by yangjian

编辑会员卡增加断言

parent 49007f4a
......@@ -9,6 +9,7 @@ import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.RandomStringUtil;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
......@@ -30,6 +31,8 @@ public class TestTenantMemberCard_update extends XMBaseTest {
@Test(description = "编辑会员卡")
public void testmodifySharers() {
CardTools Cardtools = new CardTools();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
......@@ -40,6 +43,9 @@ public class TestTenantMemberCard_update extends XMBaseTest {
String memberCardId = XMJSONPath.readPath(dataApi.getApi_response(), "$.result.records[0].id");
JSONObject bodyJson2 =Cardtools.fetchPageOfHistory(memberCardId);
int count = Integer.parseInt(XMJSONPath.readPath(bodyJson2,"$.result.total"));
JSONArray activatePatternList=new JSONArray();
activatePatternList.add("PURCHASE");
......@@ -64,9 +70,6 @@ public class TestTenantMemberCard_update extends XMBaseTest {
benefitList.add(Object);
JSONObject jsonObject = new JSONObject();
jsonObject.put("surfaceUrl","https://image.xiaomaiketang.com/xm/internal/HpRiJpFnTC.png");//会员卡封面图片
jsonObject.put("surfaceCornerMark","自动化标签");
......@@ -76,7 +79,7 @@ public class TestTenantMemberCard_update extends XMBaseTest {
jsonObject.put("sharePeopleLimit", "2");//共享人数
jsonObject.put("benefitList", benefitList);//使用权益
jsonObject.put("price", "1");//价格
jsonObject.put("underlinePrice", "10");//划线价
jsonObject.put("underlinePrice", "20");//划线价:从10到20
jsonObject.put("purchaseNumberLimit", "-1");//购买数量限制
jsonObject.put("xcxSaleStatus", "YES");//小程序是否售卖
jsonObject.put("creatorId", xmAppApi.getLoginInfo().getAdminId());
......@@ -90,6 +93,11 @@ public class TestTenantMemberCard_update extends XMBaseTest {
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject bodyJson1 =Cardtools.fetchPageOfHistory(memberCardId);
int count1 = Integer.parseInt(XMJSONPath.readPath(bodyJson1,"$.result.total"));
Assert.assertTrue(count1 == count+1);//编辑记录+1
Cardtools.fetchDetailById(memberCardId);
Assert.assertTrue(XMJSONPath.readPath(dataApi.getApi_response(),"$.result.underlinePrice").equals("20.00"),"编辑会员卡,核对编辑的划线价是否改过来了");
}
}
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