Commit 92fcaf71 authored by 龚小红's avatar 龚小红

Merge branch 'Feature/formSubmit' into 'master'

Feature/form submit

See merge request !84
parents 54c1f83c 62e4ea25
...@@ -57,6 +57,11 @@ public interface Authorization { ...@@ -57,6 +57,11 @@ public interface Authorization {
default void otoPMAuth() { default void otoPMAuth() {
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvNUjY4j3cVdcpuYrJL6cAszqvnhjut1r1J2h5fBPPiVwGygx"); network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvNUjY4j3cVdcpuYrJL6cAszqvnhjut1r1J2h5fBPPiVwGygx");
} }
//oto销售工作台-PM
default void otoTestAuth() {
network.agentCookies.put("otoToken", "SGU5VHBG6UrQ3eDgD5fMNJrTGe62AyXGxMf4CVZAwGxg8E8D4hrGJP52sv8v36MaYoA");
}
//久久保管理员-正常权限模式 //久久保管理员-正常权限模式
default void jjbManagerAuth() { default void jjbManagerAuth() {
network.agentCookies.put(JJBManagerCookieKey,JJBManagerCookieValue); network.agentCookies.put(JJBManagerCookieKey,JJBManagerCookieValue);
......
...@@ -21,6 +21,7 @@ import java.util.Map; ...@@ -21,6 +21,7 @@ import java.util.Map;
import static com.oto.cases.otoseller.Manager.cust_id; import static com.oto.cases.otoseller.Manager.cust_id;
import static com.oto.cases.otoseller.Work.assignSeller; import static com.oto.cases.otoseller.Work.assignSeller;
import static com.oto.config.BasicConfig.*; import static com.oto.config.BasicConfig.*;
import static com.oto.utils.BaseUtils.ssoLogin;
import static com.oto.utils.ThreadSleepUtils.sleep; import static com.oto.utils.ThreadSleepUtils.sleep;
public class Invite implements Authorization { public class Invite implements Authorization {
...@@ -505,4 +506,5 @@ public class Invite implements Authorization { ...@@ -505,4 +506,5 @@ public class Invite implements Authorization {
sunndayWeek = cal.getTimeInMillis(); sunndayWeek = cal.getTimeInMillis();
} }
} }
} }
...@@ -42,20 +42,6 @@ public class Manager implements Authorization { ...@@ -42,20 +42,6 @@ public class Manager implements Authorization {
for(int i = 0;i<6;i++){ for(int i = 0;i<6;i++){
PubForm("1513636130"+i,"自动化测试用户"+i); PubForm("1513636130"+i,"自动化测试用户"+i);
} }
// for(int i = 20;i<80;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("formId", "Kj22MTU5MQ");
// params.put("phoneNum", "130112100"+i);
// params.put("urlLink", "https://kjj-static.duibatest.com.cn/tk/202204111900-1?formId=Kj22MTU5MQ&channel=jrtt&agent=td");
// params.put("username", "小红11月用户"+i);
// params.put("uuid", "622d83e4-ca21-4ccd-94cb-182c0f2a6b60");
// Response response = network.postResponse(params,BasicConfig.FORM_submit);
// String recordId = response.jsonPath().getString("data.recordId");
// Assert.assertNotNull(recordId,network.message(params,BasicConfig.FORM_submit,"客户创建失败",response.body().asString()));
//
// }
} }
@Test(description = "通过销售名称查找销售",priority = 2) @Test(description = "通过销售名称查找销售",priority = 2)
...@@ -562,8 +548,6 @@ public class Manager implements Authorization { ...@@ -562,8 +548,6 @@ public class Manager implements Authorization {
sleep(1000); sleep(1000);
assignSeller(Manager.cust_id+2,INVITE_ID,true,1,"manage"); assignSeller(Manager.cust_id+2,INVITE_ID,true,1,"manage");
} }
@Test(description = "搜索角色列表",priority = 44) @Test(description = "搜索角色列表",priority = 44)
......
...@@ -639,7 +639,6 @@ public class Phone implements Authorization { ...@@ -639,7 +639,6 @@ public class Phone implements Authorization {
@Test(description = "邀约销售查看见面次数",priority = 59) @Test(description = "邀约销售查看见面次数",priority = 59)
public void 邀约销售查看见面次数(){ public void 邀约销售查看见面次数(){
otoInviterAuth();//邀约统计客户已上传的总面访次数 otoInviterAuth();//邀约统计客户已上传的总面访次数
sleep(2000);
HashMap<String,Object> params1 = new HashMap<>(); HashMap<String,Object> params1 = new HashMap<>();
params1.put("custId", cust_id); params1.put("custId", cust_id);
params1.put("type", 1); params1.put("type", 1);
...@@ -783,13 +782,6 @@ public class Phone implements Authorization { ...@@ -783,13 +782,6 @@ public class Phone implements Authorization {
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_delCust,"删除客户失败",response.body().asString())); Assert.assertTrue(data,network.message(params,BasicConfig.WORK_delCust,"删除客户失败",response.body().asString()));
} }
// for(int i = 8885;i<8895;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("custId", i);
// Response response = network.postResponse(params,BasicConfig.WORK_delCust);
//
// }
} }
@Test(description = "删除客户填写的表单记录",priority = 91) @Test(description = "删除客户填写的表单记录",priority = 91)
...@@ -800,12 +792,6 @@ public class Phone implements Authorization { ...@@ -800,12 +792,6 @@ public class Phone implements Authorization {
Response response = network.postResponse(params,BasicConfig.WORK_delPubFormRecord); Response response = network.postResponse(params,BasicConfig.WORK_delPubFormRecord);
} }
// for(int i =10;i<50;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("phoneNum", "130112100"+i);
// Response response = network.postResponse(params,BasicConfig.WORK_delPubFormRecord);
//
// }
} }
@Test(description = "退出登录",priority = 92) @Test(description = "退出登录",priority = 92)
......
package com.oto.cases.otoseller;
import com.oto.cases.admin.Authorization;
import com.oto.config.BasicConfig;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.HashMap;
import static com.oto.cases.otoseller.Work.assignSeller;
import static com.oto.utils.BaseUtils.ssoLogin;
public class TestFile implements Authorization {
@BeforeTest
public void setUp(){
ssoLogin();
otoTestAuth();
}
@Test(description = "新建客户",priority = 1)
public void testSubmit(){
for(int i = 10;i<100;i++){
HashMap<String,Object> params = new HashMap<>();
params.put("formId", "Kj22MTU5MQ");
params.put("phoneNum", "130202300"+i);
params.put("urlLink", "https://kjj-static.duibatest.com.cn/tk/202204111900-1?formId=Kj22MTU5MQ&channel=jrtt&agent=td");
params.put("username", "团队池用户"+i);
params.put("uuid", "622d83e4-ca21-4ccd-94cb-182c0f2a6b60");
Response response = network.postResponse(params, BasicConfig.FORM_submit);
String recordId = response.jsonPath().getString("data.recordId");
Assert.assertNotNull(recordId,network.message(params,BasicConfig.FORM_submit,"客户创建失败",response.body().asString()));
}
}
@Test(description = "分配客户并创建邀约记录",priority = 2)
public void testInvite(){
long time = System.currentTimeMillis() + 86400000 ;
HashMap<String,Object> params = new HashMap<>();
params.put("eventType",2);
params.put("firstInterviewFlag",1);
params.put("interviewConfId",628);
params.put("interviewTime",time);
params.put("haveMealFlag",1);
params.put("pickTakeFlag",0);
params.put("custNum",1);
for(int i = 9277;i<9298;i++){
assignSeller(i,2,true,1,"manage");
params.put("custId",i);
Response response =network.postResponse(params,BasicConfig.WORK_invite_submit);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_submit,"修改客户邀约承诺失败",response.body().asString()));
}
}
@Test(description = "删除客户",priority = 90)
public void 删除客户(){
for(int i = 8885;i<8895;i++){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", i);
Response response = network.postResponse(params,BasicConfig.WORK_delCust);
}
}
@Test(description = "删除客户填写的表单记录",priority = 91)
public void 删除客户填写的表单记录(){
for(int i =10;i<50;i++){
HashMap<String,Object> params = new HashMap<>();
params.put("phoneNum", "130112100"+i);
Response response = network.postResponse(params,BasicConfig.WORK_delPubFormRecord);
}
}
}
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