Commit 8ad86640 authored by 马博's avatar 马博

update

parent da46efca
......@@ -77,7 +77,7 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
if (method.getName().equals("日期兑换限制测试")) {
result = new Object[][]{
new Object[]{1, "194628",87,"实物日期兑换限制未开始测试"}, //case1
new Object[]{2, "194629",88,"实物日期兑换限制进行中测试"}, //case2
new Object[]{2, "199855",291,"实物日期兑换限制进行中测试"}, //case2 199855 194629
new Object[]{3, "194630",89,"实物日期兑换限制已结束"}, //case3
};
}
......
package http.cases.SeckillTest.新秒杀;
import base.DuibaTestBase;
import http.service.Authorization;
import http.service.app.MobileService;
import http.service.app.SeckillNewService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Created by mabo on 2019/12/12
*/
public class 新秒杀_秒杀未开始_SeckillTest extends DuibaTestBase {
@Autowired
SeckillNewService seckillNewService;
@Autowired
MobileService mobileService;
@Autowired
Authorization authorization;
//指定用户
private static int uid = 7449;
@Test
public void 秒杀未开始() throws Exception{
String appItemId="199278";
String itemId=null;
String skuId = "220";
String message = "";
String actId = "43";
String pageId = "63";
//秒杀
Response response = seckillNewService.exchanges(itemId,appItemId,uid,skuId,actId);
response.prettyPrint();
Assert.assertTrue(response.jsonPath().getString("msg").equals("活动已结束"),"校验失败");
}
}
package http.cases.SeckillTest;
import base.DuibaTestBase;
import http.service.Authorization;
import http.service.app.SeckillService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Created by mabo on 2019/12/12
*/
public class 老秒杀_未开始_SeckillTest extends DuibaTestBase {
@Autowired
SeckillService seckillService;
@Autowired
Authorization authorization;
public static int uid = 7448;
@Test
public void 老秒杀实物未开始() throws InterruptedException {
Response response = seckillService.exchange2("199408","undefined",uid);
response.prettyPrint();
String queueId = response.jsonPath().getString("data.queueId");
Thread.sleep(5000);
Response queryResponse = seckillService.queueQuery(queueId,uid);
queryResponse.prettyPrint();
Boolean result = queryResponse.asString().contains("好可惜,没抢到");
Assert.assertTrue(result,"秒杀结果校验失败");
}
}
......@@ -36,6 +36,37 @@ public class SeckillNewService {
//实物秒杀下单接口
public Response exchange (String itemId,String appItemId, Integer uid,String skuId,String actId) throws Exception {
String url = activityHost + "/seckwc/exchange";
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
List<Map> list = new ArrayList<>();
mapList.put("itemId",itemId);
mapList.put("skuId",skuId);
mapList.put("appItemId",appItemId);
mapList.put("credits","1");
mapList.put("price",0);
list.add(mapList);
map.put("remark","");
map.put("degreeId","");
map.put("actualPrice","0");
map.put("actualCredits","1");
map.put("itemParam",list.toArray());
map.put("payType","3");
map.put("expressPrice","0");
map.put("actId",actId);
map.put("validate","Y6f1ebInCWb.uJg8Sh_F.p7EUq4SG_Spr8ibD.2TTrytcOBpASsIHf6P9zNbkQxRq7vVDPkZw0vaRMpcxkbCx0n1ZKJZQgtFaKfbI0S2X7fws.jz8IjFUIM2l56YTh_g5xCso65S6ivQM0-54iEzTkSC01MIM5ZPoBdKiE9hVyooLa9OIM9oXOi-EtNx.IyxZyOBBqdCiYFieZe_ewBvWHlZ7SfInfFIaS8ulQMqybaSptmqYH9CyIa5nclj5C849IluQPnJH-0qpse7RL729VEtzZrS9KvoXmjCyTc4uq9IMozueqJG9PclV0gB1r8adms7Ef-QVEVSsnVu9xlY2YBAzPvBM9snEb447snvAgAi51CyL1SanGUCVDtmfe7GmronomRkWDvzknJFGm9vHNCWJGuZsJyYYPmlQ8NTrrsMdzwLcUs716uUm7RR1HM4_n9xC_PrGImrMFwnnV1MLlr_UEjITFq1A5_lHigcU7xyK-vE8hdtYDEV57X3");
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response = given().contentType("application/json; charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).body(jsonParam).post(url);
// response.prettyPrint();
return response;
}
//实物秒杀下单接口
public Response exchanges (String itemId,String appItemId, Integer uid,String skuId,String actId) throws Exception {
String url = activityHost + "/seckw/v2/exchange";
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
......
......@@ -26,7 +26,10 @@ db.name = FjrtzzH
db.password= 2Fe36uDap8TMqtfzob3f1u8r2aK8qjdnwPP
//db.url = jdbc:mysql://47.97.127.67:13001/?tinyInt1isBit=false
db.url = jdbc:mysql://autotest-config.duibatest.com.cn:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
#db.url = jdbc:mysql://autotest-config.duibatest.com.cn:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.url = jdbc:mysql://auto.testdb2.duibar.com:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.driver= com.mysql.cj.jdbc.Driver
db.maxtotal = 6
......
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