Commit 524bc8b6 by xyy

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/xiaomai/cases/polar/coupon/CouponTools.java
parents ad98be80 3278a4ad
......@@ -11,6 +11,8 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @BelongsProject: xm-sportstest
......@@ -32,21 +34,36 @@ public class TestGetValidBalanceList extends BaseTestImpl {
}
@Test
public void testGetValidBalanceList(){
public void testGetValidBalanceList() {
JSONObject body = new JSONObject();
body.put("tenantId",xmAppApi.getLoginInfo().getStudioId());
body.put("brandId",xmAppApi.getLoginInfo().getBrandId());
body.put("studioId",xmAppApi.getLoginInfo().getStudioId());
body.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
body.put("tenantId", xmAppApi.getLoginInfo().getStudioId());
body.put("brandId", xmAppApi.getLoginInfo().getBrandId());
body.put("studioId", xmAppApi.getLoginInfo().getStudioId());
body.put("operatorId", xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,body.toString(),headers).assetsSuccess(true);
Assert.assertTrue(xmAppApi.getBodyInJSON().getJSONArray("result").size()>0,"获取租户有效余额记录失败");
xmAppApi.doRequest(RequestType.JSON, params, body.toString(), headers).assetsSuccess(true);
Assert.assertTrue(xmAppApi.getBodyInJSON().getJSONArray("result").size() > 0, "获取租户有效余额记录失败");
// 和充值记录的数据对比
String[] keys = {"id","tenantId","productCode","purchaseAmount","startTime","endTime","payChannel"};
for (int i = 0; i < keys.length; i++){
Assert.assertEquals(xmAppApi.getBodyInJSON().getJSONArray("result").getJSONObject(0).getString(keys[i]),eleContractTools.getBalanceList().getJSONObject(0).getString(keys[i]),"获取租户有效余额记录与充值记录列表内容对比");
String[] keys = {"id", "tenantId", "productCode", "purchaseAmount", "startTime", "endTime", "payChannel"};
int total = xmAppApi.getBodyInJSON().getJSONArray("result").size();
List<JSONObject> list1 = new ArrayList<>();
List<JSONObject> list2 = new ArrayList<>();
for (int i = 0; i < total; i++) {
list1.add(eleContractTools.getBalanceList().getJSONObject(i));
list2.add(xmAppApi.getBodyInJSON().getJSONArray("result").getJSONObject(i));
}
int flag = 1;
for (int i = 0; i < total; i++) {
for (int j = 0; j < keys.length; j++) {
String expected = list1.get(i).getString(keys[j]);
String actual = list2.get(total - flag).getString(keys[j]);
Assert.assertEquals(actual, expected, "获取租户有效余额记录与充值记录列表内容对比");
}
flag++;
}
}
}
......@@ -81,6 +81,8 @@ public class TestUpdateExperienceCard extends XMBaseTest {
object.put("operatorId", dataApi.getLoginInfo().getAdminId());
object.put("creatorId", dataApi.getLoginInfo().getAdminId());
object.put("maxIdlePeriod", "7");//首次使用生效方式的最晚生效天数
object.put("useForActivity", "false");//不开启用于营销活动
object.put("surfaceCornerMark", "自动化测试");//封面标签
object.put("title", title);
object.put("validPeriod", "10");//有效期
......
......@@ -173,6 +173,8 @@ public class Tools extends XMBaseTest {
object.put("maxIdlePeriod", "7");//首次使用生效方式的最晚生效天数
object.put("surfaceCornerMark", "自动化测试");//封面标签
object.put("title", title);
object.put("useForActivity", false);//不开启用于营销活动
object.put("validPeriod", "30");//有效期
object.put("activatePatternList", activatePatternList);//生效方式
object.put("price", price);//售价
......
......@@ -90,7 +90,7 @@ public class TestEditCampRuleSchedule extends SelectTargetTrainingCampAndGetInfo
//给会员报名
trainingTools.doSignCampOrder(memberId, this.price, this.campId,"");
orderId = XMJSONPath.readPath(dataApi.getApi_response(), "$.result");
Thread.sleep(2000);
Thread.sleep(5000);
//check 预约记录(训练营预约记录,根据训练营活动筛选)
JSONArray reserverList= reserveTools.getPageByStudio("","","","",null,
......
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