Commit e7837af9 by DuJunLi
parents d5a60bec c6918893
......@@ -8,7 +8,6 @@ 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;
......@@ -50,7 +49,7 @@ public class TestDepartStudioAdmin extends BaseTestImpl {
int pageIndex = rand.nextInt(pages);
// 随机获取一页的随机员工
Random random = new Random();
int index = pageIndex+1 == pages ? random.nextInt(total%20-1)+1 : random.nextInt(19)+1;
int index = pageIndex == pages ? random.nextInt(total%20-1) : random.nextInt(19)+1;
body = "{\"size\":20,\"current\":"+pageIndex+",\"state\":\"DUTY\"}";
adminPage = adminTools.pageStudioAdmin(body);
String adminId = adminPage.getJSONObject("result").getJSONArray("records").getJSONObject(index).getString("id");
......@@ -64,12 +63,12 @@ public class TestDepartStudioAdmin extends BaseTestImpl {
throw new RuntimeException(e);
}
// 用手机号查询离职员工是否有这个员工
body = "{\"size\":10,\"current\":0,\"state\":\"LEFT\",\"searchContext\":\""+phone+"\"}";
body = "{\"size\":20,\"current\":0,\"state\":\"LEFT\",\"searchContext\":\""+phone+"\"}";
adminPage = adminTools.pageStudioAdmin(body);
total = Integer.parseInt(adminPage.getJSONObject("result").getString("total"));
Assert.assertEquals(total,1,"员工离职失败,用手机号查询离职员工未返回数据");
try {
Thread.sleep(12000);
Thread.sleep(20000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
......
......@@ -68,14 +68,14 @@ public class TestReinStateStudioAdmin extends BaseTestImpl {
Assert.assertEquals(total,1,"员工离职失败,用手机号查询离职员工未返回数据");
try {
Thread.sleep(15000);
Thread.sleep(20000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
// check 2: 生成对应的操作日志
body = "{\"current\":0,\"size\":20,\"domainId\":\""+xmAppApi.getLoginInfo().getStudioId()+"\",\"content\": \""+name+"\",\"brandId\":\""+xmAppApi.getLoginInfo().getBrandId()+"\",\"studioId\": \""+xmAppApi.getLoginInfo().getStudioId()+"\",\"opEventKey\":\"RESTORE_ADMIN\"}";
JSONObject response = configTools.getOpauditPage(body);
Assert.assertEquals(response.getJSONObject("result").getJSONArray("records").getJSONObject(0).getJSONObject("target").getString("targetId"),adminId,"员工职未生成操作日志");
Assert.assertEquals(response.getJSONObject("result").getJSONArray("records").getJSONObject(0).getJSONObject("target").getString("targetId"),adminId,"员工职未生成操作日志");
}
......
......@@ -13,7 +13,6 @@ import org.testng.annotations.Test;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collections;
/**
* @BelongsProject: xm-sportstest
......@@ -97,6 +96,11 @@ public class TestCreateNormalDate extends BaseTestImpl {
// 设置常规可约时间
reserveTools.createNormalDate(xmAppApi.getLoginInfo().getAdminId(),normalTimeInfoRequests);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
JSONArray personalCoachTime = reserveTools.getPersonalCoachTime(xmAppApi.getLoginInfo().getAdminId(),"normalTimeVOS");
for (int i = 0; i < personalCoachTime.size(); i++){
......
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