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
88a487ef
Commit
88a487ef
authored
Nov 15, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
a1f7764f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
0 deletions
+77
-0
种红包发券.java
src/test/java/http/cases/WalletTest/种红包发券.java
+62
-0
SeedRedPacketService.java
...test/java/http/service/Activity/SeedRedPacketService.java
+15
-0
No files found.
src/test/java/http/cases/WalletTest/种红包发券.java
0 → 100644
View file @
88a487ef
package
http
.
cases
.
WalletTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.Activity.SeedRedPacketService
;
import
http.service.Activity.WalletAccountService
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
utils.RedisUtil
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by mabo on 2018/8/15
*/
public
class
种红包发券
extends
DuibaTestBase
{
@Autowired
SeedRedPacketService
seedRedPacketService
;
@Autowired
WalletAccountService
walletAccountService
;
@Autowired
Authorization
authorization
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//指定用户
private
static
int
uid
=
4689
;
private
static
int
uid2
=
4552
;
@Test
public
void
出券开关校验
_
开
()
throws
Exception
{
//dafuweng登陆获取cookies
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//校验种红包配置
Response
response
=
seedRedPacketService
.
getExtConfig
(
cookies
);
String
adPositions
=
response
.
jsonPath
().
getString
(
"data.adPositions"
);
String
adSwitch
=
response
.
jsonPath
().
getString
(
"data.adSwitch"
);
String
drawNumDaily
=
response
.
jsonPath
().
getString
(
"data.drawNumDaily"
);
Assert
.
assertEquals
(
adPositions
,
"1,2,3"
,
"发券位置校验异常"
);
Assert
.
assertEquals
(
adSwitch
,
"true"
,
"种红包开关校验异常"
);
Assert
.
assertEquals
(
drawNumDaily
,
"20"
,
"每日中奖个数校验异常"
);
}
@Test
public
void
出券开关校验
_
关
()
throws
Exception
{
//dafuweng登陆获取cookies
Map
cookies
=
authorization
.
dafuwengLogin
(
uid2
);
//校验种红包配置
Response
response
=
seedRedPacketService
.
getExtConfig
(
cookies
);
String
adPositions
=
response
.
jsonPath
().
getString
(
"data.adPositions"
);
String
adSwitch
=
response
.
jsonPath
().
getString
(
"data.adSwitch"
);
Assert
.
assertNull
(
adPositions
,
"发券位置校验异常"
);
Assert
.
assertEquals
(
adSwitch
,
"false"
,
"种红包开关校验异常"
);
}
}
src/test/java/http/service/Activity/SeedRedPacketService.java
View file @
88a487ef
...
...
@@ -131,6 +131,21 @@ public class SeedRedPacketService {
return
response
;
}
public
Response
getExtConfig
(
Map
cookies
)
throws
Exception
{
logger
.
info
(
"请求getExtConfig接口"
);
Response
response
=
given
().
cookies
(
cookies
).
get
(
activityHost
+
"/seedRedPacket/getExtConfig"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/seedRedPacket/getExtConfig接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/seedRedPacket/getExtConfig接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/seedRedPacket/getExtConfig接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 修改土地解锁状态后门
* @param appId
...
...
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