Commit 0d84e7dd authored by 赵然's avatar 赵然

Merge branch 'develop'

parents d45e51fa e932ba16
......@@ -202,6 +202,10 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(response2.jsonPath().getString("data.show"),"false","展示弹窗校验失败");
}
@Test(dependsOnMethods = { "出奖弹层校验" })
public void 战绩页校验() throws Exception {
}
public void modifyOpenPrizeTime(String betId,int x) throws Exception{
DateTime time1 = new DateTime();
......
......@@ -16,10 +16,14 @@ import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import utils.ExcelDataProvider;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import static io.restassured.RestAssured.given;
......@@ -38,6 +42,17 @@ public class 配置测试_AccessTest extends DuibaTestBase {
private static Integer uid = 5028;//
@DataProvider
public Object[][] providerMethod(Method method){
Object[][] result = null;
if(method.getName().equals("重复投注测试")) {
result = new Object[][]{
new Object[]{"3758"},
new Object[]{"3757"},
};
}
return result;
}
@Test
public void 配置测试() throws Exception{
......@@ -110,6 +125,44 @@ public class 配置测试_AccessTest extends DuibaTestBase {
Assert.assertEquals(optionImg4,"//yun.dui88.com/images/201812/ifh1kvaq9m.jpg","校验选项2 图片失败");
Assert.assertEquals(optionName4,"分红包选项二","校验选项2 title失败");
//已投注配置
String betType3 = response.jsonPath().getString("data.betedList[0].betConfig.betType");
String bonusType3 = response.jsonPath().getString("data.betedList[0].betConfig.bonusType");
String configStatus3 = response.jsonPath().getString("data.betedList[0].betConfig.configStatus");
String creditsValue3 = response.jsonPath().getString("data.betedList[0].betConfig.creditsValue");
String id3 = response.jsonPath().getString("data.betedList[0].betConfig.id");
String shareExp3 = response.jsonPath().getString("data.betedList[0].betConfig.shareExp");
String title3 = response.jsonPath().getString("data.betedList[0].betConfig.title");
String unitName3 = response.jsonPath().getString("data.betedList[0].betConfig.unitName");
//选项获取
String optionId5 = response.jsonPath().getString("data.betedList[0].options[0].optionId");
String optionImg5 = response.jsonPath().getString("data.betedList[0].options[0].optionImg");
String optionName5 = response.jsonPath().getString("data.betedList[0].options[0].optionName");
String chooseThisOption5 = response.jsonPath().getString("data.betedList[0].options[0].chooseThisOption");
String optionId6 = response.jsonPath().getString("data.betedList[0].options[1].optionId");
String optionImg6 = response.jsonPath().getString("data.betedList[0].options[1].optionImg");
String optionName6 = response.jsonPath().getString("data.betedList[0].options[1].optionName");
String chooseThisOption6 = response.jsonPath().getString("data.betedList[0].options[1].chooseThisOption");
Assert.assertEquals(betType3,"1","校验押注类型失败"); //'押注类型 1-单选单次,2-多选无限制'
Assert.assertEquals(bonusType3,"4","校验瓜分类型失败");//'瓜分类型1瓜分经验2瓜分红包3发奖品4瓜分积分'
Assert.assertEquals(configStatus3,"3","校验投注活动的状态失败");//'投注活动的状态:1关闭不可见2关闭可见3开启4结束'
Assert.assertEquals(creditsValue3,"0","校验积分价值失败");//积分价值
Assert.assertEquals(id3,"1799","校验pk id失败");
Assert.assertTrue(new BigDecimal(shareExp3).compareTo(new BigDecimal("50"))==0,"校验瓜分的经验池失败");//瓜分的经验池
Assert.assertEquals(title3,"待投注","校验投注活动标题失败");//投注活动标题
Assert.assertEquals(unitName3,"元宝","校验消耗类型失败");
Assert.assertEquals(optionId5,"3757","校验选项1 id失败");
Assert.assertEquals(optionImg5,"//yun.dui88.com/images/201812/2sv582lhyo.png","校验选项1 图片失败");
Assert.assertEquals(optionName5,"1","校验选项1 title失败");
Assert.assertEquals(chooseThisOption5,"false","校验选项1选择情况失败");
Assert.assertEquals(optionId6,"3758","校验选项2 id失败");
Assert.assertEquals(optionImg6,"//yun.dui88.com/images/201812/hyhd36w6be.png","校验选项2 图片失败");
Assert.assertEquals(optionName6,"2","校验选项2 title失败");
Assert.assertEquals(chooseThisOption6,"true","校验选项2选择情况失败");
logger.info("pk组件分红包、分积分配置校验正确!");
}
......@@ -130,6 +183,23 @@ public class 配置测试_AccessTest extends DuibaTestBase {
logger.info("投注积分不足校验成功!");
}
@Test(dataProvider = "providerMethod")
public void 重复投注测试(String optionId){
String url = activityHost + "/betActivity2/doJoin";
Map<String,Object> map = new HashMap<>();
map.put("betId","1799");
map.put("optionId",optionId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(url);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("success"),"false","校验success失败");
Assert.assertEquals(response.jsonPath().getString("code"),"100011","校验错误码失败");
Assert.assertEquals(response.jsonPath().getString("desc"),"活动已参加","校验desc失败");
logger.info("重复投注校验成功!");
}
@Test
public void 未登录投注(){
//获取未登录场景cookie
......@@ -151,4 +221,6 @@ public class 配置测试_AccessTest extends DuibaTestBase {
logger.info("未登录投注校验成功!");
}
}
\ No newline at end of file
......@@ -59,6 +59,25 @@ public class PkService {
}
public Response list(Integer uid) throws Exception{
String url = activityHost + "/betRecord2/list";
Map<String,Object> map = new HashMap<>();
map.put("pageNo","1");
map.put("pageSize","6");
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url);
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("战绩页接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("战绩页接口失败,返回信息:"+response.asString());
}
return response;
}
public Response getBetList(Integer uid) throws Exception{
String url = activityHost + "/betActivity2/list";
......
......@@ -25,6 +25,9 @@ public class SeckillService {
@Value("${home.host}")
private String homeHost;
@Value("${activity.host}")
String activityHost;
@Autowired
Authorization authorization;
......@@ -183,6 +186,15 @@ public class SeckillService {
}
public Response getDefaultAddress(Integer uid) {
String url = activityHost + "/gaw/address/getDefaultAddress";
Map<String,Object> map = new HashMap<>();
// map.put("id",id);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url);
return response;
}
public Boolean checkNomal(String api,Response response) {
......
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