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