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
8ad86640
Commit
8ad86640
authored
Feb 24, 2020
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
da46efca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
2 deletions
+115
-2
自有新卡密_兑换限制测试_ExchangeTest.java
...ses/ExchangeTest/自有_商品兑换限制/自有新卡密_兑换限制测试_ExchangeTest.java
+1
-1
新秒杀_秒杀未开始_SeckillTest.java
...ava/http/cases/SeckillTest/新秒杀/新秒杀_秒杀未开始_SeckillTest.java
+44
-0
老秒杀_未开始_SeckillTest.java
...test/java/http/cases/SeckillTest/老秒杀_未开始_SeckillTest.java
+35
-0
SeckillNewService.java
src/test/java/http/service/app/SeckillNewService.java
+31
-0
duiba.properties
src/test/profiles/aliyun/duiba.properties
+4
-1
No files found.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新卡密_兑换限制测试_ExchangeTest.java
View file @
8ad86640
...
...
@@ -77,7 +77,7 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
if
(
method
.
getName
().
equals
(
"日期兑换限制测试"
))
{
result
=
new
Object
[][]{
new
Object
[]{
1
,
"194628"
,
87
,
"实物日期兑换限制未开始测试"
},
//case1
new
Object
[]{
2
,
"19
4629"
,
88
,
"实物日期兑换限制进行中测试"
},
//case2
new
Object
[]{
2
,
"19
9855"
,
291
,
"实物日期兑换限制进行中测试"
},
//case2 199855 194629
new
Object
[]{
3
,
"194630"
,
89
,
"实物日期兑换限制已结束"
},
//case3
};
}
...
...
src/test/java/http/cases/SeckillTest/新秒杀/新秒杀_秒杀未开始_SeckillTest.java
0 → 100644
View file @
8ad86640
package
http
.
cases
.
SeckillTest
.
新秒杀
;
import
base.DuibaTestBase
;
import
http.service.Authorization
;
import
http.service.app.MobileService
;
import
http.service.app.SeckillNewService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
/**
* Created by mabo on 2019/12/12
*/
public
class
新秒杀
_
秒杀未开始
_SeckillTest
extends
DuibaTestBase
{
@Autowired
SeckillNewService
seckillNewService
;
@Autowired
MobileService
mobileService
;
@Autowired
Authorization
authorization
;
//指定用户
private
static
int
uid
=
7449
;
@Test
public
void
秒杀未开始
()
throws
Exception
{
String
appItemId
=
"199278"
;
String
itemId
=
null
;
String
skuId
=
"220"
;
String
message
=
""
;
String
actId
=
"43"
;
String
pageId
=
"63"
;
//秒杀
Response
response
=
seckillNewService
.
exchanges
(
itemId
,
appItemId
,
uid
,
skuId
,
actId
);
response
.
prettyPrint
();
Assert
.
assertTrue
(
response
.
jsonPath
().
getString
(
"msg"
).
equals
(
"活动已结束"
),
"校验失败"
);
}
}
src/test/java/http/cases/SeckillTest/老秒杀_未开始_SeckillTest.java
0 → 100644
View file @
8ad86640
package
http
.
cases
.
SeckillTest
;
import
base.DuibaTestBase
;
import
http.service.Authorization
;
import
http.service.app.SeckillService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
/**
* Created by mabo on 2019/12/12
*/
public
class
老秒杀
_
未开始
_SeckillTest
extends
DuibaTestBase
{
@Autowired
SeckillService
seckillService
;
@Autowired
Authorization
authorization
;
public
static
int
uid
=
7448
;
@Test
public
void
老秒杀实物未开始
()
throws
InterruptedException
{
Response
response
=
seckillService
.
exchange2
(
"199408"
,
"undefined"
,
uid
);
response
.
prettyPrint
();
String
queueId
=
response
.
jsonPath
().
getString
(
"data.queueId"
);
Thread
.
sleep
(
5000
);
Response
queryResponse
=
seckillService
.
queueQuery
(
queueId
,
uid
);
queryResponse
.
prettyPrint
();
Boolean
result
=
queryResponse
.
asString
().
contains
(
"好可惜,没抢到"
);
Assert
.
assertTrue
(
result
,
"秒杀结果校验失败"
);
}
}
src/test/java/http/service/app/SeckillNewService.java
View file @
8ad86640
...
...
@@ -36,6 +36,37 @@ public class SeckillNewService {
//实物秒杀下单接口
public
Response
exchange
(
String
itemId
,
String
appItemId
,
Integer
uid
,
String
skuId
,
String
actId
)
throws
Exception
{
String
url
=
activityHost
+
"/seckwc/exchange"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapList
=
new
HashMap
<>();
List
<
Map
>
list
=
new
ArrayList
<>();
mapList
.
put
(
"itemId"
,
itemId
);
mapList
.
put
(
"skuId"
,
skuId
);
mapList
.
put
(
"appItemId"
,
appItemId
);
mapList
.
put
(
"credits"
,
"1"
);
mapList
.
put
(
"price"
,
0
);
list
.
add
(
mapList
);
map
.
put
(
"remark"
,
""
);
map
.
put
(
"degreeId"
,
""
);
map
.
put
(
"actualPrice"
,
"0"
);
map
.
put
(
"actualCredits"
,
"1"
);
map
.
put
(
"itemParam"
,
list
.
toArray
());
map
.
put
(
"payType"
,
"3"
);
map
.
put
(
"expressPrice"
,
"0"
);
map
.
put
(
"actId"
,
actId
);
map
.
put
(
"validate"
,
"Y6f1ebInCWb.uJg8Sh_F.p7EUq4SG_Spr8ibD.2TTrytcOBpASsIHf6P9zNbkQxRq7vVDPkZw0vaRMpcxkbCx0n1ZKJZQgtFaKfbI0S2X7fws.jz8IjFUIM2l56YTh_g5xCso65S6ivQM0-54iEzTkSC01MIM5ZPoBdKiE9hVyooLa9OIM9oXOi-EtNx.IyxZyOBBqdCiYFieZe_ewBvWHlZ7SfInfFIaS8ulQMqybaSptmqYH9CyIa5nclj5C849IluQPnJH-0qpse7RL729VEtzZrS9KvoXmjCyTc4uq9IMozueqJG9PclV0gB1r8adms7Ef-QVEVSsnVu9xlY2YBAzPvBM9snEb447snvAgAi51CyL1SanGUCVDtmfe7GmronomRkWDvzknJFGm9vHNCWJGuZsJyYYPmlQ8NTrrsMdzwLcUs716uUm7RR1HM4_n9xC_PrGImrMFwnnV1MLlr_UEjITFq1A5_lHigcU7xyK-vE8hdtYDEV57X3"
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
Response
response
=
given
().
contentType
(
"application/json; charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
body
(
jsonParam
).
post
(
url
);
// response.prettyPrint();
return
response
;
}
//实物秒杀下单接口
public
Response
exchanges
(
String
itemId
,
String
appItemId
,
Integer
uid
,
String
skuId
,
String
actId
)
throws
Exception
{
String
url
=
activityHost
+
"/seckw/v2/exchange"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapList
=
new
HashMap
<>();
...
...
src/test/profiles/aliyun/duiba.properties
View file @
8ad86640
...
...
@@ -26,7 +26,10 @@ db.name = FjrtzzH
db.password
=
2Fe36uDap8TMqtfzob3f1u8r2aK8qjdnwPP
//
db.url
=
jdbc:mysql://47.97.127.67:13001/?tinyInt1isBit=false
db.url
=
jdbc:mysql://autotest-config.duibatest.com.cn:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
#db.url = jdbc:mysql://autotest-config.duibatest.com.cn:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.url
=
jdbc:mysql://auto.testdb2.duibar.com:3306/?tinyInt1isBit=false&connectTimeout=10000&socketTimeout=10000
db.driver
=
com.mysql.cj.jdbc.Driver
db.maxtotal
=
6
...
...
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