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
0d84e7dd
Commit
0d84e7dd
authored
Dec 18, 2018
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
d45e51fa
e932ba16
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
334 additions
and
49 deletions
+334
-49
瓜分红包_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
+4
-0
配置测试_AccessTest.java
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
+73
-0
pk_押注测试_AccessTest.java
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
+164
-9
天天秒杀_秒杀详情测试.java
src/test/java/http/cases/SeckillTest/天天秒杀_秒杀详情测试.java
+62
-40
PkService.java
src/test/java/http/service/Activity/PkService.java
+19
-0
SeckillService.java
src/test/java/http/service/app/SeckillService.java
+12
-0
No files found.
src/test/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
View file @
0d84e7dd
...
...
@@ -202,6 +202,10 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.show"
),
"false"
,
"展示弹窗校验失败"
);
}
@Test
(
dependsOnMethods
=
{
"出奖弹层校验"
})
public
void
战绩页校验
()
throws
Exception
{
}
public
void
modifyOpenPrizeTime
(
String
betId
,
int
x
)
throws
Exception
{
DateTime
time1
=
new
DateTime
();
...
...
src/test/java/http/cases/PkMoudleTest/配置测试_AccessTest.java
View file @
0d84e7dd
...
...
@@ -16,10 +16,14 @@ import io.restassured.response.Response;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.testng.Assert
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
utils.ExcelDataProvider
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
...
...
@@ -38,6 +42,17 @@ public class 配置测试_AccessTest extends DuibaTestBase {
private
static
Integer
uid
=
5028
;
//
@DataProvider
public
Object
[][]
providerMethod
(
Method
method
){
Object
[][]
result
=
null
;
if
(
method
.
getName
().
equals
(
"重复投注测试"
))
{
result
=
new
Object
[][]{
new
Object
[]{
"3758"
},
new
Object
[]{
"3757"
},
};
}
return
result
;
}
@Test
public
void
配置测试
()
throws
Exception
{
...
...
@@ -110,6 +125,44 @@ public class 配置测试_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
optionImg4
,
"//yun.dui88.com/images/201812/ifh1kvaq9m.jpg"
,
"校验选项2 图片失败"
);
Assert
.
assertEquals
(
optionName4
,
"分红包选项二"
,
"校验选项2 title失败"
);
//已投注配置
String
betType3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.betType"
);
String
bonusType3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.bonusType"
);
String
configStatus3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.configStatus"
);
String
creditsValue3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.creditsValue"
);
String
id3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.id"
);
String
shareExp3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.shareExp"
);
String
title3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.title"
);
String
unitName3
=
response
.
jsonPath
().
getString
(
"data.betedList[0].betConfig.unitName"
);
//选项获取
String
optionId5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].optionId"
);
String
optionImg5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].optionImg"
);
String
optionName5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].optionName"
);
String
chooseThisOption5
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[0].chooseThisOption"
);
String
optionId6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].optionId"
);
String
optionImg6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].optionImg"
);
String
optionName6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].optionName"
);
String
chooseThisOption6
=
response
.
jsonPath
().
getString
(
"data.betedList[0].options[1].chooseThisOption"
);
Assert
.
assertEquals
(
betType3
,
"1"
,
"校验押注类型失败"
);
//'押注类型 1-单选单次,2-多选无限制'
Assert
.
assertEquals
(
bonusType3
,
"4"
,
"校验瓜分类型失败"
);
//'瓜分类型1瓜分经验2瓜分红包3发奖品4瓜分积分'
Assert
.
assertEquals
(
configStatus3
,
"3"
,
"校验投注活动的状态失败"
);
//'投注活动的状态:1关闭不可见2关闭可见3开启4结束'
Assert
.
assertEquals
(
creditsValue3
,
"0"
,
"校验积分价值失败"
);
//积分价值
Assert
.
assertEquals
(
id3
,
"1799"
,
"校验pk id失败"
);
Assert
.
assertTrue
(
new
BigDecimal
(
shareExp3
).
compareTo
(
new
BigDecimal
(
"50"
))==
0
,
"校验瓜分的经验池失败"
);
//瓜分的经验池
Assert
.
assertEquals
(
title3
,
"待投注"
,
"校验投注活动标题失败"
);
//投注活动标题
Assert
.
assertEquals
(
unitName3
,
"元宝"
,
"校验消耗类型失败"
);
Assert
.
assertEquals
(
optionId5
,
"3757"
,
"校验选项1 id失败"
);
Assert
.
assertEquals
(
optionImg5
,
"//yun.dui88.com/images/201812/2sv582lhyo.png"
,
"校验选项1 图片失败"
);
Assert
.
assertEquals
(
optionName5
,
"1"
,
"校验选项1 title失败"
);
Assert
.
assertEquals
(
chooseThisOption5
,
"false"
,
"校验选项1选择情况失败"
);
Assert
.
assertEquals
(
optionId6
,
"3758"
,
"校验选项2 id失败"
);
Assert
.
assertEquals
(
optionImg6
,
"//yun.dui88.com/images/201812/hyhd36w6be.png"
,
"校验选项2 图片失败"
);
Assert
.
assertEquals
(
optionName6
,
"2"
,
"校验选项2 title失败"
);
Assert
.
assertEquals
(
chooseThisOption6
,
"true"
,
"校验选项2选择情况失败"
);
logger
.
info
(
"pk组件分红包、分积分配置校验正确!"
);
}
...
...
@@ -130,6 +183,23 @@ public class 配置测试_AccessTest extends DuibaTestBase {
logger
.
info
(
"投注积分不足校验成功!"
);
}
@Test
(
dataProvider
=
"providerMethod"
)
public
void
重复投注测试
(
String
optionId
){
String
url
=
activityHost
+
"/betActivity2/doJoin"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"betId"
,
"1799"
);
map
.
put
(
"optionId"
,
optionId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验success失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"code"
),
"100011"
,
"校验错误码失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"活动已参加"
,
"校验desc失败"
);
logger
.
info
(
"重复投注校验成功!"
);
}
@Test
public
void
未登录投注
(){
//获取未登录场景cookie
...
...
@@ -151,4 +221,6 @@ public class 配置测试_AccessTest extends DuibaTestBase {
logger
.
info
(
"未登录投注校验成功!"
);
}
}
\ No newline at end of file
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
View file @
0d84e7dd
...
...
@@ -18,10 +18,12 @@ import io.restassured.response.Response;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.AfterMethod
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
utils.GetCookieUtil
;
import
utils.GetDbName
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -49,17 +51,22 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
static
Integer
uid01
=
3416
;
//【勿动】pk01_测试押注
private
static
Integer
uid01
=
3416
;
//【勿动】pk01_测试押注
瓜分经验
private
static
String
uid01_consumerId
=
"100066015"
;
private
static
Integer
uid02
=
3417
;
//【勿动】pk02_积分不足_测试押注
private
static
String
uid02_consumerId
=
"100066016"
;
private
static
Integer
uid03
=
5244
;
//【勿动】pk02_押注0积分活动
private
static
String
uid03_consumerId
=
"100117002"
;
private
static
Integer
uid04
=
5247
;
//【勿动】pk02_测试押注瓜分红包
private
static
String
uid04_consumerId
=
"100117005"
;
private
static
Integer
uid05
=
5248
;
//【勿动】pk02_测试押注瓜分红包
private
static
String
uid05_consumerId
=
"100117006"
;
private
String
consumerIds
=
""
;
private
List
<
String
>
orderIds
=
new
ArrayList
<>();
//
private List<String> orderIds = new ArrayList<>();
private
List
<
Map
<
String
,
String
>>
orderIds
=
new
ArrayList
<>();
@BeforeMethod
public
void
clearUp
()
{
...
...
@@ -77,7 +84,7 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
@Test
public
void
押注
_
红包
活动测试
()
throws
Exception
{
public
void
押注
_
瓜分经验
pk
活动测试
()
throws
Exception
{
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid01
);
Map
<
String
,
Object
>
consumer
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid01_consumerId
);
Long
userCredit
=
Long
.
parseLong
(
user
.
get
(
"credits"
).
toString
());
...
...
@@ -88,7 +95,10 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
),
"200"
,
"校验押注是否成功且不是第一次押注失败"
);
String
orderId
=
doJoinResponse
.
jsonPath
().
getString
(
"data"
);
orderIds
.
add
(
orderId
);
Map
<
String
,
String
>
orderIdMap
=
new
HashMap
<>();
orderIdMap
.
put
(
"consumerId"
,
uid01_consumerId
);
orderIdMap
.
put
(
"orderId"
,
orderId
);
orderIds
.
add
(
orderIdMap
);
Response
statusResponse
=
pkService
.
getOrderStatus
(
uid01
,
orderId
);
statusResponse
.
prettyPrint
();
String
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
...
...
@@ -114,9 +124,144 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验参加结果失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"code"
),
"100011"
,
"校验参加失败错误码失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"desc"
),
"活动已参加"
,
"校验参加失败描述失败"
);
}
@Test
public
void
押注
_
瓜分红包
pk
活动测试
()
throws
Exception
{
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid04
);
Map
<
String
,
Object
>
consumer
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid04_consumerId
);
Long
userCredit
=
Long
.
parseLong
(
user
.
get
(
"credits"
).
toString
());
Long
consumerCredit
=
Long
.
parseLong
(
consumer
.
get
(
"credits"
).
toString
());
Response
doJoinResponse
=
pkService
.
doJoin
(
uid04
,
"122"
,
"243"
);
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
),
"200"
,
"校验押注是否成功且不是第一次押注失败"
);
String
orderId
=
doJoinResponse
.
jsonPath
().
getString
(
"data"
);
Map
<
String
,
String
>
orderIdMap
=
new
HashMap
<>();
orderIdMap
.
put
(
"consumerId"
,
uid04_consumerId
);
orderIdMap
.
put
(
"orderId"
,
orderId
);
orderIds
.
add
(
orderIdMap
);
Response
statusResponse
=
pkService
.
getOrderStatus
(
uid04
,
orderId
);
statusResponse
.
prettyPrint
();
String
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
int
i
=
8
;
while
(
i
>
0
&
consumerStatus
.
equals
(
"1"
)){
Thread
.
sleep
(
1000
);
statusResponse
=
pkService
.
getOrderStatus
(
uid04
,
orderId
);
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
}
Assert
.
assertEquals
(
consumerStatus
,
"2"
,
"校验押注是否成功,扣积分是否成功失败"
);
Map
<
String
,
Object
>
user1
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid04
);
Map
<
String
,
Object
>
consumer1
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid04_consumerId
);
String
userCredit1
=
user1
.
get
(
"credits"
).
toString
();
String
consumerCredit1
=
consumer1
.
get
(
"credits"
).
toString
();
Assert
.
assertEquals
(
userCredit1
,
String
.
valueOf
(
userCredit
-
100
),
"user积分扣除校验失败"
);
Assert
.
assertEquals
(
consumerCredit1
,
String
.
valueOf
(
consumerCredit
-
100
),
"consumer积分扣除校验失败"
);
logger
.
info
(
"校验积分消耗成功,原积分值="
+
userCredit
+
",消耗后积分值为"
+
userCredit1
);
//参加过一次之后,不能再参加该pk活动
Response
doJoinResponse1
=
pkService
.
doJoin2
(
uid04
,
"122"
,
"243"
);
doJoinResponse1
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验参加结果失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"code"
),
"100011"
,
"校验参加失败错误码失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"desc"
),
"活动已参加"
,
"校验参加失败描述失败"
);
}
@Test
public
void
押注
_
瓜分优惠券
pk
活动测试
()
throws
Exception
{
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid05
);
Map
<
String
,
Object
>
consumer
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid05_consumerId
);
Long
userCredit
=
Long
.
parseLong
(
user
.
get
(
"credits"
).
toString
());
Long
consumerCredit
=
Long
.
parseLong
(
consumer
.
get
(
"credits"
).
toString
());
Response
doJoinResponse
=
pkService
.
doJoin
(
uid05
,
"83"
,
"165"
);
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
),
"200"
,
"校验押注是否成功且不是第一次押注失败"
);
String
orderId
=
doJoinResponse
.
jsonPath
().
getString
(
"data"
);
Map
<
String
,
String
>
orderIdMap
=
new
HashMap
<>();
orderIdMap
.
put
(
"consumerId"
,
uid05_consumerId
);
orderIdMap
.
put
(
"orderId"
,
orderId
);
orderIds
.
add
(
orderIdMap
);
Response
statusResponse
=
pkService
.
getOrderStatus
(
uid05
,
orderId
);
statusResponse
.
prettyPrint
();
String
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
int
i
=
8
;
while
(
i
>
0
&
consumerStatus
.
equals
(
"1"
)){
Thread
.
sleep
(
1000
);
statusResponse
=
pkService
.
getOrderStatus
(
uid05
,
orderId
);
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
}
Assert
.
assertEquals
(
consumerStatus
,
"2"
,
"校验押注是否成功,扣积分是否成功失败"
);
Map
<
String
,
Object
>
user1
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid05
);
Map
<
String
,
Object
>
consumer1
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid05_consumerId
);
String
userCredit1
=
user1
.
get
(
"credits"
).
toString
();
String
consumerCredit1
=
consumer1
.
get
(
"credits"
).
toString
();
Assert
.
assertEquals
(
userCredit1
,
String
.
valueOf
(
userCredit
-
50
),
"user积分扣除校验失败"
);
Assert
.
assertEquals
(
consumerCredit1
,
String
.
valueOf
(
consumerCredit
-
50
),
"consumer积分扣除校验失败"
);
logger
.
info
(
"校验积分消耗成功,原积分值="
+
userCredit
+
",消耗后积分值为"
+
userCredit1
);
//参加过一次之后,不能再参加该pk活动
Response
doJoinResponse1
=
pkService
.
doJoin2
(
uid05
,
"83"
,
"166"
);
doJoinResponse1
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验参加结果失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"code"
),
"100011"
,
"校验参加失败错误码失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"desc"
),
"活动已参加"
,
"校验参加失败描述失败"
);
}
@Test
public
void
押注
_0
积分
pk
活动
()
throws
Exception
{
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid03
);
Map
<
String
,
Object
>
consumer
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid03_consumerId
);
Long
userCredit
=
Long
.
parseLong
(
user
.
get
(
"credits"
).
toString
());
Long
consumerCredit
=
Long
.
parseLong
(
consumer
.
get
(
"credits"
).
toString
());
Response
doJoinResponse
=
pkService
.
doJoin
(
uid03
,
"82"
,
"163"
);
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
),
"200"
,
"校验押注是否成功且不是第一次押注失败"
);
String
orderId
=
doJoinResponse
.
jsonPath
().
getString
(
"data"
);
Map
<
String
,
String
>
orderIdMap
=
new
HashMap
<>();
orderIdMap
.
put
(
"consumerId"
,
uid03_consumerId
);
orderIdMap
.
put
(
"orderId"
,
orderId
);
orderIds
.
add
(
orderIdMap
);
Response
statusResponse
=
pkService
.
getOrderStatus
(
uid03
,
orderId
);
statusResponse
.
prettyPrint
();
String
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
int
i
=
8
;
while
(
i
>
0
&
consumerStatus
.
equals
(
"1"
)){
Thread
.
sleep
(
1000
);
statusResponse
=
pkService
.
getOrderStatus
(
uid03
,
orderId
);
consumerStatus
=
statusResponse
.
jsonPath
().
getString
(
"data.consumeStatus"
);
}
Assert
.
assertEquals
(
consumerStatus
,
"2"
,
"校验押注是否成功,扣积分是否成功失败"
);
Map
<
String
,
Object
>
user1
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id=?\n"
,
uid03
);
Map
<
String
,
Object
>
consumer1
=
jdbc
.
findSimpleResult
(
"select * from new_consumer.consumer_0010 where id=?\n"
,
uid03_consumerId
);
String
userCredit1
=
user1
.
get
(
"credits"
).
toString
();
String
consumerCredit1
=
consumer1
.
get
(
"credits"
).
toString
();
Assert
.
assertEquals
(
userCredit1
,
String
.
valueOf
(
userCredit
-
0
),
"user积分扣除校验失败"
);
Assert
.
assertEquals
(
consumerCredit1
,
String
.
valueOf
(
consumerCredit
-
0
),
"consumer积分扣除校验失败"
);
logger
.
info
(
"校验积分消耗成功,原积分值="
+
userCredit
+
",消耗后积分值为"
+
userCredit1
);
//参加过一次之后,不能再参加该pk活动
Response
doJoinResponse1
=
pkService
.
doJoin2
(
uid03
,
"82"
,
"163"
);
doJoinResponse1
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验参加结果失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"code"
),
"100011"
,
"校验参加失败错误码失败"
);
Assert
.
assertEquals
(
doJoinResponse1
.
jsonPath
().
getString
(
"desc"
),
"活动已参加"
,
"校验参加失败描述失败"
);
}
@Test
public
void
押注
_
积分不足测试
()
throws
Exception
{
...
...
@@ -163,6 +308,7 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
).
toString
(),
"100060"
);
}
public
Map
<
String
,
String
>
createUser
()
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
@@ -186,14 +332,23 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
}
@AfterMethod
// @AfterMethod
@AfterClass
public
void
tearDown
()
{
try
{
Boolean
result
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = '124' and partner_user_id = '3416'\n"
);
for
(
String
orderId:
orderIds
){
Boolean
result2
=
jdbc
.
update
(
"delete from activity_order_con.tb_trade_center_activity_order_0735 where order_num = ?\n"
,
orderId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = '82' and partner_user_id = '5244'\n"
);
Boolean
result4
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = '122' and partner_user_id = '5247'\n"
);
Boolean
result5
=
jdbc
.
update
(
"delete from act_record.tb_bet_record where bet_id = '83' and partner_user_id = '5248'\n"
);
for
(
Map
<
String
,
String
>
orderId:
orderIds
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
dbName1
=
GetDbName
.
getDbName
(
"activity_order_con.tb_trade_center_activity_order_"
,
orderId
.
get
(
"consumerId"
),
"1"
);
String
sql1
=
"delete from "
+
dbName1
+
" where order_num = ? "
;
logger
.
info
(
"清理的sql为:"
+
sql1
);
Boolean
result3
=
jdbc
.
update
(
sql1
,
orderId
.
get
(
"orderId"
));
}
clear
(
consumerIds
);
...
...
src/test/java/http/cases/SeckillTest/天天秒杀_秒杀详情测试.java
View file @
0d84e7dd
...
...
@@ -103,16 +103,19 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"4"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"2"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
String
addrProvince
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrProvince\":\"(.*?)\","
,
1
));
String
addrCity
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrCity\":\"(.*?)\","
,
1
));
String
addrArea
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrArea\":\"(.*?)\","
,
1
));
String
addrDetail
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrDetail\":\"(.*?)\","
,
1
));
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_Nomal
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
String
addrProvince
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrProvince\": \"(.*?)\","
,
1
));
String
addrCity
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrCity\": \"(.*?)\","
,
1
));
String
addrArea
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrArea\": \"(.*?)\","
,
1
));
String
addrDetail
=
dESCrypto
.
decrypt3DE
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrDetail\": \"(.*?)\","
,
1
));
Assert
.
assertEquals
(
addrProvince
,
"浙江省"
,
"校验收货地址-省信息失败"
);
Assert
.
assertEquals
(
addrCity
,
"杭州市"
,
"校验收货地址-市信息失败"
);
Assert
.
assertEquals
(
addrArea
,
"西湖区"
,
"校验收货地址-区信息失败"
);
...
...
@@ -129,12 +132,15 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"8"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"5"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_Nomal
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
}
...
...
@@ -146,12 +152,15 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"10"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"7"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_Nomal
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
}
...
...
@@ -169,16 +178,19 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"9"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"6"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_Nomal
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
}
//
@Test
@Test
public
void
秒杀活动页面详情
_
马上兑换测试
()
{
Response
response
=
seckillService
.
ajaxInitPage
(
"24830"
,
uid_Nomal
,
true
);
...
...
@@ -186,12 +198,15 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"6"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"3"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_Nomal
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
}
...
...
@@ -203,12 +218,14 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"7"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"4"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_Nomal
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"胡梦新"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18258853242"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
}
...
...
@@ -220,12 +237,14 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"2"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"2"
,
"校验秒杀活动状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
),
"钱雯君"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
),
"18243476362"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\","
,
1
));
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_LackIntgral
);
addResponse
.
prettyPrint
();
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
),
"钱雯君"
,
"校验秒杀活动addrName失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
),
"18243476362"
,
"校验秒杀活动addrPhone失败"
);
logger
.
info
(
"校验收货人信息成功:收货人addrName="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\","
,
1
)+
"收货人电话addrPhone="
+
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\","
,
1
));
Response
response1
=
seckillService
.
ajaxInitPage
(
"24796"
,
uid_Nomal
,
true
);
}
...
...
@@ -249,12 +268,15 @@ public class 天天秒杀_秒杀详情测试 extends DuibaTestBase {
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"success\":(.*?),"
,
1
),
"true"
,
"校验详情查询结果失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
),
"5"
,
"校验按钮状态失败"
);
Assert
.
assertEquals
(
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
),
"2"
,
"校验秒杀活动状态失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrArea\":\"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrCity\":\"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrDetail\":\"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrName\":\"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrPhone\":\"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
response
.
asString
(),
"\"addrProvince\":\"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Response
addResponse
=
seckillService
.
getDefaultAddress
(
uid_NoAddress
);
addResponse
.
prettyPrint
();
Assert
.
assertTrue
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrArea\": \"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrCity\": \"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrDetail\": \"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrName\": \"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrPhone\": \"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
Assert
.
assertTrue
(
MatcherString
.
getString
(
addResponse
.
asString
(),
"\"addrProvince\": \"(.*?)\""
,
1
).
isEmpty
(),
"校验地址信息为空失败"
);
logger
.
info
(
"校验页面详情信息成功:按钮状态btnStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"btnStatus\":(.*?),"
,
1
)+
",活动状态activityStatus="
+
MatcherString
.
getString
(
response
.
asString
(),
"\"activityStatus\":(.*?),"
,
1
));
logger
.
info
(
"校验收货人和收货地址信息为空成功"
);
...
...
src/test/java/http/service/Activity/PkService.java
View file @
0d84e7dd
...
...
@@ -59,6 +59,25 @@ public class PkService {
}
public
Response
list
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/betRecord2/list"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"pageSize"
,
"6"
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
get
(
url
);
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
;
}
public
Response
getBetList
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/betActivity2/list"
;
...
...
src/test/java/http/service/app/SeckillService.java
View file @
0d84e7dd
...
...
@@ -25,6 +25,9 @@ public class SeckillService {
@Value
(
"${home.host}"
)
private
String
homeHost
;
@Value
(
"${activity.host}"
)
String
activityHost
;
@Autowired
Authorization
authorization
;
...
...
@@ -183,6 +186,15 @@ public class SeckillService {
}
public
Response
getDefaultAddress
(
Integer
uid
)
{
String
url
=
activityHost
+
"/gaw/address/getDefaultAddress"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// map.put("id",id);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
get
(
url
);
return
response
;
}
public
Boolean
checkNomal
(
String
api
,
Response
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