Commit ac4118c7 authored by 郭姣's avatar 郭姣

Merge branch 'master' into gifeature/20210924-gj

# Conflicts:
#	src/test/liveTestNG.xml
parents b8f87874 5889baec
......@@ -17,6 +17,4 @@ public class TreasureAward {
private Integer winLimitCount;
private Integer isLimit;
}
......@@ -392,7 +392,7 @@ public class HomePage implements Authorization {
params.put("pageNo",1);
params.put("pageSize",20);
Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage);
Object id = listRes.jsonPath().getJsonObject("data.list.get(1).id");
Object id = listRes.jsonPath().getJsonObject("data.list.get(0).id");
String desc = listRes.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString()));
......@@ -795,6 +795,7 @@ public class HomePage implements Authorization {
//获取用户信息
Map<String, Object> params = new HashMap<String, Object>();
Response response = network.getResponse(USER_INFO);
System.out.println(response.body().asString());
userId = response.jsonPath().getInt("data.userId");
Assert.assertNotNull(response.jsonPath().getJsonObject("data"),network.message(USER_INFO,"获取用户信息失败",response.body().asString()));
......
......@@ -103,13 +103,8 @@ public class Pay implements Authorization {
System.out.println(response.body().asString());
int data = response.jsonPath().getInt("data");
Assert.assertTrue(data==5,network.message(statusParams, PAY_status,"取消支付:订单状态不对",response.body().asString()));
}
@Test (description = "默认付费_切换会员类型为保险版",priority = 4)
public void 默认付费_切换为保险版会员类型(){
//会员类型版本判断
......@@ -139,7 +134,7 @@ public class Pay implements Authorization {
Response response = network.getResponse(PAY_isRenewCondition);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertFalse(data,network.message(PAY_isRenewCondition,"不满足续费条件",response.body().asString()));
Assert.assertTrue(data,network.message(PAY_isRenewCondition,"用户不满足续费条件",response.body().asString()));
}
......@@ -176,8 +171,6 @@ public class Pay implements Authorization {
codeListParam.put("pageSize",20);
response =network.getResponse(codeListParam,MANAGER_codeList);
promotionCode=response.jsonPath().getString("data.list[0].promotionCode");
}
......
......@@ -3,6 +3,7 @@ package com.kjj.cases.live.agent;
import com.kjj.bean.agent.GrabWelfares;
import com.kjj.bean.agent.LiveUserList;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.live.liveConfig.LiveMaterial;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.IdMakeUtil;
......@@ -13,10 +14,13 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.utils.BaseUtils.ssoLogin;
public class LiveLater implements Authorization {
public String pageSize;
public List<LiveUserList> liveUserId;
......@@ -368,4 +372,23 @@ public class LiveLater implements Authorization {
int potentialNum = response.jsonPath().getInt("data.potentialNum");
Assert.assertTrue(potentialNum > 0,network.message(params,BasicConfig.MOBILE_potentialNum,"准客户数量错误",response.body().asString()));
}
@Test(description = "删除权益", priority = 21)
public void 删除权益() {
ssoLogin();
for (int resourceId : Arrays.asList(LiveMaterial.resourceId, LiveMaterial.termResourceId, LiveMaterial.freeResourceId, LiveMaterial.picResourceId)){
System.out.println(resourceId);
Map<String, Object> delResourceParam = new HashMap<>();
delResourceParam.put("id", resourceId);
Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
try {
boolean data = delResourceRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除权益失败", delResourceRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(delResourceParam, BasicConfig.MANAGER_delResource, "获取数据失败", delResourceRes.body().asString()));
}
}
}
}
......@@ -509,6 +509,4 @@ public class Reward implements Authorization {
}
}
......@@ -16,45 +16,23 @@ import java.util.Map;
public class CloseLive implements Authorization {
@BeforeClass
public void setUp() {
adminAuth();
}
@Test(description = "结束直播", priority = 1)
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
}
@Test(description = "删除权益", priority = 2)
public void 删除权益() {
for (int resourceId : Arrays.asList(LiveMaterial.resourceId, LiveMaterial.termResourceId, LiveMaterial.freeResourceId, LiveMaterial.picResourceId)){
System.out.println(resourceId);
Map<String, Object> delResourceParam = new HashMap<>();
delResourceParam.put("id", resourceId);
Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
try {
boolean data = delResourceRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除权益失败", delResourceRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(delResourceParam, BasicConfig.MANAGER_delResource, "获取数据失败", delResourceRes.body().asString()));
}
}
}
@BeforeClass
public void setUp() {
adminAuth();
}
@Test(description = "结束直播", priority = 1)
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
}
}
......@@ -59,28 +59,11 @@ public class SimpleLiveConfig implements Authorization {
Params.put("shareContent", "自动化直播 #{shortLink}");
Params.put("shelfStatus", 2);
Params.put("secondPoster", "https://streamimg.kjjcrm.com/kjy/image/20210201/cc999ebde48e49f99ac3f0d93480453f.jpg");
Params.put("regionType",2);
Params.put("regionType",1);
Params.put("preAwardUrl","https://yun.dui88.com/kjy/image/20210629/1624949155842.png");
Params.put("preWindowUrl","https://yun.dui88.com/kjy/image/20210629/1624949098093.png");
Params.put("distributionType", 0);
Params.put("distributionType", 1);
Params.put("existSeriesPoster", 0);
List<ProvinceCityCodeList> provinceCityCode = new ArrayList<>();
ProvinceCityCodeList save = new ProvinceCityCodeList();
save.setProvinceCode(110000);
save.setCityCode(null);
provinceCityCode.add(save);
ProvinceCityCodeList save1 = new ProvinceCityCodeList();
save1.setProvinceCode(420000);
save1.setCityCode(420900);
provinceCityCode.add(save1);
ProvinceCityCodeList save2 = new ProvinceCityCodeList();
save2.setProvinceCode(330000);
save2.setCityCode(330100);
provinceCityCode.add(save2);
Params.put("provinceCityCodeList", provinceCityCode);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveAndUpdate_0);
liveID = response.jsonPath().getString("data");
EncodeLiveID = IdMakeUtil.encodingId(Long.valueOf(liveID));
......@@ -148,4 +131,21 @@ public class SimpleLiveConfig implements Authorization {
System.out.println(response.body().asString());
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveAndUpdate_8, "产品资料配置失败", response.body().asString()));
}
/**
* 直播中奖品
*/
//直播中奖品配置
@Test(description = "直播中抽奖", priority = 9)
public void 直播中抽奖() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", liveID);
Params.put("interactNum", 1);
Params.put("showInteractNum", 1);
Params.put("welfareId", 191);
Params.put("afterMin", 20);
Response response = network.postResponse(Params, BasicConfig.MANAGER_add_1);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_add_1, "直播中抽奖配置失败", response.body().asString()));
}
}
This diff is collapsed.
......@@ -276,7 +276,16 @@ public class BasicConfig {
public static final String MANAGER_videoSwitch = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/status/switch";
public static final String MANAGER_videoDetail = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/detail";
// *************** 新版预告页 ***************
// *************** 砸金蛋 ***************
public static final String MANAGER_goldenEgg_saveOrUpdate = MANAGER_HOST +"/kjy/manager/live/treasure/goldenEgg/saveOrUpdate";
public static final String MANAGER_goldenEgg_detail = MANAGER_HOST +"/kjy/manager/live/treasure/goldenEgg/detail";
public static final String MANAGER_goldenEgg_switchStatus = MANAGER_HOST +"/kjy/manager/live/treasure/goldenEgg/switchStatus";
public static final String MOBILE_goldenEgg_detail = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/detail";
public static final String MOBILE_goldenEgg_open = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/open";
public static final String MOBILE_goldenEgg_joinInfo = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/joinInfo";
public static final String MOBILE_goldenEgg_list = MOBILE_HOST +"/kjy/live/user/list";
public static final String MOBILE_oldenEggTimeOut = MOBILE_HOST +"/test/goldenEggTimeOut";
public static final String MOBILE_goldenEgg_reset = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/reset";
// *************** 猜数字红包 ***************
......
This diff is collapsed.
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