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
039a72e3
Commit
039a72e3
authored
Nov 28, 2018
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
d2591d15
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
新建活动测试_DuibaTest.java
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
+16
-3
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 @
039a72e3
...
@@ -53,7 +53,8 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
...
@@ -53,7 +53,8 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
}
else
}
else
if
(
method
.
getName
().
equals
(
"新建自有单品抽奖活动"
)){
if
(
method
.
getName
().
equals
(
"新建自有单品抽奖活动"
)){
result
=
new
Object
[][]{
result
=
new
Object
[][]{
new
Object
[]{
1
,
"177222"
,
"【自动化】自有实物"
,
"object"
,
"100"
,
"5"
,
"everyday"
,
"//yun.dui88.com/images/201811/hvhlu2ggta.png"
,
"0"
,
""
,
"新建自有单品抽奖--每天抽奖"
},
//case1
new
Object
[]{
1
,
"177222"
,
"【自动化】自有实物"
,
"object"
,
"100"
,
"5"
,
"everyday"
,
"//yun.dui88.com/images/201811/hvhlu2ggta.png"
,
"0"
,
""
,
"false"
,
"新建自有单品抽奖--每日次数"
},
//case1
new
Object
[]{
2
,
"159857"
,
"【自动化勿动】自有优惠券"
,
"coupon"
,
"2000"
,
"5"
,
"forever"
,
"//yun.dui88.com/images/201811/hvhlu2ggta.png"
,
"2"
,
"2"
,
"true"
,
"新建自有单品抽奖--永久次数和会员等级"
},
//case1
};
};
...
@@ -169,17 +170,18 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
...
@@ -169,17 +170,18 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
* @param bannerImgNew 新版banner图
* @param bannerImgNew 新版banner图
* @param vipLimitType 会员等级配置
* @param vipLimitType 会员等级配置
* @param vipLimits 会员的等级范围
* @param vipLimits 会员的等级范围
* @param exchangeLimit 直充防刷
* @param caseName 用例名称
* @param caseName 用例名称
* @throws Exception
* @throws Exception
*/
*/
@Test
(
dataProvider
=
"providerMethod"
)
@Test
(
dataProvider
=
"providerMethod"
)
public
void
新建自有单品抽奖活动
(
int
caseNum
,
String
mainAppItemId
,
String
appItemTitle
,
String
appItemType
,
String
mainAppItemRemaining
,
String
freeDrawLimit
,
String
freeDrawLimitScope
,
String
bannerImgNew
,
String
vipLimitType
,
String
vipLimits
,
String
caseName
)
throws
Exception
{
public
void
新建自有单品抽奖活动
(
int
caseNum
,
String
mainAppItemId
,
String
appItemTitle
,
String
appItemType
,
String
mainAppItemRemaining
,
String
freeDrawLimit
,
String
freeDrawLimitScope
,
String
bannerImgNew
,
String
vipLimitType
,
String
vipLimits
,
String
exchangeLimit
,
String
caseName
)
throws
Exception
{
logger
.
info
(
"-----------------------------"
+
caseName
+
"-----------------------------"
);
logger
.
info
(
"-----------------------------"
+
caseName
+
"-----------------------------"
);
String
data
=
PublicMethod
.
data
();
String
data
=
PublicMethod
.
data
();
String
title
=
"【自动化】自有单品抽奖"
+
data
;
String
title
=
"【自动化】自有单品抽奖"
+
data
;
//新建自有活动工具
//新建自有活动工具
developerService
.
saveDpAll
(
""
,
title
,
mainAppItemId
,
appItemTitle
,
appItemType
,
mainAppItemRemaining
,
freeDrawLimit
,
freeDrawLimitScope
,
bannerImgNew
,
vipLimitType
,
vipLimits
);
developerService
.
saveDpAll
(
""
,
title
,
mainAppItemId
,
appItemTitle
,
appItemType
,
mainAppItemRemaining
,
freeDrawLimit
,
freeDrawLimitScope
,
bannerImgNew
,
vipLimitType
,
vipLimits
,
exchangeLimit
);
//获取活动id
//获取活动id
Response
listResponse
=
developerService
.
list2
(
title
);
Response
listResponse
=
developerService
.
list2
(
title
);
...
@@ -198,9 +200,20 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
...
@@ -198,9 +200,20 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.consumerDrawLimitScope"
),
"everyday"
,
"校验用户抽奖限制类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.consumerDrawLimitScope"
),
"everyday"
,
"校验用户抽奖限制类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.mainAppItemId"
),
"177222"
,
"校验活动奖品id失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.mainAppItemId"
),
"177222"
,
"校验活动奖品id失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.mainAppItemRemaining"
),
"100"
,
"校验活动奖品数量失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.mainAppItemRemaining"
),
"100"
,
"校验活动奖品数量失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.mainAppItemRate"
),
"66.66"
,
"校验活动奖品数量失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitDateJson"
),
"{\"endDay\":\"2020-02-01\",\"endThours\":\"22\",\"endTminute\":\"0\",\"startDay\":\"2018-11-26\",\"startHours\":\"6\",\"startTminute\":\"0\"}"
,
"校验活动抽奖日期限制失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.limitDateJson"
),
"{\"endDay\":\"2020-02-01\",\"endThours\":\"22\",\"endTminute\":\"0\",\"startDay\":\"2018-11-26\",\"startHours\":\"6\",\"startTminute\":\"0\"}"
,
"校验活动抽奖日期限制失败"
);
logger
.
info
(
"校验新建自有单品抽奖-1内容成功"
);
logger
.
info
(
"校验新建自有单品抽奖-1内容成功"
);
break
;
break
;
case
2
:
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.appItemTitle"
),
"【自动化勿动】自有优惠券"
,
"校验活动奖品名称失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeDrawLimit"
),
"5"
,
"校验活动免费抽奖次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeDrawLimitScope"
),
"forever"
,
"校验活动免费抽奖类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.mainAppItemId"
),
"159857"
,
"校验活动奖品id失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.appVipLimitOpen"
),
"true"
,
"校验活动会员等级开关失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.vipLimits"
),
"2"
,
"校验活动会员等级范围失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.exchangeLimit"
),
"true"
,
"校验活动直充防刷失败"
);
logger
.
info
(
"校验新建自有单品抽奖-1内容成功"
);
break
;
}
}
...
...
src/test/java/http/service/hd/DeveloperService.java
View file @
039a72e3
...
@@ -977,7 +977,7 @@ public class DeveloperService {
...
@@ -977,7 +977,7 @@ public class DeveloperService {
}
}
//创建保存自有单品抽奖
//创建保存自有单品抽奖
public
Response
saveDpAll
(
String
id
,
String
title
,
String
mainAppItemId
,
String
appItemTitle
,
String
appItemType
,
String
mainAppItemRemaining
,
String
freeDrawLimit
,
String
freeDrawLimitScope
,
String
bannerImgNew
,
String
vipLimitType
,
String
vipLimits
)
throws
Exception
{
public
Response
saveDpAll
(
String
id
,
String
title
,
String
mainAppItemId
,
String
appItemTitle
,
String
appItemType
,
String
mainAppItemRemaining
,
String
freeDrawLimit
,
String
freeDrawLimitScope
,
String
bannerImgNew
,
String
vipLimitType
,
String
vipLimits
,
String
exchangeLimit
)
throws
Exception
{
String
url
=
hdHost
+
"/appSingleLottery/saveOrUpdate"
;
String
url
=
hdHost
+
"/appSingleLottery/saveOrUpdate"
;
...
@@ -1008,7 +1008,7 @@ public class DeveloperService {
...
@@ -1008,7 +1008,7 @@ public class DeveloperService {
map
.
put
(
"startTminute"
,
"0"
);
map
.
put
(
"startTminute"
,
"0"
);
map
.
put
(
"endThours"
,
"22"
);
map
.
put
(
"endThours"
,
"22"
);
map
.
put
(
"endTminute"
,
"0"
);
map
.
put
(
"endTminute"
,
"0"
);
map
.
put
(
"exchangeLimit"
,
"false"
);
map
.
put
(
"exchangeLimit"
,
exchangeLimit
);
map
.
put
(
"appItemType"
,
appItemType
);
map
.
put
(
"appItemType"
,
appItemType
);
map
.
put
(
"mainAppItemId"
,
mainAppItemId
);
map
.
put
(
"mainAppItemId"
,
mainAppItemId
);
map
.
put
(
"mainAppItemDegree"
,
""
);
map
.
put
(
"mainAppItemDegree"
,
""
);
...
...
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