|
@@ -3,8 +3,10 @@ package page;
|
|
|
import io.qameta.allure.Description;
|
|
|
import io.qameta.allure.Story;
|
|
|
import io.restassured.response.Response;
|
|
|
+import org.testng.Reporter;
|
|
|
import org.testng.annotations.BeforeClass;
|
|
|
import org.testng.annotations.Test;
|
|
|
+import util.JDBCUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -26,18 +28,23 @@ public class PushPageTest {
|
|
|
@Description("正常测试用例:【适配项目】排序方式为发文时间,根据发文时间降序排序")
|
|
|
@Story("智能推送")
|
|
|
public void dispatchDateSortPushProjectSearchSuccess(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
- body.put("memberId",loginPage.getMember_id());
|
|
|
- body.put("sortType",0);
|
|
|
- Response response=pushPage.searchProjectPush(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
- for (int i=0;i<result.size()-1;i++){
|
|
|
- String dispatchDate1=""+result.get(i).get("dispatchDate");
|
|
|
- String dispatchDate2=""+result.get(i+1).get("dispatchDate");
|
|
|
- assertTrue(Integer.parseInt(dispatchDate1.replace("-",""))>=Integer.parseInt(dispatchDate2.replace("-","")));
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
+ body.put("memberId",loginPage.getMember_id());
|
|
|
+ body.put("sortType",0);
|
|
|
+ Response response=pushPage.searchProjectPush(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
+ for (int i=0;i<result.size()-1;i++){
|
|
|
+ String dispatchDate1=""+result.get(i).get("dispatchDate");
|
|
|
+ String dispatchDate2=""+result.get(i+1).get("dispatchDate");
|
|
|
+ assertTrue(Integer.parseInt(dispatchDate1.replace("-",""))>=Integer.parseInt(dispatchDate2.replace("-","")));
|
|
|
+ }
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.dispatchDateSortPushProjectSearchSuccess:【适配项目】排序方式为发文时间,根据发文时间降序排序,断言失败!");
|
|
|
+ throw e;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -45,18 +52,23 @@ public class PushPageTest {
|
|
|
@Description("正常测试用例:【适配项目】排序方式为截止日期,根据截止日期降序排序")
|
|
|
@Story("智能推送")
|
|
|
public void endDateSortPushProjectSearchSuccess(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
- body.put("memberId",loginPage.getMember_id());
|
|
|
- body.put("sortType",1);
|
|
|
- Response response=pushPage.searchProjectPush(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
- for (int i=0;i<result.size()-1;i++){
|
|
|
- String dispatchDate1=""+result.get(i).get("dispatchDate");
|
|
|
- String dispatchDate2=""+result.get(i+1).get("dispatchDate");
|
|
|
- assertTrue(Integer.parseInt(dispatchDate1.replace("-",""))>=Integer.parseInt(dispatchDate2.replace("-","")));
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
+ body.put("memberId",loginPage.getMember_id());
|
|
|
+ body.put("sortType",1);
|
|
|
+ Response response=pushPage.searchProjectPush(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
+ for (int i=0;i<result.size()-1;i++){
|
|
|
+ String dispatchDate1=""+result.get(i).get("dispatchDate");
|
|
|
+ String dispatchDate2=""+result.get(i+1).get("dispatchDate");
|
|
|
+ assertTrue(Integer.parseInt(dispatchDate1.replace("-",""))>=Integer.parseInt(dispatchDate2.replace("-","")));
|
|
|
+ }
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.endDateSortPushProjectSearchSuccess:【适配项目】排序方式为截止日期,根据截止日期降序排序,断言失败!");
|
|
|
+ throw e;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -85,17 +97,22 @@ public class PushPageTest {
|
|
|
@Description("正常测试用例:【适配项目】筛选申报状态为申报中的项目")
|
|
|
@Story("智能推送")
|
|
|
public void clareStartPushProjectSearchSuccess(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
- body.put("memberId",loginPage.getMember_id());
|
|
|
- body.put("status",1);
|
|
|
- Response response=pushPage.searchProjectPush(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
- for (int i=0;i<result.size()-1;i++){
|
|
|
- String declareDate=""+result.get(i).get("declareDate");
|
|
|
- assertTrue(Integer.parseInt(declareDate)>=0);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
+ body.put("memberId",loginPage.getMember_id());
|
|
|
+ body.put("status",1);
|
|
|
+ Response response=pushPage.searchProjectPush(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
+ for (int i=0;i<result.size()-1;i++){
|
|
|
+ String declareDate=""+result.get(i).get("declareDate");
|
|
|
+ assertTrue(Integer.parseInt(declareDate)>=0);
|
|
|
+ }
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.clareStartPushProjectSearchSuccess:【适配项目】筛选申报状态为申报中的项目,断言失败!");
|
|
|
+ throw e;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -103,17 +120,22 @@ public class PushPageTest {
|
|
|
@Description("正常测试用例:【适配项目】筛选申报状态为申报中的项目")
|
|
|
@Story("智能推送")
|
|
|
public void clareEndPushProjectSearchSuccess(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
- body.put("memberId",loginPage.getMember_id());
|
|
|
- body.put("status",2);
|
|
|
- Response response=pushPage.searchProjectPush(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
- for (int i=0;i<result.size()-1;i++){
|
|
|
- String declareDate=""+result.get(i).get("declareDate");
|
|
|
- assertTrue(Integer.parseInt(declareDate)<=0);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file", "/apijson/page/pushPage/pcpIntelligentPushGetGslFocusFormal.json");
|
|
|
+ body.put("memberId",loginPage.getMember_id());
|
|
|
+ body.put("status",2);
|
|
|
+ Response response=pushPage.searchProjectPush(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ List<HashMap<String,Object>> result=response.path("data.result");
|
|
|
+ for (int i=0;i<result.size()-1;i++){
|
|
|
+ String declareDate=""+result.get(i).get("declareDate");
|
|
|
+ assertTrue(Integer.parseInt(declareDate)<=0);
|
|
|
+ }
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.clareEndPushProjectSearchSuccess:【适配项目】筛选申报状态为申报中的项目,断言失败!");
|
|
|
+ throw e;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -122,220 +144,275 @@ public class PushPageTest {
|
|
|
@Story("智能推送")
|
|
|
public void matchProjectSuccess(){
|
|
|
try{
|
|
|
- Thread.sleep(5000);
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
+ try{
|
|
|
+ Thread.sleep(5000);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file","/apijson/page/pushPage/pcpNewPersonalCenterUpdateIntelligentPush.json");
|
|
|
+ body.put("userId",loginPage.getMember_id());
|
|
|
+ Response response=pushPage.matchProject(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ assertTrue(response.path("data")==null);
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.matchProjectSuccess:【适配项目】剩余次数>0,立即匹配项目,断言失败!");
|
|
|
+ throw e;
|
|
|
}
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file","/apijson/page/pushPage/pcpNewPersonalCenterUpdateIntelligentPush.json");
|
|
|
- body.put("userId",loginPage.getMember_id());
|
|
|
- Response response=pushPage.matchProject(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- assertTrue(response.path("data")==null);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【适配项目】获取匹配次数")
|
|
|
@Story("智能推送")
|
|
|
public void getMatchProjectNumSuccess(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file","/apijson/page/pushPage/pcpNewPersonalCenterGetIntelligentPushNum.json");
|
|
|
- body.put("userId",loginPage.getMember_id());
|
|
|
- Response response=pushPage.getMatchProjectNum(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- assertTrue((int)response.path("data")<=3 && (int)response.path("data")>=0);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file","/apijson/page/pushPage/pcpNewPersonalCenterGetIntelligentPushNum.json");
|
|
|
+ body.put("userId",loginPage.getMember_id());
|
|
|
+ Response response=pushPage.getMatchProjectNum(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ assertTrue((int)response.path("data")<=3 && (int)response.path("data")>=0);
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.getMatchProjectNumSuccess:【适配项目】获取匹配次数,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【推送设置】获取公众号二维码")
|
|
|
@Story("智能推送")
|
|
|
public void getQRCode(){
|
|
|
- Response response=pushPage.getQRCode();
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- String code=response.path("data");
|
|
|
- assertTrue(code.contains("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="));
|
|
|
+ try{
|
|
|
+ Response response=pushPage.getQRCode();
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ String code=response.path("data");
|
|
|
+ assertTrue(code.contains("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="));
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.getQRCode:【推送设置】获取公众号二维码,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【推送设置】开启智能推送、仅有新项目推送、推送时间9:00")
|
|
|
@Story("智能推送")
|
|
|
public void updateBackSysUserPushSetAllOpen(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file","/apijson/page/pushPage/pcpIntelligentPushUpdateBackSysUserPushSet.json");
|
|
|
- body.put("userId",loginPage.getMember_id());
|
|
|
- body.put("id",pushPage.getBackSysUserPushSetId(loginPage.getMember_id()));
|
|
|
- Response response1=pushPage.updateBackSysUserPushSet(body);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertEquals(response1.path("data"),"修改成功");
|
|
|
- Response response2=pushPage.getBackSysUserPushSet(loginPage.getMember_id());
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- assertEquals((int)response2.path("data.matchPushSet"),1);
|
|
|
- assertEquals((int)response2.path("data.matchRepeatPush"),1);
|
|
|
- assertEquals((int)response2.path("data.pushTime"),1);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file","/apijson/page/pushPage/pcpIntelligentPushUpdateBackSysUserPushSet.json");
|
|
|
+ body.put("userId",loginPage.getMember_id());
|
|
|
+ body.put("id",pushPage.getBackSysUserPushSetId(loginPage.getMember_id()));
|
|
|
+ Response response1=pushPage.updateBackSysUserPushSet(body);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertEquals(response1.path("data"),"修改成功");
|
|
|
+ Response response2=pushPage.getBackSysUserPushSet(loginPage.getMember_id());
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ assertEquals((int)response2.path("data.matchPushSet"),1);
|
|
|
+ assertEquals((int)response2.path("data.matchRepeatPush"),1);
|
|
|
+ assertEquals((int)response2.path("data.pushTime"),1);
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.updateBackSysUserPushSetAllOpen:【推送设置】开启智能推送、仅有新项目推送、推送时间9:00,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【推送设置】推送时间15:00")
|
|
|
@Story("智能推送")
|
|
|
public void updateBackSysUserPushSetPutTime2(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file","/apijson/page/pushPage/pcpIntelligentPushUpdateBackSysUserPushSet.json");
|
|
|
- body.put("userId",loginPage.getMember_id());
|
|
|
- body.put("id",pushPage.getBackSysUserPushSetId(loginPage.getMember_id()));
|
|
|
- body.put("pushTime",2);
|
|
|
- Response response1=pushPage.updateBackSysUserPushSet(body);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertEquals(response1.path("data"),"修改成功");
|
|
|
- Response response2=pushPage.getBackSysUserPushSet(loginPage.getMember_id());
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- assertEquals((int)response2.path("data.pushTime"),2);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file","/apijson/page/pushPage/pcpIntelligentPushUpdateBackSysUserPushSet.json");
|
|
|
+ body.put("userId",loginPage.getMember_id());
|
|
|
+ body.put("id",pushPage.getBackSysUserPushSetId(loginPage.getMember_id()));
|
|
|
+ body.put("pushTime",2);
|
|
|
+ Response response1=pushPage.updateBackSysUserPushSet(body);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertEquals(response1.path("data"),"修改成功");
|
|
|
+ Response response2=pushPage.getBackSysUserPushSet(loginPage.getMember_id());
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ assertEquals((int)response2.path("data.pushTime"),2);
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.updateBackSysUserPushSetPutTime2:【推送设置】推送时间15:00,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【推送设置】关闭智能推送、仅有新项目推送")
|
|
|
@Story("智能推送")
|
|
|
public void updateBackSysUserPushSetAllClose(){
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file","/apijson/page/pushPage/pcpIntelligentPushUpdateBackSysUserPushSet.json");
|
|
|
- body.put("userId",loginPage.getMember_id());
|
|
|
- body.put("id",pushPage.getBackSysUserPushSetId(loginPage.getMember_id()));
|
|
|
- body.put("matchPushSet",2);
|
|
|
- body.put("matchRepeatPush",2);
|
|
|
- Response response1=pushPage.updateBackSysUserPushSet(body);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertEquals(response1.path("data"),"修改成功");
|
|
|
- Response response2=pushPage.getBackSysUserPushSet(loginPage.getMember_id());
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- assertEquals((int)response2.path("data.matchPushSet"),2);
|
|
|
- assertEquals((int)response2.path("data.matchRepeatPush"),2);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file","/apijson/page/pushPage/pcpIntelligentPushUpdateBackSysUserPushSet.json");
|
|
|
+ body.put("userId",loginPage.getMember_id());
|
|
|
+ body.put("id",pushPage.getBackSysUserPushSetId(loginPage.getMember_id()));
|
|
|
+ body.put("matchPushSet",2);
|
|
|
+ body.put("matchRepeatPush",2);
|
|
|
+ Response response1=pushPage.updateBackSysUserPushSet(body);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertEquals(response1.path("data"),"修改成功");
|
|
|
+ Response response2=pushPage.getBackSysUserPushSet(loginPage.getMember_id());
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ assertEquals((int)response2.path("data.matchPushSet"),2);
|
|
|
+ assertEquals((int)response2.path("data.matchRepeatPush"),2);
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.updateBackSysUserPushSetAllClose:【推送设置】关闭智能推送、仅有新项目推送,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【关注政策】输入关键词,查询关注政策")
|
|
|
@Story("智能推送")
|
|
|
public void keywordGetGsIFocusPolicy(){
|
|
|
- HashMap<String,Object> body1=new HashMap<>();
|
|
|
- body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
- body1.put("id",loginPage.getMember_id());
|
|
|
- body1.put("keyword","技术,佛山");
|
|
|
- Response response1=pushPage.focusPolicySet(body1);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertTrue(response1.path("data")==null);
|
|
|
- HashMap<String,Object> body2=new HashMap<>();
|
|
|
- body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
- body2.put("memberId",loginPage.getMember_id());
|
|
|
- Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- ArrayList<HashMap<String,Object>> map=response2.path("data.result");
|
|
|
- map.forEach(map1 -> {
|
|
|
- assertTrue(String.valueOf(map1.get("title")).contains("技术") || String.valueOf(map1.get("title")).contains("佛山"));
|
|
|
- });
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body1=new HashMap<>();
|
|
|
+ body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
+ body1.put("id",loginPage.getMember_id());
|
|
|
+ body1.put("keyword","技术,佛山");
|
|
|
+ Response response1=pushPage.focusPolicySet(body1);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertTrue(response1.path("data")==null);
|
|
|
+ HashMap<String,Object> body2=new HashMap<>();
|
|
|
+ body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
+ body2.put("memberId",loginPage.getMember_id());
|
|
|
+ Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ ArrayList<HashMap<String,Object>> map=response2.path("data.result");
|
|
|
+ map.forEach(map1 -> {
|
|
|
+ assertTrue(String.valueOf(map1.get("title")).contains("技术") || String.valueOf(map1.get("title")).contains("佛山"));
|
|
|
+ });
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.keywordGetGsIFocusPolicy:【关注政策】输入关键词,查询关注政策,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【关注政策】输入政策等级,查询关注政策")
|
|
|
@Story("智能推送")
|
|
|
public void zcdjGetGsIFocusPolicy(){
|
|
|
- HashMap<String,Object> body1=new HashMap<>();
|
|
|
- body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
- body1.put("id",loginPage.getMember_id());
|
|
|
- body1.put("zcJibie","1,3");
|
|
|
- Response response1=pushPage.focusPolicySet(body1);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertTrue(response1.path("data")==null);
|
|
|
- HashMap<String,Object> body2=new HashMap<>();
|
|
|
- body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
- body2.put("memberId",loginPage.getMember_id());
|
|
|
- Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- ArrayList<HashMap<String,Object>> map=response2.path("data.result");
|
|
|
- map.forEach(map1 -> {
|
|
|
- assertTrue((int)map1.get("heat")==0 || (int)map1.get("heat")==2);
|
|
|
- });
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body1=new HashMap<>();
|
|
|
+ body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
+ body1.put("id",loginPage.getMember_id());
|
|
|
+ body1.put("zcJibie","1,3");
|
|
|
+ Response response1=pushPage.focusPolicySet(body1);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertTrue(response1.path("data")==null);
|
|
|
+ HashMap<String,Object> body2=new HashMap<>();
|
|
|
+ body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
+ body2.put("memberId",loginPage.getMember_id());
|
|
|
+ Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ ArrayList<HashMap<String,Object>> map=response2.path("data.result");
|
|
|
+ map.forEach(map1 -> {
|
|
|
+ assertTrue((int)map1.get("heat")==0 || (int)map1.get("heat")==2);
|
|
|
+ });
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.zcdjGetGsIFocusPolicy:【关注政策】输入政策等级,查询关注政策,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【关注政策】输入关键词、政策等级,查询关注政策")
|
|
|
@Story("智能推送")
|
|
|
public void allGetGsIFocusPolicy(){
|
|
|
- HashMap<String,Object> body1=new HashMap<>();
|
|
|
- body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
- body1.put("id",loginPage.getMember_id());
|
|
|
- body1.put("zcJibie","1,3");
|
|
|
- body1.put("keyword","技术,佛山");
|
|
|
- Response response1=pushPage.focusPolicySet(body1);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertTrue(response1.path("data")==null);
|
|
|
- HashMap<String,Object> body2=new HashMap<>();
|
|
|
- body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
- body2.put("memberId",loginPage.getMember_id());
|
|
|
- Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- ArrayList<HashMap<String,Object>> map=response2.path("data.result");
|
|
|
- map.forEach(map1 -> {
|
|
|
- assertTrue((int)map1.get("heat")==0 || (int)map1.get("heat")==2);
|
|
|
- assertTrue(String.valueOf(map1.get("title")).contains("技术") || String.valueOf(map1.get("title")).contains("佛山"));
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body1=new HashMap<>();
|
|
|
+ body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
+ body1.put("id",loginPage.getMember_id());
|
|
|
+ body1.put("zcJibie","1,3");
|
|
|
+ body1.put("keyword","技术,佛山");
|
|
|
+ Response response1=pushPage.focusPolicySet(body1);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertTrue(response1.path("data")==null);
|
|
|
+ HashMap<String,Object> body2=new HashMap<>();
|
|
|
+ body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
+ body2.put("memberId",loginPage.getMember_id());
|
|
|
+ Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ ArrayList<HashMap<String,Object>> map=response2.path("data.result");
|
|
|
+ map.forEach(map1 -> {
|
|
|
+ assertTrue((int)map1.get("heat")==0 || (int)map1.get("heat")==2);
|
|
|
+ assertTrue(String.valueOf(map1.get("title")).contains("技术") || String.valueOf(map1.get("title")).contains("佛山"));
|
|
|
|
|
|
- });
|
|
|
- HashMap<String,Object> body3=new HashMap<>();
|
|
|
- body3.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetFocusPolicySetting.json");
|
|
|
- body3.put("id",loginPage.getMember_id());
|
|
|
- Response response3=pushPage.getFocusPolicySetInfo(body3);
|
|
|
- assertEquals((int) response3.path("code"),200);
|
|
|
- assertEquals(response3.path("message"),"操作成功");
|
|
|
- assertEquals(response3.path("data.keyword"),"技术,佛山");
|
|
|
- assertEquals(response3.path("data.zcJibie"),"1,3");
|
|
|
+ });
|
|
|
+ HashMap<String,Object> body3=new HashMap<>();
|
|
|
+ body3.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetFocusPolicySetting.json");
|
|
|
+ body3.put("id",loginPage.getMember_id());
|
|
|
+ Response response3=pushPage.getFocusPolicySetInfo(body3);
|
|
|
+ assertEquals((int) response3.path("code"),200);
|
|
|
+ assertEquals(response3.path("message"),"操作成功");
|
|
|
+ assertEquals(response3.path("data.keyword"),"技术,佛山");
|
|
|
+ assertEquals(response3.path("data.zcJibie"),"1,3");
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.allGetGsIFocusPolicy:【关注政策】输入关键词、政策等级,查询关注政策,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("异常测试用例:【关注政策】均为空,查询关注政策为空")
|
|
|
@Story("智能推送")
|
|
|
public void emptyGetGsIFocusPolicy(){
|
|
|
- HashMap<String,Object> body1=new HashMap<>();
|
|
|
- body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
- body1.put("id",loginPage.getMember_id());
|
|
|
- Response response1=pushPage.focusPolicySet(body1);
|
|
|
- assertEquals((int) response1.path("code"),200);
|
|
|
- assertEquals(response1.path("message"),"操作成功");
|
|
|
- assertTrue(response1.path("data")==null);
|
|
|
- HashMap<String,Object> body2=new HashMap<>();
|
|
|
- body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
- body2.put("memberId",loginPage.getMember_id());
|
|
|
- Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
- assertEquals((int) response2.path("code"),200);
|
|
|
- assertEquals(response2.path("message"),"操作成功");
|
|
|
- assertTrue((int)response2.path("data.total")==0);
|
|
|
+ try{
|
|
|
+ HashMap<String,Object> body1=new HashMap<>();
|
|
|
+ body1.put("_file","/apijson/page/pushPage/pcpIntelligentPushFocusPolicySet.json");
|
|
|
+ body1.put("id",loginPage.getMember_id());
|
|
|
+ Response response1=pushPage.focusPolicySet(body1);
|
|
|
+ assertEquals((int) response1.path("code"),200);
|
|
|
+ assertEquals(response1.path("message"),"操作成功");
|
|
|
+ assertTrue(response1.path("data")==null);
|
|
|
+ HashMap<String,Object> body2=new HashMap<>();
|
|
|
+ body2.put("_file","/apijson/page/pushPage/pcpIntelligentPushGetGslFocusPolicy.json");
|
|
|
+ body2.put("memberId",loginPage.getMember_id());
|
|
|
+ Response response2=pushPage.getGsIFocusPolicy(body2);
|
|
|
+ assertEquals((int) response2.path("code"),200);
|
|
|
+ assertEquals(response2.path("message"),"操作成功");
|
|
|
+ assertTrue((int)response2.path("data.total")==0);
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.emptyGetGsIFocusPolicy:【关注政策】均为空,查询关注政策为空,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@Description("正常测试用例:【我的订阅】我的订阅列表查询")
|
|
|
@Story("智能推送")
|
|
|
public void mySubscribe(){
|
|
|
- List<Integer> yidingyue= policyPage.getYidingyue();
|
|
|
- HashMap<String,Object> body=new HashMap<>();
|
|
|
- body.put("_file","/apijson/page/pushPage/pcpIntelligentPushMySubscribe.json");
|
|
|
- body.put("id",loginPage.getMember_id());
|
|
|
- Response response=pushPage.mySubscribe(body);
|
|
|
- assertEquals((int) response.path("code"),200);
|
|
|
- assertEquals(response.path("message"),"操作成功");
|
|
|
- ArrayList<HashMap<String,Object>> list=response.path("data");
|
|
|
- list.forEach(map -> {
|
|
|
- assertTrue(yidingyue.contains(map.get("id")));
|
|
|
- });
|
|
|
+ try{
|
|
|
+ List<Integer> yidingyue= policyPage.getYidingyue();
|
|
|
+ HashMap<String,Object> body=new HashMap<>();
|
|
|
+ body.put("_file","/apijson/page/pushPage/pcpIntelligentPushMySubscribe.json");
|
|
|
+ body.put("id",loginPage.getMember_id());
|
|
|
+ Response response=pushPage.mySubscribe(body);
|
|
|
+ assertEquals((int) response.path("code"),200);
|
|
|
+ assertEquals(response.path("message"),"操作成功");
|
|
|
+ ArrayList<HashMap<String,Object>> list=response.path("data");
|
|
|
+ list.forEach(map -> {
|
|
|
+ assertTrue(yidingyue.contains(map.get("id")));
|
|
|
+ });
|
|
|
+ }catch (AssertionError e){
|
|
|
+ Reporter.log("PushPageTest.mySubscribe:【我的订阅】我的订阅列表查询,断言失败!");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
}
|