Commit 46e1beec authored by 龚小红's avatar 龚小红

删除oss对话模版,并添加签到领红包的测试用例

parent 747fd5d1
//package com.kjj.cases.assistant.homePage;
//
//import com.kjj.cases.admin.Authorization;
//import io.restassured.response.Response;
//import org.testng.Assert;
//import org.testng.annotations.BeforeClass;
//import org.testng.annotations.Test;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import static com.kjj.config.BasicConfig.*;
//
//public class SignRed implements Authorization {
// private int attendAmount;
// private int totalPromotionEarnings;
// @BeforeClass
// public void setUp() {
// agentTku();
// }
//
// @Test(description = "指定用户展示入口", priority = 1)
// public void 指定用户展示入口() {
// Response response = network.getResponse(ATTEND_entrance);
// System.out.println(response.body().asString());
// Boolean showFlag = response.jsonPath().getBoolean("data.showFlag");
// Boolean vipExpireFlag = response.jsonPath().getBoolean("data.vipExpireFlag");
// Assert.assertTrue(showFlag, network.message(ATTEND_entrance, "指定用户不展示入口", response.body().asString()));
// Assert.assertFalse(vipExpireFlag, network.message(ATTEND_entrance, "指定用户会员已到期", response.body().asString()));
// }
//
// @Test(description = "非指定用户展示入口", priority = 2)
// public void 非指定用户展示入口() {
// visitor2Tku();
// Response response = network.getResponse(ATTEND_entrance);
// System.out.println(response.body().asString());
// Boolean showFlag = response.jsonPath().getBoolean("data.showFlag");
// Boolean vipExpireFlag = response.jsonPath().getBoolean("data.vipExpireFlag");
// Assert.assertFalse(showFlag, network.message(ATTEND_entrance, "非指定用户展示入口", response.body().asString()));
// Assert.assertFalse(vipExpireFlag, network.message(ATTEND_entrance, "指定用户会员已到期", response.body().asString()));
// }
//
// @Test(description = "签到详情", priority = 3)
// public void 签到详情() {
// agentTku();
// Response response = network.getResponse(ATTEND_detail);
// System.out.println(response.body().asString());
// int roundNum = response.jsonPath().getInt("data.roundNum");
// Boolean todayAttendFlag = response.jsonPath().getBoolean("data.todayAttendFlag");
// Assert.assertEquals(roundNum, 7, network.message(ATTEND_detail, "签到周期错误", response.body().asString()));
// Assert.assertFalse(todayAttendFlag, network.message(ATTEND_detail, "用户今日已签到", response.body().asString()));
// }
//
// @Test(description = "获取累计收益", priority = 4)
// public void 获取累计收益() {
// Response response = network.getResponse(ATTEND_income);
// System.out.println(response.body().asString());
// totalPromotionEarnings = response.jsonPath().getInt("data.totalPromotionEarnings");
// int balance = response.jsonPath().getInt("data.balance");
// Assert.assertTrue(totalPromotionEarnings > 0, network.message(ATTEND_income, "签到周期错误", response.body().asString()));
// Assert.assertTrue(balance > 0, network.message(ATTEND_income, "签到周期错误", response.body().asString()));
//
// }
//
// @Test(description = "签到", priority = 5)
// public void 签到() {
// Response response = network.getResponse(ATTEND_open);
// System.out.println(response.body().asString());
// attendAmount = response.jsonPath().getInt("data.attendAmount");
// String attendDate = response.jsonPath().getString("data.attendDate");
// Assert.assertTrue(attendAmount > 0, network.message(ATTEND_open, "签到失败", response.body().asString()));
//
// }
//
// @Test(description = "签到金额验证", priority = 6)
// public void 签到金额验证() {
// Response response = network.getResponse(ATTEND_income);
// System.out.println(response.body().asString());
// int total = response.jsonPath().getInt("data.totalPromotionEarnings");
// Assert.assertEquals(total , attendAmount + totalPromotionEarnings,network.message(ATTEND_income, "签到周期错误", response.body().asString()));
// }
//
// @Test(description = "代理人账户明细",priority = 7)
// public void 代理人账户明细() {
// agentTku();
// Map<String, Object> Params = new HashMap<String, Object>();
// Params.put("type", 2);
// Params.put("pageNo", 1);
// Params.put("pageSize", 20);
// Response response = network.getResponse(Params, PAY_accDetail);
// System.out.println(response.body().asString());
// int changeType1 = response.jsonPath().getInt("data[0].changeType");
// String nickname = response.jsonPath().getString("data[0].nickname");
// String bizType = response.jsonPath().getString("data[0].bizType");
// int changeMoney = response.jsonPath().getInt("data[0].changeMoney");
// Assert.assertEquals(changeType1 ,2, network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// Assert.assertEquals(nickname, "吉吉",network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// Assert.assertEquals(bizType, "吉吉",network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// Assert.assertEquals(changeMoney, "吉吉",network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
// }
//}
package com.kjj.cases.assistant.homePage;
import com.kjj.cases.admin.Authorization;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
public class SignRed implements Authorization {
private double attendAmount;
private double totalPromotionEarnings;
private boolean todayAttendFlag;
@BeforeClass
public void setUp() {
agentTku();
}
@Test(description = "指定用户展示入口", priority = 1)
public void 指定用户展示入口() {
Response response = network.getResponse(ATTEND_entrance);
System.out.println(response.body().asString());
Boolean showFlag = response.jsonPath().getBoolean("data.showFlag");
Boolean vipExpireFlag = response.jsonPath().getBoolean("data.vipExpireFlag");
Assert.assertTrue(showFlag, network.message(ATTEND_entrance, "指定用户不展示入口", response.body().asString()));
Assert.assertFalse(vipExpireFlag, network.message(ATTEND_entrance, "指定用户会员已到期", response.body().asString()));
}
@Test(description = "非指定用户展示入口", priority = 2)
public void 非指定用户展示入口() {
userTku2();
Response response = network.getResponse(ATTEND_entrance);
System.out.println(response.body().asString());
Boolean showFlag = response.jsonPath().getBoolean("data.showFlag");
Boolean vipExpireFlag = response.jsonPath().getBoolean("data.vipExpireFlag");
Assert.assertFalse(showFlag, network.message(ATTEND_entrance, "非指定用户展示入口", response.body().asString()));
Assert.assertFalse(vipExpireFlag, network.message(ATTEND_entrance, "指定用户会员已到期", response.body().asString()));
}
@Test(description = "签到详情", priority = 3)
public void 签到详情() {
agentTku();
Response response = network.getResponse(ATTEND_detail);
System.out.println(response.body().asString());
int roundNum = response.jsonPath().getInt("data.roundNum");
todayAttendFlag = response.jsonPath().getBoolean("data.todayAttendFlag");
Assert.assertEquals(roundNum, 7, network.message(ATTEND_detail, "签到周期错误", response.body().asString()));
}
@Test(description = "获取累计收益", priority = 4)
public void 获取累计收益() {
Response response = network.getResponse(ATTEND_income);
System.out.println(response.body().asString());
totalPromotionEarnings = response.jsonPath().getDouble("data.totalPromotionEarnings");
double balance = response.jsonPath().getDouble("data.balance");
Assert.assertTrue(totalPromotionEarnings > 0, network.message(ATTEND_income, "签到周期错误", response.body().asString()));
Assert.assertTrue(balance > 0, network.message(ATTEND_income, "签到周期错误", response.body().asString()));
}
@Test(description = "签到", priority = 5)
public void 签到() {
Response response = network.postResponse(ATTEND_open);
System.out.println(response.body().asString());
if (!todayAttendFlag) {
attendAmount = response.jsonPath().getDouble("data.attendAmount");
Assert.assertTrue(attendAmount > 0, network.message(ATTEND_open, "签到失败", response.body().asString()));
}else{
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(ATTEND_open, "重复签到成功", response.body().asString()));
}
}
@Test(description = "签到金额验证", priority = 6)
public void 签到金额验证() {
Response response = network.getResponse(ATTEND_income);
System.out.println(response.body().asString());
double total = response.jsonPath().getDouble("data.totalPromotionEarnings");
Assert.assertEquals(total , attendAmount + totalPromotionEarnings,network.message(ATTEND_income, "签到周期错误", response.body().asString()));
}
@Test(description = "代理人账户明细",priority = 7)
public void 代理人账户明细() {
agentTku();
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("type", 2);
Params.put("pageNo", 1);
Params.put("pageSize", 20);
Response response = network.getResponse(Params, PAY_accDetail);
System.out.println(response.body().asString());
int changeType1 = response.jsonPath().getInt("data[0].changeType");
String nickname = response.jsonPath().getString("data[0].nickname");
int bizType = response.jsonPath().getInt("data[0].bizType");
String changeMoney = response.jsonPath().getString("data[0].changeMoney");
Assert.assertEquals(changeType1 ,2, network.message(PAY_accDetail, "收益明细类型错误", response.body().asString()));
Assert.assertEquals(nickname, "吉吉",network.message(PAY_accDetail, "签到用户名称错误", response.body().asString()));
Assert.assertEquals(bizType, 16,network.message(PAY_accDetail, "收益明细类型错误", response.body().asString()));
Assert.assertEquals(changeMoney, String.format("%.2f",attendAmount/100),network.message(PAY_accDetail, "收益金额错误", response.body().asString()));
}
}
......@@ -94,19 +94,9 @@ public class Potential implements Authorization {
System.out.println(response.body().asString());
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_agreeStatus, "客跟进机会同意状态为false", response.body().asString()));
}
@Test(description = "获取对话模版oss地址", priority =7)
public void 获取对话模版oss地址() {
Response response = network.getResponse(BasicConfig.ANCHOR_ossDialogue);
System.out.println(response.body().asString());
boolean data=response.jsonPath().getBoolean("data");
Assert.assertNotNull(data, network.message(BasicConfig.ANCHOR_ossDialogue, "未获取到对话模版oss地址", response.body().asString()));
}
@Test(description = "二度用户获取话术模板", priority =8)
@Test(description = "二度用户获取话术模板", priority =7)
public void 二度用户获取话术模板() {
visitorAuth5();
Map<String, Object> Params = new HashMap<>();
......
......@@ -2327,7 +2327,7 @@ public class SaveLive implements Authorization {
/**
* 亲友抽奖券配置
*/
@Test(description = "保存亲友抽奖券配置", priority = 128)
@Test(description = "保存亲友抽奖券配置", priority = 124)
public void 保存亲友抽奖券配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
......@@ -2345,7 +2345,7 @@ public class SaveLive implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_relativeLottery, "保存亲友券配置失败", response.body().asString()));
}
@Test(description = "查看亲友抽奖券配置详情", priority = 129)
@Test(description = "查看亲友抽奖券配置详情", priority = 125)
public void 查看亲友抽奖券配置详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2360,7 +2360,7 @@ public class SaveLive implements Authorization {
Assert.assertEquals(lotteryNum,3, network.message(Params, BasicConfig.MANAGER_detailLottery, "亲友抽奖券数量错误", response.body().asString()));
}
@Test(description = "开启亲友抽奖券配置", priority = 130)
@Test(description = "开启亲友抽奖券配置", priority = 126)
public void 开启亲友抽奖券配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2371,7 +2371,7 @@ public class SaveLive implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_switchStatusLottery, "开启亲友券配置失败", response.body().asString()));
}
@Test(description = "查询亲友抽奖券配置状态", priority = 131)
@Test(description = "查询亲友抽奖券配置状态", priority = 127)
public void 查询亲友抽奖券配置状态() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2388,7 +2388,7 @@ public class SaveLive implements Authorization {
/**
* 准客户承诺话术配置
*/
@Test(description = "保存客户承诺话术配置", priority = 132)
@Test(description = "保存客户承诺话术配置", priority = 128)
public void 保存客户承诺话术配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
......@@ -2404,7 +2404,7 @@ public class SaveLive implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveDialogue, "保存客户承诺话术配置失败", response.body().asString()));
}
@Test(description = "查看客户承诺话术配置", priority = 133)
@Test(description = "查看客户承诺话术配置", priority = 129)
public void 查看客户承诺话术配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......
......@@ -108,7 +108,6 @@ public class BasicConfig {
public static final String ANCHOR_agree = MOBILE_HOST + "/kjy/live/agent/potential/agree";
public static final String ANCHOR_questionSubmitted = MOBILE_HOST + "/kjy/live/agent/potential/questionSubmitted";
public static final String ANCHOR_agreeStatus = MOBILE_HOST + "/kjy/live/agent/potential/agreeStatus";
public static final String ANCHOR_ossDialogue = MOBILE_HOST + "/kjy/live/agent/potential/ossDialogue";
// *************** 预告页配置 ***************
public static final String MANAGER_preViewWelfareList = MANAGER_HOST + "/kjy/manager/preView/conf/welfareList";
......
......@@ -11,6 +11,11 @@
<class name="com.kjj.cases.assistant.pay.Pay"/>
</classes>
</test>
<test preserve-order="true" name="签到领红包">
<classes>
<class name="com.kjj.cases.assistant.homePage.SignRed"/>
</classes>
</test>
<test preserve-order="true" name="邀请返现">
<classes>
<class name="com.kjj.cases.assistant.pay.Cashback"/>
......
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