Commit a8a03444 authored by 张艳玲's avatar 张艳玲

update

parent 35d683b8
This diff is collapsed.
package com.kjj.cases.live.signing;
import com.kjj.bean.manager.SaveRewardConfig;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AgentOpen implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "扫码签收核奖_代理人得红包", priority = 1)
public void 扫码签收核奖_代理人得红包() {
Map<String, Object> configParam = new HashMap<>();
configParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
// configParam.put("liveId", 3031);
List<SaveRewardConfig> configs = new ArrayList<>();
SaveRewardConfig saveReward = new SaveRewardConfig();
saveReward.setConfName(24);
saveReward.setConfValue(2);
configs.add(saveReward);
SaveRewardConfig saveReward1 = new SaveRewardConfig();
saveReward1.setConfName(23);
saveReward1.setConfValue(2);
configs.add(saveReward1);
SaveRewardConfig saveReward2 = new SaveRewardConfig();
saveReward2.setConfName(25);
saveReward2.setConfValue(1);
configs.add(saveReward2);
configParam.put("list",configs);
Response response = network.postResponse(configParam, BasicConfig.MANAGER_saveRewardConfig);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(configParam, BasicConfig.MANAGER_saveRewardConfig, "不开启核奖设置失败", response.body().asString()));
}
@Test(description = "获取中奖名单配置", priority = 2)
public void 获取中奖名单配置() {
Map<String, Object> getConfParam = new HashMap<>();
getConfParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
// getConfParam.put("liveId", 3031);
Response response = network.getResponse(getConfParam, BasicConfig.MANAGER_getConf);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(getConfParam, BasicConfig.MANAGER_getConf, "获取中奖名单配置失败", response.body().asString()));
}
}
package com.kjj.cases.live.signing;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.manager.SaveRewardConfig;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class NuclearAward implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "不开启核奖", priority = 1)
public void 不开启核奖() {
Map<String, Object> configParam = new HashMap<>();
configParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
List<SaveRewardConfig> configs = new ArrayList<>();
SaveRewardConfig saveReward = new SaveRewardConfig();
saveReward.setConfName(24);
saveReward.setConfValue(1);
configs.add(saveReward);
SaveRewardConfig saveReward1 = new SaveRewardConfig();
saveReward1.setConfName(23);
saveReward1.setConfValue(1);
configs.add(saveReward1);
configParam.put("list",configs);
Response response = network.postResponse(configParam, BasicConfig.MANAGER_saveRewardConfig);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(configParam, BasicConfig.MANAGER_saveRewardConfig, "接口调用失败"+ JSON.toJSONString(response.jsonPath().get()), response.body().asString()));
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(configParam, BasicConfig.MANAGER_saveRewardConfig, "不开启核奖设置失败", response.body().asString()));
}
@Test(description = "获取不开启核奖配置是否正确", priority = 2)
public void 获取不开启核奖配置是否正确() {
Map<String, Object> getConfParam = new HashMap<>();
getConfParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(getConfParam, BasicConfig.MANAGER_getConf);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(getConfParam, BasicConfig.MANAGER_getConf, "不开启核奖配置未配置成功", response.body().asString()));
}
}
package com.kjj.cases.live.signing;
import com.kjj.bean.manager.SaveRewardConfig;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SignAward implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "扫码签收核奖_不开启红包", priority = 1)
public void 扫码签收核奖_不开启红包() {
Map<String, Object> configParam = new HashMap<>();
configParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
List<SaveRewardConfig> configs = new ArrayList<>();
SaveRewardConfig saveReward = new SaveRewardConfig();
saveReward.setConfName(24);
saveReward.setConfValue(1);
configs.add(saveReward);
SaveRewardConfig saveReward1 = new SaveRewardConfig();
saveReward1.setConfName(23);
saveReward1.setConfValue(2);
configs.add(saveReward1);
SaveRewardConfig saveReward2 = new SaveRewardConfig();
saveReward2.setConfName(25);
saveReward2.setConfValue(1);
configs.add(saveReward2);
configParam.put("list",configs);
Response response = network.postResponse(configParam, BasicConfig.MANAGER_saveRewardConfig);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(configParam, BasicConfig.MANAGER_saveRewardConfig, "不开启红包设置失败", response.body().asString()));
}
@Test(description = "获取中奖名单配置", priority = 2)
public void 获取中奖名单配置() {
Map<String, Object> getConfParam = new HashMap<>();
getConfParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(getConfParam, BasicConfig.MANAGER_getConf);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(getConfParam, BasicConfig.MANAGER_getConf, "获取中奖名单配置失败", response.body().asString()));
}
@Test(description = "获取奖品签收小程序码", priority = 3)
public void 获取奖品签收小程序码() {
Map<String, Object> CodeParam = new HashMap<>();
CodeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(CodeParam, BasicConfig.MANAGER_rewardSignQrCode);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(CodeParam, BasicConfig.MANAGER_rewardSignQrCode, "获取小程序码失败", response.body().asString()));
}
}
package com.kjj.cases.live.signing;
import com.kjj.bean.manager.SaveRewardConfig;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UserOpen implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "扫码签收核奖_代理人得红包", priority = 1)
public void 扫码签收核奖_代理人得红包() {
Map<String, Object> configParam = new HashMap<>();
configParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
List<SaveRewardConfig> configs = new ArrayList<>();
SaveRewardConfig saveReward = new SaveRewardConfig();
saveReward.setConfName(24);
saveReward.setConfValue(3);
configs.add(saveReward);
SaveRewardConfig saveReward1 = new SaveRewardConfig();
saveReward1.setConfName(23);
saveReward1.setConfValue(2);
configs.add(saveReward1);
SaveRewardConfig saveReward2 = new SaveRewardConfig();
saveReward2.setConfName(25);
saveReward2.setConfValue(1);
configs.add(saveReward2);
configParam.put("list",configs);
Response response = network.postResponse(configParam, BasicConfig.MANAGER_saveRewardConfig);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(configParam, BasicConfig.MANAGER_saveRewardConfig, "扫码签收代理人得红包配置失败", response.body().asString()));
}
@Test(description = "获取中奖名单配置", priority = 2)
public void 获取中奖名单配置() {
Map<String, Object> getConfParam = new HashMap<>();
getConfParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(getConfParam, BasicConfig.MANAGER_getConf);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(getConfParam, BasicConfig.MANAGER_getConf, "获取代理人得红包配置失败", response.body().asString()));
}
}
...@@ -530,11 +530,10 @@ public class BasicConfig { ...@@ -530,11 +530,10 @@ public class BasicConfig {
public static final String MANAGER_getConf = MANAGER_HOST+ "/kjy/manager/live/awardGrant/getConf"; public static final String MANAGER_getConf = MANAGER_HOST+ "/kjy/manager/live/awardGrant/getConf";
public static final String MANAGER_rewardSignQrCode = MANAGER_HOST+ "/kjy/manager/live/awardGrant/rewardSignQrCode"; public static final String MANAGER_rewardSignQrCode = MANAGER_HOST+ "/kjy/manager/live/awardGrant/rewardSignQrCode";
public static final String MANAGER_saveRewardConfig = MANAGER_HOST+ "/kjy/manager/live/awardGrant/saveRewardConfig"; public static final String MANAGER_saveRewardConfig = MANAGER_HOST+ "/kjy/manager/live/awardGrant/saveRewardConfig";
public static final String MOBILE_small = MOBILE_HOST + "/kjy/live/card/user/small"; public static final String MOBILE_small = MOBILE_HOST + "/kjy/live/card/user/small";
public static final String MOBILE_visitorSignInfo = MOBILE_HOST + "/kjy/live/reward/visitor/signInfo"; public static final String MOBILE_visitorSignInfo = MOBILE_HOST + "/kjy/live/reward/visitor/signInfo";
public static final String MOBILE_doSign = MOBILE_HOST + "/kjy/live/reward/visitor/doSign"; public static final String MOBILE_doSign = MOBILE_HOST + "/kjy/live/reward/visitor/doSign";
public static final String MOBILE_signOpen = MOBILE_HOST + "/kjy/live/visitor/reward/winner/signOpen";
......
...@@ -186,35 +186,12 @@ ...@@ -186,35 +186,12 @@
</classes> </classes>
</test> </test>
<!-- <test preserve-order="true" name="奖品发放配置-不开启核奖">--> <test preserve-order="true" name="奖品发放配置">
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Reward"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="奖品发放配置-不开启核奖">
<classes>
<class name="com.kjj.cases.live.signing.NuclearAward"/>
</classes>
</test>
<test preserve-order="true" name="扫码签收核奖_不开启红包">
<classes>
<class name="com.kjj.cases.live.signing.SignAward"/>
</classes>
</test>
<test preserve-order="true" name="扫码签收核奖_代理人得红包">
<classes> <classes>
<class name="com.kjj.cases.live.signing.AgentOpen"/> <class name="com.kjj.cases.live.agent.Reward"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="扫码签收核奖_客户得红包">
<classes>
<class name="com.kjj.cases.live.signing.UserOpen"/>
</classes>
</test>
<test preserve-order="true" name="指定中奖付款码"> <test preserve-order="true" name="指定中奖付款码">
<classes> <classes>
......
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