Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
de293b05
Commit
de293b05
authored
Nov 23, 2018
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
3d7ff2bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
15 deletions
+109
-15
新建活动测试_DuibaTest.java
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
+107
-13
DeveloperService.java
src/test/java/http/service/hd/DeveloperService.java
+2
-2
No files found.
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
View file @
de293b05
package
http
.
cases
.
DeveloperTest
;
package
http
.
cases
.
DeveloperTest
;
import
base.DuibaTestBase
;
import
base.DuibaTestBase
;
import
org.testng.annotations.DataProvider
;
import
utils.PublicMethod
;
import
utils.PublicMethod
;
import
http.service.Activity.ManagerService
;
import
http.service.Activity.ManagerService
;
import
http.service.Activity.NewActivityService
;
import
http.service.Activity.NewActivityService
;
...
@@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
java.lang.reflect.Method
;
/**
/**
* Created by lvwenyan on 2018/11/23.
* Created by lvwenyan on 2018/11/23.
...
@@ -26,31 +29,122 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
...
@@ -26,31 +29,122 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@DataProvider
public
Object
[][]
providerMethod
(
Method
method
){
Object
[][]
result
=
null
;
if
(
method
.
getName
().
equals
(
"新建自有积分商城活动工具"
))
{
result
=
new
Object
[][]{
new
Object
[]{
1
,
"5"
,
"everyday"
,
"3"
,
"everyday"
,
"[{\"index\":1,\"type\":\"thanks\",\"img\":\"//yun.duiba.com.cn/upload/uP99F1462438316972.png\",\"title\":\"谢谢参与\",\"valid\":true,\"show\":true},{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"limit\":\"1\",\"low\":\"2\",\"remaind\":\"100\"},{\"type\":\"object\",\"title\":\"实物\",\"img\":\"//yun.duiba.com.cn/upload/1uF0l1462438316968.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":177222,\"name\":\"【自动化】自有实物\",\"limit\":\"2\",\"low\":\"3\",\"remaind\":\"90\"},{\"type\":\"virtual\",\"title\":\"虚拟商品\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/virtual.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":178060,\"value\":\"test\",\"limit\":\"3\",\"low\":\"4\",\"remaind\":\"80\"},{\"type\":\"alipay\",\"title\":\"支付宝\",\"img\":\"//yun.duiba.com.cn/upload/KkZMp1462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"value\":\"1\",\"limit\":\"4\",\"low\":\"5\",\"remaind\":\"70\"},{\"type\":\"qb\",\"title\":\"Q币\",\"img\":\"//yun.duiba.com.cn/upload/mF3wO1462438317114.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"limit\":\"5\",\"low\":\"6\",\"remaind\":\"60\"},{\"type\":\"lucky\",\"title\":\"福袋\",\"img\":\"//yun.duiba.com.cn/webapp/img/luckynewn.png\",\"valid\":true,\"probability\":\"10\",\"show\":false,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\"},{\"type\":\"again\",\"title\":\"再抽一次\",\"img\":\"//yun.duiba.com.cn/upload/aJwb11462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\"}]"
,
"//yun.duiba.com.cn/upload/newHdTool/turntable_cricle/banner_750x220.png"
,
"新建自有积分商城活动工具--每日次数"
},
//case1
new
Object
[]{
2
,
"10"
,
"forever"
,
"3"
,
"forever"
,
"[{\"index\":1,\"type\":\"thanks\",\"img\":\"//yun.duiba.com.cn/upload/uP99F1462438316972.png\",\"title\":\"谢谢参与\",\"valid\":true,\"show\":true},{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券2\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":169713,\"name\":\"【勿动】兑吧优惠券扣库存\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券3\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"10\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172293,\"name\":\"【勿动】兑吧优惠券下载链接兑换记录页\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券4\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":174797,\"name\":\"【勿动】兑吧优惠券预分配库存测试\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券5\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":174923,\"name\":\"【勿动】兑吧优惠券共享库存测试\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券6\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172292,\"name\":\"【勿动】兑吧优惠券下载链接商家落地页\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券7\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":true,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":175605,\"name\":\"【勿动】兑吧优惠券地区兑换白名单不可兑\",\"remaind\":\"199\"}]"
,
"//yun.dui88.com/images/201811/2yyblucaps.jpg"
,
"新建自有积分商城活动工具--永久次数"
},
//case2
};
}
else
if
(
method
.
getName
().
equals
(
"新建自有独立活动工具"
)){
result
=
new
Object
[][]{
new
Object
[]{
1
,
"10"
,
"everyday"
,
"everyday"
,
"[{\"index\":1,\"type\":\"thanks\",\"img\":\"//yun.duiba.com.cn/upload/uP99F1462438316972.png\",\"title\":\"谢谢参与\",\"valid\":true,\"show\":true},{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"limit\":\"1\",\"low\":\"2\",\"remaind\":\"100\"},{\"type\":\"object\",\"title\":\"实物\",\"img\":\"//yun.duiba.com.cn/upload/1uF0l1462438316968.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":177222,\"name\":\"【自动化】自有实物\",\"limit\":\"2\",\"low\":\"3\",\"remaind\":\"90\"},{\"type\":\"virtual\",\"title\":\"虚拟商品\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/virtual.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":178060,\"value\":\"test\",\"limit\":\"3\",\"low\":\"4\",\"remaind\":\"80\"},{\"type\":\"alipay\",\"title\":\"支付宝\",\"img\":\"//yun.duiba.com.cn/upload/KkZMp1462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"value\":\"1\",\"limit\":\"4\",\"low\":\"5\",\"remaind\":\"70\"},{\"type\":\"qb\",\"title\":\"Q币\",\"img\":\"//yun.duiba.com.cn/upload/mF3wO1462438317114.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"limit\":\"5\",\"low\":\"6\",\"remaind\":\"60\"},{\"type\":\"lucky\",\"title\":\"福袋\",\"img\":\"//yun.duiba.com.cn/webapp/img/luckynewn.png\",\"valid\":true,\"probability\":\"10\",\"show\":false,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\"},{\"type\":\"again\",\"title\":\"再抽一次\",\"img\":\"//yun.duiba.com.cn/upload/aJwb11462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\"}]"
,
"//yun.duiba.com.cn/upload/newHdTool/turntable_cricle/banner_750x220.png"
,
"新建自有独立活动工具--每日次数"
},
//case1
new
Object
[]{
2
,
"50"
,
"forever"
,
"everyday"
,
"[{\"index\":1,\"type\":\"thanks\",\"img\":\"//yun.duiba.com.cn/upload/uP99F1462438316972.png\",\"title\":\"谢谢参与\",\"valid\":true,\"show\":true},{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券2\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":169713,\"name\":\"【勿动】兑吧优惠券扣库存\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券3\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"10\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172293,\"name\":\"【勿动】兑吧优惠券下载链接兑换记录页\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券4\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":174797,\"name\":\"【勿动】兑吧优惠券预分配库存测试\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券5\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":174923,\"name\":\"【勿动】兑吧优惠券共享库存测试\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券6\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":172292,\"name\":\"【勿动】兑吧优惠券下载链接商家落地页\",\"remaind\":\"100\"},{\"type\":\"coupon\",\"title\":\"优惠券7\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":true,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":175605,\"name\":\"【勿动】兑吧优惠券地区兑换白名单不可兑\",\"remaind\":\"199\"}]"
,
"//yun.dui88.com/images/201811/2yyblucaps.jpg"
,
"新建自有独立活动工具--永久次数"
},
//case2
};
}
return
result
;
}
@Test
(
description
=
"开发者创建自有活动工具-积分商城活动完整版"
)
/**
public
void
添加自有活动工具完整版
()
throws
Exception
{
* @param caseNum 用例编号
* @param limitCount 限制次数
* @param limitScope 限制次数类型
* @param freeLimit 免费次数
* @param freeScope 免费次数类型
* @param awards 活动奖品
* @param bannerImgNew 新版banner图
* @param caseName 用例名称
* @throws Exception
*/
@Test
(
dataProvider
=
"providerMethod"
)
public
void
新建自有积分商城活动工具
(
int
caseNum
,
String
limitCount
,
String
limitScope
,
String
freeLimit
,
String
freeScope
,
String
awards
,
String
bannerImgNew
,
String
caseName
)
throws
Exception
{
logger
.
info
(
"-----------------------------"
+
caseName
+
"-----------------------------"
);
String
data
=
PublicMethod
.
data
();
String
data
=
PublicMethod
.
data
();
String
title
=
"【自动化】自有活动工具"
+
data
;
String
title
=
"【自动化】自有活动工具"
+
data
;
String
awards
=
"[{\"index\":1,\"type\":\"thanks\",\"img\":\"//yun.duiba.com.cn/upload/uP99F1462438316972.png\",\"title\":\"谢谢参与\",\"valid\":true,\"show\":true},{\"type\":\"coupon\",\"title\":\"优惠券\",\"img\":\"//yun.duiba.com.cn/upload/bust51462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":159857,\"name\":\"【自动化勿动】自有优惠券\",\"limit\":\"1\",\"low\":\"2\",\"remaind\":\"100\"},{\"type\":\"object\",\"title\":\"实物\",\"img\":\"//yun.duiba.com.cn/upload/1uF0l1462438316968.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":177222,\"name\":\"【自动化】自有实物\",\"limit\":\"2\",\"low\":\"3\",\"remaind\":\"90\"},{\"type\":\"virtual\",\"title\":\"虚拟商品\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/virtual.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"appItemId\":178060,\"value\":\"test\",\"limit\":\"3\",\"low\":\"4\",\"remaind\":\"80\"},{\"type\":\"alipay\",\"title\":\"支付宝\",\"img\":\"//yun.duiba.com.cn/upload/KkZMp1462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"value\":\"1\",\"limit\":\"4\",\"low\":\"5\",\"remaind\":\"70\"},{\"type\":\"qb\",\"title\":\"Q币\",\"img\":\"//yun.duiba.com.cn/upload/mF3wO1462438317114.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\",\"value\":\"10\",\"limit\":\"5\",\"low\":\"6\",\"remaind\":\"60\"},{\"type\":\"lucky\",\"title\":\"福袋\",\"img\":\"//yun.duiba.com.cn/webapp/img/luckynewn.png\",\"valid\":true,\"probability\":\"10\",\"show\":false,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\"},{\"type\":\"again\",\"title\":\"再抽一次\",\"img\":\"//yun.duiba.com.cn/upload/aJwb11462438317113.png\",\"valid\":true,\"probability\":\"10\",\"show\":true,\"arealimit\":false,\"pronumber\":\"\",\"alipay\":\"\",\"description\":\"\"}]"
;
//新建自有活动工具
String
bannerImgNew
=
"//yun.duiba.com.cn/upload/newHdTool/turntable_cricle/banner_750x220.png"
;
developerService
.
saveHdAll
(
""
,
"1"
,
title
,
limitCount
,
limitScope
,
freeLimit
,
freeScope
,
awards
,
bannerImgNew
);
//获取活动id
Response
listResponse
=
developerService
.
list2
(
title
);
String
id
=
String
.
valueOf
(
listResponse
.
jsonPath
().
getString
(
"data.list[0].id"
));
//编辑活动,校验活动内容
Response
editResponse
=
developerService
.
editData
(
id
,
"turntable_circle"
,
"2239"
);
switch
(
caseNum
){
case
1
:
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.credits"
),
"10"
,
"校验活动积分失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeLimit"
),
"3"
,
"校验活动免费抽奖次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeScope"
),
"everyday"
,
"校验活动免费抽奖次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitCount"
),
"5"
,
"校验活动限制次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitScope"
),
"everyday"
,
"校验活动限制次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].name"
),
"【自动化勿动】自有优惠券"
,
"校验活动奖品名称失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].limit"
),
"1"
,
"校验活动奖品中奖限制失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].oldRemaind"
),
"100"
,
"校验活动奖品数量失败"
);
logger
.
info
(
"校验新建自有活动工具-1内容成功"
);
break
;
case
2
:
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitCount"
),
"10"
,
"校验活动限制次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitScope"
),
"forever"
,
"校验活动限制次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeLimit"
),
"3"
,
"校验活动免费抽奖次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeScope"
),
"forever"
,
"校验活动免费抽奖次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[2].name"
),
"【勿动】兑吧优惠券扣库存"
,
"校验活动奖品名称失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.bannerImgNew"
),
"//yun.dui88.com/images/201811/2yyblucaps.jpg"
,
"校验活动新版banner图失败"
);
logger
.
info
(
"校验新建自有活动工具-2内容成功"
);
break
;
}
//删除测试数据
this
.
删除自有活动
(
title
);
}
@Test
(
dataProvider
=
"providerMethod"
)
public
void
新建自有独立活动工具
(
int
caseNum
,
String
limitCount
,
String
limitScope
,
String
freeScope
,
String
awards
,
String
bannerImgNew
,
String
caseName
)
throws
Exception
{
logger
.
info
(
"-----------------------------"
+
caseName
+
"-----------------------------"
);
String
data
=
PublicMethod
.
data
();
String
title
=
"【自动化】自有独立活动工具"
+
data
;
//新建自有活动工具
//新建自有活动工具
developerService
.
saveHdAll
(
""
,
title
,
"5"
,
"everyday"
,
"3"
,
"everyday"
,
awards
,
bannerImgNew
);
developerService
.
saveHdAll
(
""
,
"0"
,
title
,
limitCount
,
limitScope
,
""
,
freeScope
,
awards
,
bannerImgNew
);
//获取活动id
//获取活动id
Response
listResponse
=
developerService
.
list2
(
title
);
Response
listResponse
=
developerService
.
list2
(
title
);
String
id
=
String
.
valueOf
(
listResponse
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
id
=
String
.
valueOf
(
listResponse
.
jsonPath
().
getString
(
"data.list[0].id"
));
//编辑活动,校验活动内容
//编辑活动,校验活动内容
Response
editResponse
=
developerService
.
editData
(
id
,
"turntable_circle"
,
"2239"
);
Response
editResponse
=
developerService
.
editData
(
id
,
"turntable_circle"
,
"2239"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.credits"
),
"10"
,
"校验活动积分失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeLimit"
),
"3"
,
"校验活动免费抽奖次数失败"
);
switch
(
caseNum
){
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeScope"
),
"everyday"
,
"校验活动免费抽奖次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].name"
),
"【自动化勿动】自有优惠券"
,
"校验活动奖品名称失败"
);
case
1
:
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].limit"
),
"1"
,
"校验活动奖品中奖限制失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.credits"
),
"0"
,
"校验活动积分失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].oldRemaind"
),
"100"
,
"校验活动奖品数量失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitCount"
),
"10"
,
"校验活动免费抽奖次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitScope"
),
"everyday"
,
"校验活动免费抽奖次数类型失败"
);
logger
.
info
(
"校验新建自有活动工具内容成功"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].name"
),
"【自动化勿动】自有优惠券"
,
"校验活动奖品名称失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].limit"
),
"1"
,
"校验活动奖品中奖限制失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[1].oldRemaind"
),
"100"
,
"校验活动奖品数量失败"
);
logger
.
info
(
"校验新建自有独立活动工具-1内容成功"
);
break
;
case
2
:
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitCount"
),
"50"
,
"校验活动免费抽奖次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitScope"
),
"forever"
,
"校验活动免费抽奖次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.awards[2].name"
),
"【勿动】兑吧优惠券扣库存"
,
"校验活动奖品名称失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.bannerImgNew"
),
"//yun.dui88.com/images/201811/2yyblucaps.jpg"
,
"校验活动新版banner图失败"
);
logger
.
info
(
"校验新建自有独立活动工具-2内容成功"
);
break
;
}
//删除测试数据
//删除测试数据
this
.
删除自有活动
(
title
);
this
.
删除自有活动
(
title
);
...
...
src/test/java/http/service/hd/DeveloperService.java
View file @
de293b05
...
@@ -914,14 +914,14 @@ public class DeveloperService {
...
@@ -914,14 +914,14 @@ public class DeveloperService {
//创建自有活动工具-所有字段
//创建自有活动工具-所有字段
public
Response
saveHdAll
(
String
id
,
String
title
,
String
limitCount
,
String
limitScope
,
String
freeLimit
,
String
freeScope
,
String
awards
,
String
bannerImgNew
)
throws
Exception
{
public
Response
saveHdAll
(
String
id
,
String
creditsType
,
String
title
,
String
limitCount
,
String
limitScope
,
String
freeLimit
,
String
freeScope
,
String
awards
,
String
bannerImgNew
)
throws
Exception
{
String
url
=
hdHost
+
"/launch/save"
;
String
url
=
hdHost
+
"/launch/save"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
id
);
map
.
put
(
"id"
,
id
);
map
.
put
(
"subType"
,
"turntable_circle"
);
map
.
put
(
"subType"
,
"turntable_circle"
);
map
.
put
(
"creditsType"
,
"1"
);
map
.
put
(
"creditsType"
,
creditsType
);
map
.
put
(
"title"
,
title
);
map
.
put
(
"title"
,
title
);
map
.
put
(
"credits"
,
"10"
);
map
.
put
(
"credits"
,
"10"
);
map
.
put
(
"limitCount"
,
limitCount
);
map
.
put
(
"limitCount"
,
limitCount
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment