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

修改底部互动用方案用例前的删除操作

parent 871deaf4
......@@ -543,6 +543,22 @@ public class HomePage implements Authorization {
Response response = network.getResponse(params, ARTICLE_interact);
boolean success = response.jsonPath().getBoolean("success");
int size = response.jsonPath().getInt("data.size()");
if(size!=0){//文章已配置互动素材
//删除文章的底部互动方案
params.put("articleId", articleId);
response = network.postHeaderResponse(params, MANAGER_deleteInteract);
success = response.jsonPath().getBoolean("success");
boolean result = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success, network.message(params, MANAGER_deleteActivity, "接口返回失败", response.body().asString()));
Assert.assertTrue(result, network.message(params, MANAGER_deleteActivity, "删除失败", response.body().asString()));
//重新访问文章
sleep(10000);
params.put("cid", grasscontentId);
response = network.getResponse(params, ARTICLE_interact);
success= response.jsonPath().getBoolean("success");
size = response.jsonPath().getInt("data.size()");
}
Assert.assertTrue(success, network.message(params, ARTICLE_interact, "接口返回失败", response.body().asString()));
Assert.assertEquals(size,0, network.message(params, ARTICLE_interact, "返回数据为空", response.body().asString()));
......
......@@ -423,7 +423,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A抽奖码数量", priority = 33)
public void 访客A抽奖码数量() {
visitorAuth1();
codeCount(3);
codeCount(0);
}
......@@ -913,7 +913,7 @@ public class Lottery implements Authorization {
@Test(description = "访客J抽奖码数量", priority = 85)
public void 访客J抽奖码数量() {
visitorAuth10();
codeCount(3);
codeCount(0);
}
......
......@@ -179,7 +179,9 @@ public class BaseUtils {
Map<String, Object> myCountParam = new HashMap<>();
myCountParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response myCountRes = network.getResponse(myCountParam, BasicConfig.USER_myCount);
int data = myCountRes.jsonPath().getInt("data");
Assert.assertEquals(data, num ,network.message(myCountParam, BasicConfig.USER_myCount, "获取抽奖码数量失败", myCountRes.body().asString()));
if(num != 0){
int data = myCountRes.jsonPath().getInt("data");
Assert.assertEquals(data, num ,network.message(myCountParam, BasicConfig.USER_myCount, "抽奖码数量错误", myCountRes.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