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
9fd3d239
Commit
9fd3d239
authored
Jul 18, 2019
by
马博
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
1c8cea36
7d9b4b97
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
636 additions
and
69 deletions
+636
-69
Database.java
src/test/java/http/cases/ExchangeTest/Database.java
+6
-3
新Qb_兑换流程测试_ExchangeTest.java
...ases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
+83
-1
新多档位话费_兑换流程测试_ExchangeTest.java
...s/ExchangeTest/兑吧_直充类商品兑换/新多档位话费_兑换流程测试_ExchangeTest.java
+81
-0
新支付宝_兑换流程测试_ExchangeTest.java
...ses/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
+50
-0
兑吧卡密_兑换流程测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/兑吧卡密_兑换流程测试_ExchangeTest.java
+58
-0
兑吧新优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧新优惠券_兑换流程测试_ExchangeTest.java
+57
-0
兑吧新实物_兑换流程测试_ExchangeTest.java
...va/http/cases/ExchangeTest/兑吧新实物_兑换流程测试_ExchangeTest.java
+0
-0
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+1
-2
自有新优惠券_兑换限制测试_ExchangeTest.java
...es/ExchangeTest/自有_商品兑换限制/自有新优惠券_兑换限制测试_ExchangeTest.java
+54
-0
自有新卡密_兑换限制测试_ExchangeTest.java
...ses/ExchangeTest/自有_商品兑换限制/自有新卡密_兑换限制测试_ExchangeTest.java
+52
-0
自有新实物_兑换流程测试_ExchangeTest.java
...ses/ExchangeTest/自有_商品兑换限制/自有新实物_兑换流程测试_ExchangeTest.java
+0
-0
自有新虚拟商品_充值_兑换限制_ExchangeTest.java
.../ExchangeTest/自有_商品兑换限制/自有新虚拟商品_充值_兑换限制_ExchangeTest.java
+57
-0
秒杀商品_自有新优惠券_兑换限制_SeckillTest.java
...p/cases/SeckillTest/新秒杀/秒杀商品_自有新优惠券_兑换限制_SeckillTest.java
+2
-2
商品分组组件_DuibaTest.java
...st/java/http/cases/VisualEditorTest/商品分组组件_DuibaTest.java
+71
-1
gawService.java
src/test/java/http/service/app/gawService.java
+63
-60
RedisUtil.java
src/test/java/utils/RedisUtil.java
+1
-0
No files found.
src/test/java/http/cases/ExchangeTest/Database.java
View file @
9fd3d239
...
@@ -5,18 +5,21 @@ public class Database {
...
@@ -5,18 +5,21 @@ public class Database {
//主订单库
//主订单库
public
static
String
orders_consumer
=
"orders_consumer"
;
public
static
String
orders_consumer
=
"orders_consumer"
;
//主订单分表
//主订单分表
public
static
String
orders
=
"orders_0614"
;
public
static
String
orders2
=
"orders_0874"
;
public
static
String
orders2
=
"orders_0874"
;
public
static
String
orders3
=
"orders_0693"
;
public
static
String
orders3
=
"orders_0693"
;
public
static
String
orders4
=
"orders_0208"
;
public
static
String
orders5
=
"orders_0209"
;
public
static
String
orders5
=
"orders_0209"
;
public
static
String
orders6
=
"orders_0210"
;
public
static
String
orders6
=
"orders_0210"
;
public
static
String
orders7
=
"orders_0211"
;
public
static
String
orders8
=
"orders_0090"
;
public
static
String
orders8
=
"orders_0090"
;
public
static
String
orders9
=
"orders_0203"
;
public
static
String
orders9
=
"orders_0203"
;
public
static
String
orders10
=
"orders_0411"
;
public
static
String
orders10
=
"orders_0411"
;
public
static
String
orders11
=
"orders_0182"
;
public
static
String
orders11
=
"orders_0182"
;
public
static
String
orders12
=
"orders_0715"
;
public
static
String
orders12
=
"orders_0715"
;
public
static
String
orders13
=
"orders_0717"
;
public
static
String
orders14
=
"orders_0712"
;
public
static
String
orders15
=
"orders_0718"
;
public
static
String
orders16
=
"orders_0721"
;
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
package
http
.
cases
.
ExchangeTest
.
兑吧
_
直充类商品兑换
;
package
http
.
cases
.
ExchangeTest
.
兑吧
_
直充类商品兑换
;
import
http.cases.ExchangeTest.CheckTemplet
;
import
http.cases.ExchangeTest.CheckTemplet
;
import
http.cases.ExchangeTest.Database
;
import
http.service.Authorization
;
import
http.service.Authorization
;
import
http.service.app.gawService
;
import
http.service.app.gawService
;
import
http.service.app.MobileService
;
import
http.service.app.MobileService
;
...
@@ -146,6 +147,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -146,6 +147,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"3个Q币用户兑换限制每月1次"
)
@Test
(
description
=
"3个Q币用户兑换限制每月1次"
)
public
void
Q
币用户每月兑换限制测试
()
throws
Exception
{
public
void
Q
币用户每月兑换限制测试
()
throws
Exception
{
...
@@ -164,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -164,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger
.
info
(
"用户成功兑换一次"
);
logger
.
info
(
"用户成功兑换一次"
);
//再次兑换
//再次兑换
Thread
.
sleep
(
3
000
);
Thread
.
sleep
(
4
000
);
try
{
try
{
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
"123456789"
);
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
"123456789"
);
response
.
prettyPrint
();
response
.
prettyPrint
();
...
@@ -242,6 +244,86 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -242,6 +244,86 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"Q币档位篡改测试"
)
public
void
Q
币档位篡改测试
()
throws
Exception
{
int
uid
=
7293
;
String
actualCredits
=
"3"
;
String
degreeId
=
"100"
;
String
appItemId
=
"196922"
;
String
credits
=
"3"
;
String
qq
=
"806854056"
;
String
message
=
""
;
//Q币兑换,档位参数不存在
try
{
Response
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"档位不存在\""
),
"校验message失败"
);
logger
.
info
(
"校验Q币档位篡改无法兑换成功"
);
}
@Test
(
description
=
"Q币用户id篡改测试"
)
public
void
Q
币用户
id
篡改测试
()
throws
Exception
{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int
uid1
=
7084
;
int
uid2
=
7292
;
String
actualCredits
=
"3"
;
String
degreeId
=
"3"
;
String
appItemId
=
"196922"
;
String
credits
=
"3"
;
String
qq
=
"806854056"
;
String
message
=
""
;
//话费兑换, 大富翁app已上架Q币
Response
response
=
gawService
.
qbExchange
(
uid1
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
//查询数据库
Thread
.
sleep
(
3000
);
Map
<
String
,
Object
>
mapOrderId
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders16
+
" where id = "
+
orderId
);
String
orderStatus
=
String
.
valueOf
(
mapOrderId
.
get
(
"status"
));
String
orderappId
=
String
.
valueOf
(
mapOrderId
.
get
(
"app_id"
));
String
orderCredits
=
String
.
valueOf
(
mapOrderId
.
get
(
"credits"
));
logger
.
info
(
"订单积分:"
+
orderCredits
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderCredits
,
"300"
,
"校验credits失败"
);
logger
.
info
(
"校验Q币用户id1篡改兑换成功"
);
//Q币兑换,lv测试应用88app未上架Q币
try
{
Response
response2
=
gawService
.
qbExchange
(
uid2
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
response2
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"兑吧加钱购商品不可以加入到开发者商品中\""
),
"校验message失败"
);
//这个提示很奇怪
logger
.
info
(
"校验Q币用户id2篡改无法兑换成功"
);
}
public
Response
Q
币兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
,
String
qq
)
throws
Exception
{
public
Response
Q
币兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
,
String
qq
)
throws
Exception
{
Response
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
Response
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新多档位话费_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
package
http
.
cases
.
ExchangeTest
.
兑吧
_
直充类商品兑换
;
package
http
.
cases
.
ExchangeTest
.
兑吧
_
直充类商品兑换
;
import
http.cases.ExchangeTest.CheckTemplet
;
import
http.cases.ExchangeTest.CheckTemplet
;
import
http.cases.ExchangeTest.Database
;
import
http.service.Authorization
;
import
http.service.Authorization
;
import
http.service.app.gawService
;
import
http.service.app.gawService
;
import
http.service.app.MobileService
;
import
http.service.app.MobileService
;
...
@@ -240,6 +241,86 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -240,6 +241,86 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
}
@Test
(
description
=
"话费档位篡改测试"
)
public
void
话费档位篡改测试
()
throws
Exception
{
int
uid
=
7268
;
String
actualCredits
=
"2"
;
String
degreeId
=
"100"
;
String
appItemId
=
"196923"
;
String
credits
=
"2"
;
String
message
=
""
;
//话费兑换,档位参数不存在
try
{
Thread
.
sleep
(
3000
);
Response
response
=
gawService
.
phonebillExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"档位不存在\""
),
"校验message失败"
);
logger
.
info
(
"校验话费档位篡改无法兑换成功"
);
}
@Test
(
description
=
"话费用户id篡改测试"
)
public
void
话费用户
id
篡改测试
()
throws
Exception
{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int
uid1
=
7085
;
int
uid2
=
7292
;
String
actualCredits
=
"5"
;
String
degreeId
=
"10"
;
String
appItemId
=
"196923"
;
String
credits
=
"5"
;
String
message
=
""
;
//话费兑换, 大富翁app已上架话费
Response
response
=
gawService
.
phonebillExchange
(
uid1
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
//查询数据库
Thread
.
sleep
(
3000
);
Map
<
String
,
Object
>
mapOrderId
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders15
+
" where id = "
+
orderId
);
String
orderStatus
=
String
.
valueOf
(
mapOrderId
.
get
(
"status"
));
String
orderappId
=
String
.
valueOf
(
mapOrderId
.
get
(
"app_id"
));
String
orderCredits
=
String
.
valueOf
(
mapOrderId
.
get
(
"credits"
));
logger
.
info
(
"订单积分:"
+
orderCredits
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderCredits
,
"1000"
,
"校验credits失败"
);
logger
.
info
(
"校验话费用户id1篡改兑换成功"
);
//话费兑换,lv测试应用88app未上架话费
try
{
Response
response2
=
gawService
.
phonebillExchange
(
uid2
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response2
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
logger
.
info
(
"校验话费用户id2篡改无法兑换成功"
);
}
public
Response
话费兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
)
throws
Exception
{
public
Response
话费兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
)
throws
Exception
{
Response
response
=
gawService
.
phonebillExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
Response
response
=
gawService
.
phonebillExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
...
@@ -302,6 +302,56 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -302,6 +302,56 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"支付宝用户id修改测试"
)
public
void
支付宝用户
id
篡改测试
()
throws
Exception
{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int
uid1
=
7204
;
int
uid2
=
7291
;
String
actualCredits
=
"10"
;
String
degreeId
=
"10"
;
String
appItemId
=
"196921"
;
String
credits
=
"10"
;
String
message
=
""
;
//支付宝兑换, 大富翁app已上架支付宝
Response
response
=
gawService
.
alipayExchange
(
uid1
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
//查询数据库
Thread
.
sleep
(
3000
);
Map
<
String
,
Object
>
mapOrderId
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders13
+
" where id = "
+
orderId
);
String
orderStatus
=
String
.
valueOf
(
mapOrderId
.
get
(
"status"
));
String
orderappId
=
String
.
valueOf
(
mapOrderId
.
get
(
"app_id"
));
String
orderCredits
=
String
.
valueOf
(
mapOrderId
.
get
(
"credits"
));
logger
.
info
(
"订单积分:"
+
orderCredits
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderCredits
,
"1000"
,
"校验credits失败"
);
logger
.
info
(
"校验支付宝用户id1篡改兑换成功"
);
//支付宝兑换,lv测试应用88app未上架支付宝
try
{
Response
response2
=
gawService
.
alipayExchange
(
uid2
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response2
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商家未采购商品\""
),
"校验message失败"
);
logger
.
info
(
"校验支付宝用户id2篡改无法兑换成功"
);
}
...
...
src/test/java/http/cases/ExchangeTest/兑吧卡密_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
...
@@ -506,6 +506,64 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -506,6 +506,64 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"兑吧卡密用户id篡改测试"
)
public
void
卡密用户
id
篡改测试
()
throws
Exception
{
//uid: 大富翁app
//商品: lv测试应用55
int
uid
=
11
;
String
appItemId
=
"197045"
;
String
itemId
=
"32657"
;
String
skuId
=
"173"
;
String
message
=
""
;
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//卡密兑换
try
{
Response
response
=
gawService
.
couponExchange
(
cookies
,
appItemId
,
itemId
,
skuId
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验卡密用户id篡改无法兑换成功"
);
}
@Test
(
description
=
"兑吧卡密skuId篡改测试"
)
public
void
卡密
skuId
篡改测试
()
throws
Exception
{
String
appItemId
=
"197045"
;
String
itemId
=
"32657"
;
String
skuId
=
"106"
;
String
message
=
""
;
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//优惠券兑换,skuId改为其它商品的
try
{
Response
response
=
gawService
.
couponExchange
(
cookies
,
appItemId
,
itemId
,
skuId
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商品不存在\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验卡密skuId篡改无法兑换成功"
);
}
}
}
src/test/java/http/cases/ExchangeTest/兑吧新优惠券_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
...
@@ -498,5 +498,62 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -498,5 +498,62 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
@Test
(
description
=
"新优惠券用户id篡改测试"
)
public
void
优惠券用户
id
篡改测试
()
throws
Exception
{
//uid: 大富翁app
//商品: lv测试应用55
int
uid
=
10
;
String
appItemId
=
"197044"
;
String
itemId
=
"32656"
;
String
message
=
""
;
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//优惠券兑换
try
{
Response
response
=
gawService
.
couponExchange
(
cookies
,
appItemId
,
itemId
,
"172"
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验优惠券用户id篡改无法兑换成功"
);
}
@Test
(
description
=
"新优惠券skuId篡改测试"
)
public
void
优惠券
skuId
篡改测试
()
throws
Exception
{
int
uid
=
7289
;
String
appItemId
=
"197044"
;
String
itemId
=
"32656"
;
String
message
=
""
;
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//优惠券兑换,skuId改为其它商品的
try
{
Response
response
=
gawService
.
couponExchange
(
cookies
,
appItemId
,
itemId
,
"105"
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商品不存在\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验优惠券skuId篡改无法兑换成功"
);
}
}
}
src/test/java/http/cases/ExchangeTest/兑吧新实物_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
...
@@ -218,7 +218,6 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -218,7 +218,6 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
this
.
优惠券兑换
(
"174928"
,
"30319"
,
uid
);
this
.
优惠券兑换
(
"174928"
,
"30319"
,
uid
);
//每日限额用完,无法再次兑换
//每日限额用完,无法再次兑换
Thread
.
sleep
(
3000
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appItemId"
,
"174928"
);
map
.
put
(
"appItemId"
,
"174928"
);
map
.
put
(
"itemId"
,
"30319"
);
map
.
put
(
"itemId"
,
"30319"
);
...
@@ -230,7 +229,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -230,7 +229,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
//获取按钮状态
//获取按钮状态
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"30319"
);
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"30319"
);
detailResponse
.
prettyPrint
();
//
detailResponse.prettyPrint();
String
exchangeText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"exchangeText\":\"(.*?)\","
,
1
);
String
exchangeText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"exchangeText\":\"(.*?)\","
,
1
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"今日已兑完,明天再来哦(14)"
,
"校验message失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"今日已兑完,明天再来哦(14)"
,
"校验message失败"
);
...
...
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新优惠券_兑换限制测试_ExchangeTest.java
View file @
9fd3d239
...
@@ -576,5 +576,59 @@ public class 自有新优惠券_兑换限制测试_ExchangeTest extends CheckTem
...
@@ -576,5 +576,59 @@ public class 自有新优惠券_兑换限制测试_ExchangeTest extends CheckTem
@Test
(
description
=
"新优惠券用户id篡改测试"
)
public
void
优惠券用户
id
篡改测试
()
throws
Exception
{
//uid: 大富翁app
//商品: lv测试应用55
int
uid
=
6999
;
String
appItemId
=
"197048"
;
String
message
=
""
;
//优惠券兑换
try
{
Response
response
=
gawService
.
couponExchange
(
uid
,
appItemId
,
175
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验优惠券用户id篡改无法兑换成功"
);
}
@Test
(
description
=
"新优惠券skuId篡改测试"
)
public
void
优惠券
skuId
篡改测试
()
throws
Exception
{
int
uid
=
7028
;
String
appItemId
=
"197048"
;
String
message
=
""
;
//优惠券兑换,skuId改为其它商品的
try
{
Response
response
=
gawService
.
couponExchange
(
uid
,
appItemId
,
105
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商品不存在\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验优惠券skuId篡改无法兑换成功"
);
}
}
}
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新卡密_兑换限制测试_ExchangeTest.java
View file @
9fd3d239
...
@@ -480,6 +480,58 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
...
@@ -480,6 +480,58 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
@Test
(
description
=
"卡密用户id篡改测试"
)
public
void
卡密用户
id
篡改测试
()
throws
Exception
{
//uid: 大富翁app
//商品: lv测试应用55
int
uid
=
6997
;
String
appItemId
=
"197049"
;
String
message
=
""
;
//卡密兑换
try
{
Response
response
=
gawService
.
couponExchange
(
uid
,
appItemId
,
176
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验卡密用户id篡改无法兑换成功"
);
}
@Test
(
description
=
"卡密skuId篡改测试"
)
public
void
卡密
skuId
篡改测试
()
throws
Exception
{
int
uid
=
7294
;
String
appItemId
=
"197049"
;
String
message
=
""
;
//优惠券兑换,skuId改为其它商品的
try
{
Response
response
=
gawService
.
couponExchange
(
uid
,
appItemId
,
105
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商品不存在\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验卡密skuId篡改无法兑换成功"
);
}
}
}
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新实物_兑换流程测试_ExchangeTest.java
View file @
9fd3d239
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新虚拟商品_充值_兑换限制_ExchangeTest.java
View file @
9fd3d239
...
@@ -443,4 +443,61 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec
...
@@ -443,4 +443,61 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec
}
}
@Test
(
description
=
"新虚拟商品用户id篡改测试"
)
public
void
虚拟商品用户
id
篡改测试
()
throws
Exception
{
//uid: 大富翁app
//商品: lv测试应用55
int
uid
=
6970
;
String
appItemId
=
"197050"
;
String
message
=
""
;
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//虚拟商品兑换
try
{
Response
response
=
gawService
.
virtualExchange
(
cookies
,
appItemId
,
177
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验虚拟商品用户id篡改无法兑换成功"
);
}
@Test
(
description
=
"新虚拟商品skuId篡改测试"
)
public
void
虚拟商品
skuId
篡改测试
()
throws
Exception
{
int
uid
=
7295
;
String
appItemId
=
"197050"
;
String
message
=
""
;
Map
cookies
=
authorization
.
dafuwengLogin
(
uid
);
//优惠券兑换,skuId改为其它商品的
try
{
Response
response
=
gawService
.
virtualExchange
(
cookies
,
appItemId
,
105
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商品不存在\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
logger
.
info
(
"校验虚拟商品skuId篡改无法兑换成功"
);
}
}
}
src/test/java/http/cases/SeckillTest/新秒杀/秒杀商品_自有新优惠券_兑换限制_SeckillTest.java
View file @
9fd3d239
...
@@ -201,7 +201,7 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
...
@@ -201,7 +201,7 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
@Test
(
description
=
"优惠券--活动未开始"
)
@Test
(
description
=
"优惠券--活动未开始"
)
public
void
优惠券活动未开始
()
throws
Exception
{
public
void
优惠券活动未开始
()
throws
Exception
{
String
appItemId
=
"19554
2
"
;
String
appItemId
=
"19554
1
"
;
String
itemId
=
null
;
String
itemId
=
null
;
String
message
=
""
;
String
message
=
""
;
String
actId
=
"29"
;
String
actId
=
"29"
;
...
@@ -240,7 +240,7 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
...
@@ -240,7 +240,7 @@ public class 秒杀商品_自有新优惠券_兑换限制_SeckillTest extends Du
@Test
(
description
=
"优惠券--活动已结束"
)
@Test
(
description
=
"优惠券--活动已结束"
)
public
void
优惠券活动已结束
()
throws
Exception
{
public
void
优惠券活动已结束
()
throws
Exception
{
String
appItemId
=
"19554
3
"
;
String
appItemId
=
"19554
2
"
;
String
itemId
=
null
;
String
itemId
=
null
;
String
message
=
""
;
String
message
=
""
;
String
actId
=
"30"
;
String
actId
=
"30"
;
...
...
src/test/java/http/cases/VisualEditorTest/商品分组组件_DuibaTest.java
View file @
9fd3d239
...
@@ -53,6 +53,13 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
...
@@ -53,6 +53,13 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
new
Object
[]{
2
,
"2104"
,
"商品分组-自有新商品"
},
//case2
new
Object
[]{
2
,
"2104"
,
"商品分组-自有新商品"
},
//case2
};
};
}
}
if
(
method
.
getName
().
equals
(
"手机端商品分组组件老商品展示"
)){
result
=
new
Object
[][]{
new
Object
[]{
1
,
"2124"
,
"商品分组-兑吧老商品"
},
//case1
new
Object
[]{
2
,
"2125"
,
"商品分组-自有老商品"
},
//case2
};
}
return
result
;
return
result
;
}
}
...
@@ -177,7 +184,7 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
...
@@ -177,7 +184,7 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
/**
/**
* @param caseNum 用例编号
* @param caseNum 用例编号
* @param classifyId 商品分组Id
* @param classifyId 商品分组Id
* @param caseName 用例名称打印
* @param caseName 用例名称打印
...
@@ -239,5 +246,68 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
...
@@ -239,5 +246,68 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
/**
* @param caseNum 用例编号
* @param classifyId 商品分组Id
* @param caseName 用例名称打印
* @throws Exception
*/
@Test
(
dataProvider
=
"providerMethod"
)
public
void
手机端商品分组组件老商品展示
(
int
caseNum
,
String
classifyId
,
String
caseName
)
throws
Exception
{
logger
.
info
(
"---"
+
caseName
+
"---"
);
//app:lv测试应用33
Map
cookies
=
authorization
.
dafuwengLogin
(
6569
);
Response
response
=
chwVisualEditorService
.
itemsList
(
cookies
,
classifyId
);
response
.
prettyPrint
();
switch
(
caseNum
){
case
1
:
//手机端接口排序与前端不一致
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
),
"【自动化勿动】兑吧新优惠券普通券码跳转"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].titleDownTxt"
),
"100积分"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].title"
),
"【自动化勿动】兑吧卡密跳转按钮"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].titleDownTxt"
),
"200积分"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].title"
),
"【自动化勿动】兑吧新实物"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].titleDownTxt"
),
"300积分"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].title"
),
"支付宝充值"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].titleDownTxt"
),
"10万积分"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[4].title"
),
"10元话费"
,
"校验第五个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[4].titleDownTxt"
),
"1000积分"
,
"校验第五个商品credits失败"
);
logger
.
info
(
"校验商品分组1-兑吧新商品成功"
);
break
;
case
2
:
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
),
"【自动化勿动】自有新优惠券跳转链接"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].titleDownTxt"
),
"100积分"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].title"
),
"【自动化勿动】自有新实物加钱购"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].titleDownTxt"
),
"150积分 + 10.00元"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].title"
),
"【自动化勿动】自有充值商品"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].titleDownTxt"
),
"300积分"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].title"
),
"【自动化勿动】自有卡密"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].titleDownTxt"
),
"550积分"
,
"校验第四个商品credits失败"
);
logger
.
info
(
"校验商品分组2-自有新商品成功"
);
break
;
}
}
}
}
src/test/java/http/service/app/gawService.java
View file @
9fd3d239
This diff is collapsed.
Click to expand it.
src/test/java/utils/RedisUtil.java
View file @
9fd3d239
...
@@ -60,6 +60,7 @@ public class RedisUtil {
...
@@ -60,6 +60,7 @@ public class RedisUtil {
map
.
put
(
"key"
,
key
);
map
.
put
(
"key"
,
key
);
Response
response
=
given
().
params
(
map
).
get
(
"http://activity.m.duibatest.com.cn/seedRedPacket/clearObjectKey"
);
Response
response
=
given
().
params
(
map
).
get
(
"http://activity.m.duibatest.com.cn/seedRedPacket/clearObjectKey"
);
response
.
prettyPrint
();
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
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