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
a00d3c9c
Commit
a00d3c9c
authored
Dec 05, 2018
by
钱雯君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
6a4df1ca
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
24 deletions
+16
-24
pk_开奖_瓜分优惠券.java
src/test/java/http/cases/PkTest/pk_开奖_瓜分优惠券.java
+0
-0
PkActivityService.java
src/test/java/http/service/Manager/PkActivityService.java
+15
-19
PluginService.java
src/test/java/http/service/Manager/PluginService.java
+1
-5
No files found.
src/test/java/http/cases/PkTest/pk_开奖_瓜分优惠券.java
View file @
a00d3c9c
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Manager/PkActivityService.java
View file @
a00d3c9c
...
...
@@ -120,8 +120,14 @@ public class PkActivityService {
if
(
bonusType
.
equals
(
"2"
)){
para
.
put
(
"bonusAmount"
,
"0.1"
);
//实际瓜分红包金额
para
.
put
(
"title"
,
"【自动化】瓜分红包"
+
time
);
}
else
{
}
else
if
(
bonusType
.
equals
(
"1"
))
{
para
.
put
(
"title"
,
"【自动化】瓜分经验"
+
time
);
}
else
{
para
.
put
(
"title"
,
"【自动化】新建pk活动-瓜分优惠券"
);
para
.
put
(
"bonusAmount"
,
""
);
para
.
put
(
"pluginId"
,
"12"
);
//插件id
para
.
put
(
"prizeLimit"
,
"1000"
);
//发放上限
}
para
.
put
(
"configStatus"
,
"1"
);
para
.
put
(
"creditsValue"
,
"1"
);
...
...
@@ -308,11 +314,11 @@ public class PkActivityService {
//创建pk开奖的插件活动id
public
Response
pluginSave
(
String
pkActivityId
)
throws
Exception
{
String
saveUrl
=
ManagerHost
+
"/plugin/save"
;
String
configUrl
=
ManagerHost
+
"/plugin/editConfig.htm"
;
String
saveUrl
=
"http://"
+
ManagerHost
+
"/plugin/save"
;
String
configUrl
=
"http://"
+
ManagerHost
+
"/plugin/editConfig.htm"
;
//获取创建活动的token
Response
response
=
given
().
contentType
(
"text/html;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
get
(
"http://"
+
configUrl
);
Response
response
=
given
().
contentType
(
"text/html;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
get
(
configUrl
);
String
token
=
MatcherString
.
getString
(
response
.
asString
(),
"token: '(.*?)'"
,
1
);
List
<
Map
<
String
,
String
>>
listPrizes
=
new
ArrayList
<>();
...
...
@@ -332,31 +338,18 @@ public class PkActivityService {
award
.
put
(
"name"
,
"LV优惠券自动化测试链接券"
);
award
.
put
(
"stockAfterChange"
,
"10"
);
award
.
put
(
"remaining"
,
"10"
);
Map
<
String
,
String
>
award2
=
new
HashMap
<>();
award
.
put
(
"type"
,
"thanks"
);
award
.
put
(
"description"
,
"谢谢参与"
);
award
.
put
(
"logo"
,
"//yun.duiba.com.cn/upload/uP99F1462438316972.png"
);
award
.
put
(
"valid"
,
"true"
);
award
.
put
(
"rate"
,
""
);
award
.
put
(
"arealimit"
,
"false"
);
award
.
put
(
"stockBeforeChange"
,
"0"
);
award
.
put
(
"stockAfterChange"
,
"0"
);
award
.
put
(
"remaining"
,
"0"
);
listPrizes
.
add
(
award
);
listPrizes
.
add
(
award2
);
String
prizes
=
JSON
.
toJSONString
(
listPrizes
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
"【自动化】pk开奖插件"
);
map
.
put
(
"brickId"
,
"
0
"
);
map
.
put
(
"brickId"
,
"
92
"
);
map
.
put
(
"ruleDescription"
,
"自动化活动规则"
);
map
.
put
(
"rateDescription"
,
"自动化概率说明"
);
map
.
put
(
"multiSkinsMode"
,
"false"
);
map
.
put
(
"multiSkinIds"
,
"[]"
);
map
.
put
(
"triggerTime"
,
"[]"
);
map
.
put
(
"limitCount"
,
"1"
);
map
.
put
(
"exitDays"
,
"7"
);
map
.
put
(
"anticheatExchangeLimit"
,
"false"
);
...
...
@@ -373,10 +366,13 @@ public class PkActivityService {
map
.
put
(
"subType"
,
"plugdraw"
);
map
.
put
(
"joinVerificyMode"
,
"15"
);
map
.
put
(
"pkId"
,
pkActivityId
);
map
.
put
(
"scenarios"
,
"chome"
);
logger
.
info
(
"请求保存插件活动接口的参数为:"
+
JSONObject
.
toJSONString
(
map
));
logger
.
info
(
"请求保存插件活动接口:"
+
saveUrl
);
Response
saveResponse
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
params
(
map
).
post
(
"http://"
+
saveUrl
);
Response
saveResponse
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
params
(
map
).
post
(
saveUrl
);
saveResponse
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
saveResponse
.
jsonPath
().
getString
(
"success"
),
"true"
);
...
...
src/test/java/http/service/Manager/PluginService.java
View file @
a00d3c9c
...
...
@@ -2,6 +2,7 @@ package http.service.Manager;
import
base.DuibaLog
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -345,9 +346,4 @@ public class PluginService {
}
}
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