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
2b57e8a1
Commit
2b57e8a1
authored
Dec 12, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'duiba_wenyan'
parents
da46efca
75037963
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
集卡活动领奖_AccessTest.java
src/test/java/http/cases/ClcardTest/集卡活动领奖_AccessTest.java
+19
-15
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+1
-0
No files found.
src/test/java/http/cases/ClcardTest/集卡活动领奖_AccessTest.java
View file @
2b57e8a1
...
...
@@ -3,6 +3,7 @@ package http.cases.ClcardTest;
import
base.DuibaTestBase
;
import
http.service.Activity.ClcardService
;
import
io.restassured.response.Response
;
import
org.apache.ibatis.jdbc.SQL
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterMethod
;
...
...
@@ -29,18 +30,13 @@ public class 集卡活动领奖_AccessTest extends DuibaTestBase {
@BeforeClass
public
void
before
(){
try
{
//修改表,增加用户卡片,"集卡领奖成功"
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0548 set item_count = item_count +1 , item_total_count = item_total_count +1 WHERE consumer_id = 100164132 AND item_id = 12"
);
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0548 set item_count = item_count +2 , item_total_count = item_total_count +2 WHERE consumer_id = 100164132 AND item_id = 13"
);
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0548 set item_count = item_count +3 , item_total_count = item_total_count +3 WHERE consumer_id = 100164132 AND item_id = 14"
);
try
{
//修改表,增加用户卡片,"A_集卡单用户并发领奖"
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0332 set item_count = item_count +1 , item_total_count = item_total_count +1 WHERE consumer_id = 100168012 AND item_id = 20"
);
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0332 set item_count = item_count +1 , item_total_count = item_total_count +1 WHERE consumer_id = 100168012 AND item_id = 21"
);
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -50,6 +46,13 @@ public class 集卡活动领奖_AccessTest extends DuibaTestBase {
@Test
(
description
=
"集卡活动领奖支付宝测试"
)
public
void
集卡领奖成功
()
throws
Exception
{
//修改表,增加用户卡片,"集卡领奖成功"
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0548 set item_count = item_count +1 , item_total_count = item_total_count +1 WHERE consumer_id = 100164132 AND item_id = 12"
);
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0548 set item_count = item_count +2 , item_total_count = item_total_count +2 WHERE consumer_id = 100164132 AND item_id = 13"
);
jdbc
.
update
(
"update collect_card_consumer.tb_collect_card_info_0548 set item_count = item_count +3 , item_total_count = item_total_count +3 WHERE consumer_id = 100164132 AND item_id = 14"
);
Thread
.
sleep
(
1000
);
int
uid
=
7402
;
String
activityId
=
"45501"
;
...
...
@@ -81,9 +84,9 @@ public class 集卡活动领奖_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"lottery.title"
),
"支付宝"
,
"校验奖品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"result"
),
"2"
,
"校验result失败"
);
Assert
.
assertEquals
(
cards0
,
"
1
"
,
"校验card0失败"
);
Assert
.
assertEquals
(
cards0
,
"
0
"
,
"校验card0失败"
);
Assert
.
assertEquals
(
cards1
,
"2"
,
"校验card1失败"
);
Assert
.
assertEquals
(
cards2
,
"
4
"
,
"校验card2失败"
);
Assert
.
assertEquals
(
cards2
,
"
1
"
,
"校验card2失败"
);
Assert
.
assertEquals
(
rules0
,
"1"
,
"校验rules0失败"
);
Assert
.
assertEquals
(
rules1
,
"2"
,
"校验rules1失败"
);
Assert
.
assertEquals
(
rules2
,
"3"
,
"校验rules2失败"
);
...
...
@@ -141,10 +144,11 @@ public class 集卡活动领奖_AccessTest extends DuibaTestBase {
//同一用户并发领奖 活动:【自动化】集卡发奖3
@Test
(
threadPoolSize
=
5
,
invocationCount
=
5
)
public
void
A_
集卡单用户并发领奖
()
throws
Exception
{
int
uid
=
7416
;
String
activityId
=
"45531"
;
//领奖(只有一次
兑换
机会)
//领奖(只有一次机会)
Response
response
=
clcardService
.
openPrize2
(
uid
,
activityId
);
resultList
.
add
(
response
.
asString
());
logger
.
info
(
"请求返回结果:"
+
response
.
asString
());
...
...
@@ -155,18 +159,18 @@ public class 集卡活动领奖_AccessTest extends DuibaTestBase {
int
fail
=
0
;
int
success
=
0
;
for
(
String
s:
resultList
)
{
if
(
s
.
contains
(
"desc\":\"服务器开小差了,请稍后重试"
)){
fail
++;
}
else
if
(
s
.
contains
(
"\"desc\":\"OK\""
)){
if
(
s
.
contains
(
"\"desc\":\"OK\""
)){
success
++;
}
else
{
}
else
if
(
s
.
contains
(
"\"success\":false"
)){
fail
++;
}
else
{
System
.
out
.
println
(
s
);
}
}
//检验 成功的只有一个。错误提示有多种
Assert
.
assertEquals
(
fail
,
4
,
"校验fail数量失败"
);
Assert
.
assertEquals
(
success
,
1
,
"校验success数量失败"
);
logger
.
info
(
"校验集卡单用户并发成功"
);
logger
.
info
(
"校验集卡单用户并发
领奖
成功"
);
}
...
...
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
2b57e8a1
...
...
@@ -208,6 +208,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
@Test
public
void
优惠券预分配每日限额测试
()
throws
Exception
{
int
uid
=
7447
;
//获取当前的时间
Date
dNow
=
new
Date
();
SimpleDateFormat
ft
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
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