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
595108b4
Commit
595108b4
authored
Nov 29, 2018
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
039a72e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
3 deletions
+111
-3
新建活动测试_DuibaTest.java
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
+53
-1
DeveloperService.java
src/test/java/http/service/hd/DeveloperService.java
+58
-2
No files found.
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
View file @
595108b4
...
@@ -58,8 +58,14 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
...
@@ -58,8 +58,14 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
};
};
}
else
if
(
method
.
getName
().
equals
(
"新建自有手动开奖活动"
)){
result
=
new
Object
[][]{
new
Object
[]{
1
,
"10"
,
"everyday"
,
"5"
,
"everyday"
,
"//yun.duiba.com.cn/upload/mhty76ri9b.png"
,
"新建自有手动开奖--每日次数"
},
};
}
}
return
result
;
return
result
;
}
}
...
@@ -223,6 +229,52 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
...
@@ -223,6 +229,52 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
}
}
/**
* @param caseNum 用例编号
* @param consumerDrawLimit 用户抽奖限制次数
* @param consumerDrawLimitScope 用户抽奖限制类型
* @param freeLimit 免费抽奖次数
* @param freeLimitScope 免费抽奖次数类型
* @param bannerImgNew 新版banner图
* @param caseName 用例名称
* @throws Exception
*/
@Test
(
dataProvider
=
"providerMethod"
)
public
void
新建自有手动开奖活动
(
int
caseNum
,
String
consumerDrawLimit
,
String
consumerDrawLimitScope
,
String
freeLimit
,
String
freeLimitScope
,
String
bannerImgNew
,
String
caseName
)
throws
Exception
{
logger
.
info
(
"-----------------------------"
+
caseName
+
"-----------------------------"
);
String
data
=
PublicMethod
.
data
();
String
title
=
"【自动化】自有手动开奖"
+
data
;
//新建自有手动开奖
developerService
.
saveManualLottery
(
title
,
consumerDrawLimit
,
consumerDrawLimitScope
,
freeLimit
,
freeLimitScope
,
bannerImgNew
);
//获取活动id
Response
listResponse
=
developerService
.
list2
(
title
);
String
id
=
String
.
valueOf
(
listResponse
.
jsonPath
().
getString
(
"data.list[0].activityId"
));
//编辑活动,校验活动内容
Response
editResponse
=
developerService
.
editManualLottery
(
id
);
switch
(
caseNum
){
case
1
:
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.credits"
),
"50"
,
"校验活动积分失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeLimit"
),
"5"
,
"校验活动免费抽奖次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.freeLimitScope"
),
"everyday"
,
"校验活动免费抽奖次数类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.consumerDrawLimit"
),
"10"
,
"校验用户抽奖限制次数失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.consumerDrawLimitScope"
),
"everyday"
,
"校验用户抽奖限制类型失败"
);
Assert
.
assertEquals
(
editResponse
.
jsonPath
().
getString
(
"data.bannerImgNew"
),
"//yun.duiba.com.cn/upload/mhty76ri9b.png"
,
"校验活动新版banner图失败"
);
logger
.
info
(
"校验新建自有手动开奖-1内容成功"
);
break
;
case
2
:
break
;
}
//删除测试数据
this
.
删除自有活动
(
title
);
}
//删除自有活动
//删除自有活动
...
...
src/test/java/http/service/hd/DeveloperService.java
View file @
595108b4
...
@@ -915,7 +915,7 @@ public class DeveloperService {
...
@@ -915,7 +915,7 @@ public class DeveloperService {
}
}
//
创建
自有活动工具-所有字段
//
保存
自有活动工具-所有字段
public
Response
saveHdAll
(
String
id
,
String
creditsType
,
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"
;
...
@@ -976,7 +976,7 @@ public class DeveloperService {
...
@@ -976,7 +976,7 @@ public class DeveloperService {
return
response
;
return
response
;
}
}
//
创建保存自有单品抽奖
//
保存自有单品抽奖--所有字段
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
{
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"
;
...
@@ -1053,5 +1053,61 @@ public class DeveloperService {
...
@@ -1053,5 +1053,61 @@ public class DeveloperService {
return
response
;
return
response
;
}
}
//保存自有手动开奖--所有字段
public
Response
saveManualLottery
(
String
title
,
String
consumerDrawLimit
,
String
consumerDrawLimitScope
,
String
freeLimit
,
String
freeLimitScope
,
String
bannerImgNew
)
throws
Exception
{
String
url
=
hdHost
+
"/appManualLottery/create"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
title
);
map
.
put
(
"credits"
,
"50"
);
map
.
put
(
"bannerImage"
,
"//yun.duiba.com.cn/upload/buctmou88a.png"
);
map
.
put
(
"smallImage"
,
"//yun.duiba.com.cn/upload/wf0u6dtq7e.png"
);
map
.
put
(
"image"
,
"//yun.duiba.com.cn/upload/nwmcomavqu.png"
);
map
.
put
(
"bannerImgNew"
,
bannerImgNew
);
map
.
put
(
"appId"
,
"2239"
);
map
.
put
(
"marketPrice"
,
"10"
);
map
.
put
(
"introduction"
,
"测试奖品说明"
);
map
.
put
(
"consumerDrawLimit"
,
consumerDrawLimit
);
map
.
put
(
"consumerDrawLimitScope"
,
consumerDrawLimitScope
);
map
.
put
(
"freeLimit"
,
freeLimit
);
map
.
put
(
"freeLimitScope"
,
freeLimitScope
);
map
.
put
(
"overDate"
,
"2020-11-01"
);
logger
.
info
(
"请求创建自有手动开奖url:"
+
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLogin
()).
params
(
map
).
post
(
"http://"
+
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"创建自有手动开奖接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"创建自有手动开奖接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//编辑自有手动开奖
public
Response
editManualLottery
(
String
manualLotteryId
)
throws
Exception
{
String
url
=
hdHost
+
"/appManualLottery/edit"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
"2239"
);
map
.
put
(
"manualLotteryId"
,
manualLotteryId
);
logger
.
info
(
"请求编辑自有手动开奖url:"
+
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLogin
()).
params
(
map
).
get
(
"http://"
+
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"编辑自有手动开奖接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"编辑自有手动开奖接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
}
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