Commit ed4d8426 authored by 龚小红's avatar 龚小红

Merge branch '20210816_gxh' into 'master'

20210816 gxh

See merge request test-group/kejiji!99
parents 9f556c37 b2bc55f2
......@@ -6,6 +6,7 @@ import com.kjj.bean.resources.*;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.IdMakeUtil;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
......@@ -22,7 +23,6 @@ public class LiveVisitors implements Authorization
public String confId_imageText;
public String confId_form;
public String confId_link;
public String confId_test;
public String confId_free;
public String id;
public List<ResourcePushList>PushList;
......@@ -62,26 +62,25 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端权益列表", priority = 3)
public void 访客端权益列表()
{
ThreadSleepUtils.sleep(30000);
ThreadSleepUtils.sleep(3000);
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_Resource);
System.out.println(params);
System.out.println(response.body().asString());
List<LiveVisitor> liveVisitors = JsonUtil.parseResponseToListBean(response, LiveVisitor.class);
LiveVisitor one = liveVisitors.get(0);
System.out.println(one.getConfId());
confId_imageText=one.getConfId();
LiveVisitor two = liveVisitors.get(3);
LiveVisitor two = liveVisitors.get(2);
System.out.println(two.getConfId());
confId_free=two.getConfId();
LiveVisitor three = liveVisitors.get(4);
LiveVisitor three = liveVisitors.get(3);
System.out.println(three.getConfId());
confId_form=three.getConfId();
LiveVisitor four = liveVisitors.get(5);
System.out.println(four.getConfId());
confId_test=four.getConfId();
LiveVisitor five = liveVisitors.get(6);
System.out.println(four.getConfId());
LiveVisitor five = liveVisitors.get(4);
System.out.println(five.getConfId());
confId_link=five.getConfId();
System.out.println(liveVisitors);
Assert.assertNotNull(liveVisitors, network.message(params, BasicConfig.MOBILE_Resource, "查询权益列表失败", response.body().asString()));
......@@ -110,7 +109,7 @@ public class LiveVisitors implements Authorization
ResourceForm list = 访客端系统表单资料查询();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_form);
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
List<ResourceForm.FieldList> fieldList = list.getFieldList();
List<JSONObject> fieldListparam = new ArrayList<>();
JSONObject one = new JSONObject();
......@@ -124,6 +123,7 @@ public class LiveVisitors implements Authorization
params.put("fieldList", fieldListparam);
System.out.println(JSONObject.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MOBILE_FormSubmit);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MOBILE_FormSubmit,"提交表单资料失败",response.body().asString()));
}
......@@ -197,63 +197,12 @@ public class LiveVisitors implements Authorization
Assert.assertTrue(data,network.message(params,BasicConfig.MOBILE_Link,"领取链接资料失败",response.body().asString()));
}
/*访客端秒薪测试配置-查询*/
@Test(description = "访客端秒薪测试查询", priority = 11)
public ResourceTestDetail 访客端秒薪测试查询()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_test);
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceTestDetail);
ResourceTestDetail agentBeans = JsonUtil.parseResponseToBean(response, ResourceTestDetail.class);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(agentBeans, network.message(params, BasicConfig.MOBILE_ResourceTestDetail, "查询秒薪测试失败", response.body().asString()));
return agentBeans;
}
/*访客端秒薪测试-参与*/
@Test(description = "访客端秒薪测试参与", priority = 12)
public void 访客端秒薪测试参与()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceTestParticipate);
List <ResourceTestParticipate> agentBeans = JsonUtil.parseResponseToListBean(response, ResourceTestParticipate.class);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(agentBeans, network.message(params, BasicConfig.MOBILE_ResourceTestParticipate, "秒薪测试参与失败", response.body().asString()));
}
/*访客端权益测试-详情*/
@Test(description = "访客端测试提交", priority = 13)
public void 权益测试详情提交()
{
visitorAuth();
ResourceTestDetail list = 访客端秒薪测试查询();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_test);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
List<ResourceTestDetail.FieldList> fieldList = list.getFieldList();
List<JSONObject> fieldListparam = new ArrayList<>();
JSONObject one = new JSONObject();
one.put("fieldId", fieldList.get(0).getFieldId());
one.put("fieldValue","100000");
one.put("fieldSubmitIds","");
fieldListparam.add(one);
params.put("fieldList", fieldListparam);
System.out.println(JSONObject.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MOBILE_ResourceTestSubmit);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MOBILE_ResourceTestSubmit,"提交秒薪测试失败",response.body().asString()));
}
/*代理人端权益列表查询*/
@Test(description = "代理人端权益列表查询", priority = 14)
@Test(description = "代理人端权益列表查询", priority = 11)
public void 代理人端权益列表查询()
{
agentAuth();
ThreadSleepUtils.sleep(30000);
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_Resource);
......@@ -263,13 +212,13 @@ public class LiveVisitors implements Authorization
}
//代理人端图文资料查询
@Test(description = "代理人端图文资料查询", priority = 15)
@Test(description = "代理人端图文资料查询", priority = 12)
public void 代理人端图文资料查询()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_imageText);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceFindDetailByConfid);
ResourceFree agentBeans = JsonUtil.parseResponseToBean(response, ResourceFree.class);
System.out.println(JSON.toJSONString(agentBeans));
......@@ -277,7 +226,7 @@ public class LiveVisitors implements Authorization
}
//代理人端表单资料查询
@Test(description = "代理人端表单资料查询", priority = 16)
@Test(description = "代理人端表单资料查询", priority = 13)
public ResourceForm 代理人端表单资料查询()
{
agentAuth();
......@@ -291,13 +240,13 @@ public class LiveVisitors implements Authorization
}
/*代理人端免费领资料-查询*/
@Test(description = "代理人端免费领资料查询", priority = 17)
@Test(description = "代理人端免费领资料查询", priority = 14)
public void 代理人端免费领资料查询()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_free);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceFindDetailByConfid);
ResourceFree agentBeans = JsonUtil.parseResponseToBean(response, ResourceFree.class);
System.out.println(JSON.toJSONString(agentBeans));
......@@ -305,84 +254,21 @@ public class LiveVisitors implements Authorization
}
//代理人端小程序链接资料查询
@Test(description = "代理人端小程序链接资料查询", priority = 18)
@Test(description = "代理人端小程序链接资料查询", priority = 15)
public void 代理人端小程序链接资料查询()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_link);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceFindDetailByConfid);
ResourceFree agentBeans = JsonUtil.parseResponseToBean(response, ResourceFree.class);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(agentBeans, network.message(params, BasicConfig.MOBILE_ResourceFindDetailByConfid, "查询免费领资料失败", response.body().asString()));
}
//代理人端秒薪查询
@Test(description = "代理人端秒薪查询", priority = 19)
public void 代理人端秒薪查询()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_test);
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceTestDetail);
ResourceTestDetail agentBeans = JsonUtil.parseResponseToBean(response, ResourceTestDetail.class);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(agentBeans, network.message(params, BasicConfig.MOBILE_ResourceTestDetail, "查询秒薪测试失败", response.body().asString()));
}
//代理人端秒薪资料查询
@Test(description = "代理人端秒薪资料查询", priority = 20)
public ResourceTestDetail 代理人端秒薪资料查询()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_test);
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceTestDetail);
ResourceTestDetail agentBeans = JsonUtil.parseResponseToBean(response, ResourceTestDetail.class);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(agentBeans, network.message(params, BasicConfig.MOBILE_ResourceTestDetail, "查询秒薪测试失败", response.body().asString()));
return agentBeans;
}
/*代理人秒薪测试-参与*/
@Test(description = "代理人秒薪测试参与", priority = 21)
public void 代理人秒薪测试参与()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceTestParticipate);
List <ResourceTestParticipate> agentBeans = JsonUtil.parseResponseToListBean(response, ResourceTestParticipate.class);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(agentBeans, network.message(params, BasicConfig.MOBILE_ResourceTestParticipate, "秒薪测试参与失败", response.body().asString()));
}
/*代理人权益测试-详情*/
@Test(description = "代理人权益测试提交", priority = 22)
public void 代理人权益测试详情提交()
{
agentAuth();
ResourceTestDetail list = 代理人端秒薪资料查询();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_test);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
List<ResourceTestDetail.FieldList> fieldList = list.getFieldList();
List<JSONObject> fieldListparam = new ArrayList<>();
JSONObject one = new JSONObject();
one.put("fieldId", fieldList.get(0).getFieldId());
one.put("fieldValue","100000");
one.put("fieldSubmitIds","");
fieldListparam.add(one);
params.put("fieldList", fieldListparam);
System.out.println(JSONObject.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MOBILE_ResourceTestSubmit);
System.out.println(JSONObject.toJSONString("公司业务员无法参与"));
}
//助播端编辑权益
@Test(description = "助播端编辑权益", priority = 23)
@Test(description = "助播端编辑权益", priority = 16)
public void 助播端编辑权益()
{
adminAuth();
......@@ -395,7 +281,7 @@ public class LiveVisitors implements Authorization
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_ResourceEdit, "编辑主播端权益列表失败", response.body().asString()));
}
@Test(description = "上架贴片", priority = 24)
@Test(description = "上架贴片", priority = 17)
public void 上架贴片()
{
adminAuth();
......@@ -408,7 +294,7 @@ public class LiveVisitors implements Authorization
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_pasterOn, "贴片上架失败", response.body().asString()));
}
@Test(description = "获取推送列表", priority = 25)
@Test(description = "获取推送列表", priority = 18)
public void 获取推送列表()
{
adminAuth();
......@@ -424,7 +310,7 @@ public class LiveVisitors implements Authorization
Assert.assertTrue(isHasConfPaster, network.message(params, BasicConfig.MOBILE_ResourceList, "贴片上架失败", response.body().asString()));
}
@Test(description = "访客获取贴片信息", priority = 26)
@Test(description = "访客获取贴片信息", priority = 19)
public void 访客获取贴片信息()
{
ThreadSleepUtils.sleep(1000);
......@@ -436,7 +322,7 @@ public class LiveVisitors implements Authorization
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_pasterInfo, "访客未获取到贴片信息", response.body().asString()));
}
@Test(description = "贴片下架", priority = 27)
@Test(description = "贴片下架", priority = 20)
public void 贴片下架()
{
adminAuth();
......@@ -453,7 +339,7 @@ public class LiveVisitors implements Authorization
* 资料-我要咨询
*/
@Test(description = "资料咨询时客户标记同意", priority =28)
@Test(description = "资料咨询时客户标记同意", priority =21)
public void 资料咨询时客户标记同意() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -468,7 +354,7 @@ public class LiveVisitors implements Authorization
}
@Test(description = "获取访客跟进机会同意状态", priority =29)
@Test(description = "获取访客跟进机会同意状态", priority =22)
public void 获取访客跟进机会同意状态() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -480,6 +366,4 @@ public class LiveVisitors implements Authorization
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_agreeStatus, "客跟进机会同意状态为false", response.body().asString()));
}
}
......@@ -352,57 +352,5 @@ public class LiveMaterial implements Authorization {
}
@Test(description = "秒薪测试", priority = 15)
public void 秒薪测试() {
Map<String, Object> testParam = new HashMap<>();
testParam.put("companyId", 101);
testParam.put("clueType", 1);
testParam.put("mainButtonTitle","领取门票");
testParam.put("resourcePicturesArr", Arrays.asList("https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"));
testParam.put("resourceImg", "https://yun.dui88.com/kjy/image/20210306/1615033315608.jpeg");
testParam.put("resourceTitle", "秒薪测试");
testParam.put("saleButtonTitle","saleButtonTitle");
testParam.put("testType", 1);
testParam.put("resourceButtonTitle", "我要报名");
testParam.put("tradeIntroducePictures", "https://yun.dui88.com/kjy/image/20210306/1615040918512.jpeg");
Response testRes = network.postResponse(testParam, BasicConfig.MANAGER_saveTest);
Object data = testRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(testParam, BasicConfig.MANAGER_saveTest, "新增秒薪失败", testRes.body().asString()));
}
@Test(description = "删除秒薪测试", priority = 16)
public void 删除秒薪测试() {
Map<String, Object> test1Param = new HashMap<>();
test1Param.put("companyId", 101);
test1Param.put("pageIndex", 1);
test1Param.put("pageSize", 1);
test1Param.put("resourceTypeList", 13);
Response test1Res = network.getResponse(test1Param, BasicConfig.MANAGER_resourceList);
WelfareListBean data1 = JsonUtil.parseResponseToBean(test1Res, WelfareListBean.class);
if (data1.getTotalCount() > 0) {
WelfareBean bean = data1.getList().get(0);
Assert.assertNotNull(bean, network.message(test1Param, BasicConfig.MANAGER_resourceList, "查询测试失败", test1Res.body().asString()));
int id = bean.getId();
Map<String, Object> delResourceParam = new HashMap<>();
delResourceParam.put("id", id);
Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
boolean data = delResourceRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除测试失败", delResourceRes.body().asString()));
}
}
}
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