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
c5ce00eb
Commit
c5ce00eb
authored
Dec 05, 2018
by
马博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mabo' of gitlab2.dui88.com:mabo/test-platform into mabo
parents
b4744afd
0509cd12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
抽奖异常测试_DuibaTest.java
...est/java/http/cases/NewActivityTest/抽奖异常测试_DuibaTest.java
+4
-0
NewActivityService.java
src/test/java/http/service/Activity/NewActivityService.java
+18
-0
No files found.
src/test/java/http/cases/NewActivityTest/抽奖异常测试_DuibaTest.java
View file @
c5ce00eb
...
...
@@ -184,6 +184,10 @@ public class 抽奖异常测试_DuibaTest extends DuibaTestBase {
Assert
.
assertTrue
(
response
.
jsonPath
().
getString
(
"lottery.link"
).
contains
(
"/activity/takePrizeNew?recordId="
));
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"lottery.id"
),
"11628"
,
"校验id失败"
);
logger
.
info
(
"未登录状态下有免费次数抽奖校验:title,link,id成功"
);
response
=
newActivityService
.
login
(
map
,
"2239.3.3.0"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"登录跳转接口访问失败!"
);
}
}
...
...
src/test/java/http/service/Activity/NewActivityService.java
View file @
c5ce00eb
...
...
@@ -100,6 +100,24 @@ public class NewActivityService {
return
response
;
}
public
Response
login
(
Map
cookies
,
String
dpm
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"dpm"
,
dpm
);
logger
.
info
(
"请求/hdtool/login接口"
);
logger
.
info
(
"url:"
+
url
+
"/hdtool/login"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
url
+
"/hdtool/login"
);
try
{
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
getStatusCode
()),
"200"
);
logger
.
info
(
"/hdtool/login接口成功,返回信息:"
+
response
.
asString
());
}
catch
(
Exception
e
){
throw
new
Exception
(
"/hdtool/login接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/hdtool/login接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
doJoin2
(
String
activityId
,
String
token
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"activityId"
,
activityId
);
...
...
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