Commit f807e02c authored by 吕雯燕's avatar 吕雯燕

Merge branch 'master' of gitlab2.dui88.com:mabo/test-platform

parents eaa7a856 1c06e4e0
......@@ -33,7 +33,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public void 出奖自有实物() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900849714500524");
int remaining = (int)map.get("stock");
long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("21803","h5ps61");
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId);
......@@ -61,7 +61,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread.sleep(1000);
map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900849714500524");
int remainingNew = (int)map.get("stock");
long remainingNew = (long)map.get("stock");
Assert.assertEquals(remaining-1,remainingNew,"扣库存失败");
......@@ -170,7 +170,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public void 出奖自有虚拟商品() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900860200070105");
int remaining = (int)map.get("stock");
long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("21793","h5ps61");
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId);
......@@ -198,7 +198,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread.sleep(1000);
map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900860200070105");
int remainingNew = (int)map.get("stock");
long remainingNew = (long)map.get("stock");
Assert.assertEquals(remaining-1,remainingNew,"扣库存失败");
}
......@@ -206,7 +206,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test
public void 出奖兑吧实物() throws Exception {
Map map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900440770170322 ");
int remaining = (int)map.get("stock");
long remaining = (long)map.get("stock");
Response response = newActivityService.doJoin2("22637","h5ps61");
String orderId = response.jsonPath().getString("orderId");
response = newActivityService.getOrderStatus2(orderId);
......@@ -233,7 +233,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread.sleep(1000);
map = jdbc.findSimpleResult("select * from stock.tb_stock where stock_id = 674900440770170322 ");
int remainingNew = (int)map.get("stock");
long remainingNew = (long)map.get("stock");
Assert.assertEquals(remaining-1,remainingNew,"扣库存失败");
......
......@@ -224,6 +224,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
map.put("itemId","30319");
map.put("token","yrJRr7Cddp2YeQd");
Thread.sleep(4000);
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post(url + "/couponExchange/exchange");
response.prettyPrint();
......
......@@ -395,4 +395,160 @@ public class test extends DuibaBases {
@Test
public void 日历签到(){
// Map<String,String> map = new HashMap<>();
// map.put("id","90");
//// map.put("signDate",getTime(0));
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(6));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/signactivity/doSign");
// response.prettyPrint();
Map<String,String> map = new HashMap<>();
map.put("id","90");
map.put("signDate",getTime(0));
String url = "http://activity.m.duibatest.com.cn";
Map<String,String> header = new HashMap<>();
header.put("User-Agent","windows mabo");
Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(6));
Response response = given().headers(header).cookies(cookie).params(map).get(url+"/signactivity/reSign");
response.prettyPrint();
}
@Test
public void 契约签到(){
// Map<String,String> map = new HashMap<>();
// map.put("activityId","149");
// map.put("betAmount","100");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(2));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/doJoin");
// response.prettyPrint();
// Map<String,String> map = new HashMap<>();
// map.put("activityId","149");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(2));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/doSign");
// response.prettyPrint();
Map<String,String> map = new HashMap<>();
map.put("contractId","3123");
String url = "http://activity.m.duibatest.com.cn";
Map<String,String> header = new HashMap<>();
header.put("User-Agent","windows mabo");
Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(5));
Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/getReward");
response.prettyPrint();
}
@Test
public void 宠物养成(){
Map<String,String> map = new HashMap<>();
map.put("activityId","18");
map.put("petName","66");
String url = "http://activity.m.duibatest.com.cn";
Map<String,String> header = new HashMap<>();
header.put("User-Agent","windows mabo");
Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(3580));
Response response = given().headers(header).cookies(cookie).params(map).post(url+"/signpet/adopte");
response.prettyPrint();
}
// 获取时间方法
public String getTime(int amount){
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d yyyy", Locale.ENGLISH);
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, amount);
date = calendar.getTime();
// System.out.println(dateFormat.format(date));
String time = dateFormat.format(date)+" 08:00:00 GMT+0800 (CST)";
// System.out.println(time);
return time;
}
}
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