Commit 19f9eefa authored by 龚小红's avatar 龚小红

增加收货地址的提交

parent 6ff883e9
...@@ -795,6 +795,7 @@ public class HomePage implements Authorization { ...@@ -795,6 +795,7 @@ public class HomePage implements Authorization {
//获取用户信息 //获取用户信息
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
Response response = network.getResponse(USER_INFO); Response response = network.getResponse(USER_INFO);
System.out.println(response.body().asString());
userId = response.jsonPath().getInt("data.userId"); userId = response.jsonPath().getInt("data.userId");
Assert.assertNotNull(response.jsonPath().getJsonObject("data"),network.message(USER_INFO,"获取用户信息失败",response.body().asString())); Assert.assertNotNull(response.jsonPath().getJsonObject("data"),network.message(USER_INFO,"获取用户信息失败",response.body().asString()));
......
...@@ -103,13 +103,8 @@ public class Pay implements Authorization { ...@@ -103,13 +103,8 @@ public class Pay implements Authorization {
System.out.println(response.body().asString()); System.out.println(response.body().asString());
int data = response.jsonPath().getInt("data"); int data = response.jsonPath().getInt("data");
Assert.assertTrue(data==5,network.message(statusParams, PAY_status,"取消支付:订单状态不对",response.body().asString())); Assert.assertTrue(data==5,network.message(statusParams, PAY_status,"取消支付:订单状态不对",response.body().asString()));
} }
@Test (description = "默认付费_切换会员类型为保险版",priority = 4) @Test (description = "默认付费_切换会员类型为保险版",priority = 4)
public void 默认付费_切换为保险版会员类型(){ public void 默认付费_切换为保险版会员类型(){
//会员类型版本判断 //会员类型版本判断
...@@ -139,7 +134,7 @@ public class Pay implements Authorization { ...@@ -139,7 +134,7 @@ public class Pay implements Authorization {
Response response = network.getResponse(PAY_isRenewCondition); Response response = network.getResponse(PAY_isRenewCondition);
System.out.println(response.body().asString()); System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data"); 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 { ...@@ -176,8 +171,6 @@ public class Pay implements Authorization {
codeListParam.put("pageSize",20); codeListParam.put("pageSize",20);
response =network.getResponse(codeListParam,MANAGER_codeList); response =network.getResponse(codeListParam,MANAGER_codeList);
promotionCode=response.jsonPath().getString("data.list[0].promotionCode"); promotionCode=response.jsonPath().getString("data.list[0].promotionCode");
} }
......
...@@ -16,6 +16,7 @@ import org.testng.Assert; ...@@ -16,6 +16,7 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -1023,50 +1024,55 @@ public class GoldenEgg implements Authorization { ...@@ -1023,50 +1024,55 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(receiveNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString())); Assert.assertEquals(receiveNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
} }
// @Test(description = "查询用户是否未提交收货地址", priority = 59) @Test(description = "查询用户是否未提交收货地址", priority = 59)
// public void 查询用户是否未提交收货地址() { public void 查询用户是否未提交收货地址() {
// visitorAuth(); visitorAuth();
// ThreadSleepUtils.sleep(1000); ThreadSleepUtils.sleep(1000);
// Map<String, Object> locationResultParam = new HashMap<>(); Map<String, Object> locationResultParam = new HashMap<>();
// locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); locationResultParam.put("liveId", "Kj21NTE3Mjc");
// locationResultParam.put("scene", 1); locationResultParam.put("scene", 1);
// Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult); Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult);
// System.out.println(locationResultRes.body().asString()); System.out.println(locationResultRes.body().asString());
// Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion"); Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
// Assert.assertNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString())); Assert.assertNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
// } }
//
// @Test(description = "提交收货地址", priority = 60) @Test(description = "提交收货地址", priority = 60)
// public void 提交收货地址() { public void 提交收货地址() {
// visitorAuth(); visitorAuth();
// Map<String, Object> submitInfoParam = new HashMap<>(); ArrayList<String> region = new ArrayList<>();
// submitInfoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); region.add("浙江省");
// submitInfoParam.put("confId", interactConfId); region.add("杭州市");
// submitInfoParam.put("winnerName", "中奖人"); region.add("西湖区");
// submitInfoParam.put("winnerName", "浙江省杭州市"); Map<String, Object> submitInfoParam = new HashMap<>();
// submitInfoParam.put("location", "西湖区数娱大厦"); submitInfoParam.put("liveId", "Kj21NTE3Mjc");
// submitInfoParam.put("phoneNum", "13498765432"); submitInfoParam.put("confId", "Kj20NjIwNTY3");
// Response submitInfoRes = network.postResponse(submitInfoParam, BasicConfig.USER_submitInfo); submitInfoParam.put("winnerName", "中奖人");
// System.out.println(submitInfoRes.body().asString()); submitInfoParam.put("region", region);
// Boolean result = submitInfoRes.jsonPath().getBoolean("success"); submitInfoParam.put("location", "西湖区数娱大厦");
// Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交姓名失败", submitInfoRes.body().asString())); submitInfoParam.put("phoneNum", "13498765432");
// ThreadSleepUtils.sleep(3000); Response submitInfoRes = network.postResponse(submitInfoParam, BasicConfig.USER_submitInfo);
// } System.out.println(submitInfoRes.body().asString());
// Boolean result = submitInfoRes.jsonPath().getBoolean("success");
// @Test(description = "查询用户是否提交收货地址", priority = 61) Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交收货地址失败", submitInfoRes.body().asString()));
// public void 查询用户是否提交收货地址() { ThreadSleepUtils.sleep(3000);
// visitorAuth(); }
// ThreadSleepUtils.sleep(1000);
// Map<String, Object> locationResultParam = new HashMap<>(); @Test(description = "查询用户是否提交收货地址", priority = 61)
// locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); public void 查询用户是否提交收货地址() {
// locationResultParam.put("scene", 1); visitorAuth();
// Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult); ThreadSleepUtils.sleep(1000);
// System.out.println(locationResultRes.body().asString()); Map<String, Object> locationResultParam = new HashMap<>();
// Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion"); locationResultParam.put("liveId", "Kj21NTE3Mjc");
// Assert.assertNotNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString())); locationResultParam.put("scene", 1);
// } Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult);
System.out.println(locationResultRes.body().asString());
Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
Assert.assertNotNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
}
@Test(description = "获取直播配置详情", priority = 62) @Test(description = "获取直播配置详情", priority = 62)
public void 获取直播配置详情() { public void 获取直播配置详情() {
adminAuth();
Map<String, Object> ConfDetailParam = new HashMap<>(); Map<String, Object> ConfDetailParam = new HashMap<>();
ConfDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); ConfDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response ConfDetailRes = network.getResponse(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail); Response ConfDetailRes = network.getResponse(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail);
......
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