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
587ad665
Commit
587ad665
authored
Dec 06, 2018
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
a0235647
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
1 deletion
+129
-1
新建活动测试_DuibaTest.java
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
+0
-0
DeveloperService.java
src/test/java/http/service/hd/DeveloperService.java
+58
-1
LaunchService.java
src/test/java/http/service/hd/LaunchService.java
+71
-0
No files found.
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
View file @
587ad665
This diff is collapsed.
Click to expand it.
src/test/java/http/service/hd/DeveloperService.java
View file @
587ad665
...
@@ -619,7 +619,7 @@ public class DeveloperService {
...
@@ -619,7 +619,7 @@ public class DeveloperService {
return
response
;
return
response
;
}
}
//删除活动
//删除
自有签到
活动
public
Response
delete
(
String
signId
)
throws
Exception
{
public
Response
delete
(
String
signId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
@@ -1172,4 +1172,61 @@ public class DeveloperService {
...
@@ -1172,4 +1172,61 @@ public class DeveloperService {
return
response
;
return
response
;
}
}
//创建自有弹层签到--所有字段
public
Response
saveSign
(
String
title
,
String
signType
,
String
prizes
,
String
signCredits
)
throws
Exception
{
String
url
=
hdHost
+
"/signConfig/signSave"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
title
);
map
.
put
(
"rateDescription"
,
"测试概率shuom"
);
map
.
put
(
"ruleDescription"
,
"测试活动规则"
);
map
.
put
(
"signType"
,
signType
);
map
.
put
(
"prizes"
,
prizes
);
map
.
put
(
"imageUrl"
,
"//yun.duiba.com.cn/developer_new/images/activities/sign.jpg"
);
map
.
put
(
"triggerType"
,
"chome"
);
map
.
put
(
"deletedPrizeIds"
,
""
);
map
.
put
(
"signCredits"
,
signCredits
);
map
.
put
(
"status"
,
"0"
);
map
.
put
(
"anticheatExchangeLimit"
,
"true"
);
map
.
put
(
"appId"
,
"2239"
);
map
.
put
(
"id"
,
""
);
logger
.
info
(
"创建自有签到活动:"
+
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
editSign
(
String
id
)
throws
Exception
{
String
url
=
hdHost
+
"/signConfig/signEdit"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
id
);
map
.
put
(
"appId"
,
"2239"
);
logger
.
info
(
"编辑自有签到活动:"
+
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
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"编辑自有签到活动接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"编辑自有签到活动接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
}
src/test/java/http/service/hd/LaunchService.java
0 → 100644
View file @
587ad665
package
http
.
service
.
hd
;
import
http.service.Authorization
;
import
base.DuibaLog
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.testng.Assert
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
/**
* Created by lvwenyan on 2018/12/06.
*/
@Service
public
class
LaunchService
{
@Value
(
"${hdserver.host}"
)
String
hdHost
;
@Autowired
Authorization
authorization
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//获取活动默认数据
public
Response
getDataConfigUrl
(
String
type
)
throws
Exception
{
String
url
=
hdHost
+
"/launch/getDataConfigUrl"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
"2239"
);
map
.
put
(
"type"
,
type
);
logger
.
info
(
"请求数据配置接口:"
+
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
obtain
()
throws
Exception
{
String
url
=
hdHost
+
"/launch/obtain"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
"2239"
);
logger
.
info
(
"请求获取奖品接口:"
+
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
;
}
}
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