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
ffe2f9b7
Commit
ffe2f9b7
authored
Jul 11, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into duiba_wenyan
parents
b06c7094
ec8e59e9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
8 deletions
+165
-8
自有活动出奖_DuibaTest.java
src/test/java/http/cases/DeveloperTest/自有活动出奖_DuibaTest.java
+6
-6
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+2
-2
test.java
src/test/java/ui/cases/test.java
+156
-0
RedisUtil.java
src/test/java/utils/RedisUtil.java
+1
-0
No files found.
src/test/java/http/cases/DeveloperTest/自有活动出奖_DuibaTest.java
View file @
ffe2f9b7
...
@@ -33,7 +33,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
...
@@ -33,7 +33,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public
void
出奖自有实物
()
throws
Exception
{
public
void
出奖自有实物
()
throws
Exception
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900849714500524"
);
Map
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900849714500524"
);
int
remaining
=
(
int
)
map
.
get
(
"stock"
);
long
remaining
=
(
long
)
map
.
get
(
"stock"
);
Response
response
=
newActivityService
.
doJoin2
(
"21803"
,
"h5ps61"
);
Response
response
=
newActivityService
.
doJoin2
(
"21803"
,
"h5ps61"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
...
@@ -61,7 +61,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
...
@@ -61,7 +61,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900849714500524"
);
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900849714500524"
);
int
remainingNew
=
(
int
)
map
.
get
(
"stock"
);
long
remainingNew
=
(
long
)
map
.
get
(
"stock"
);
Assert
.
assertEquals
(
remaining
-
1
,
remainingNew
,
"扣库存失败"
);
Assert
.
assertEquals
(
remaining
-
1
,
remainingNew
,
"扣库存失败"
);
...
@@ -170,7 +170,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
...
@@ -170,7 +170,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public
void
出奖自有虚拟商品
()
throws
Exception
{
public
void
出奖自有虚拟商品
()
throws
Exception
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900860200070105"
);
Map
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900860200070105"
);
int
remaining
=
(
int
)
map
.
get
(
"stock"
);
long
remaining
=
(
long
)
map
.
get
(
"stock"
);
Response
response
=
newActivityService
.
doJoin2
(
"21793"
,
"h5ps61"
);
Response
response
=
newActivityService
.
doJoin2
(
"21793"
,
"h5ps61"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
...
@@ -198,7 +198,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
...
@@ -198,7 +198,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900860200070105"
);
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900860200070105"
);
int
remainingNew
=
(
int
)
map
.
get
(
"stock"
);
long
remainingNew
=
(
long
)
map
.
get
(
"stock"
);
Assert
.
assertEquals
(
remaining
-
1
,
remainingNew
,
"扣库存失败"
);
Assert
.
assertEquals
(
remaining
-
1
,
remainingNew
,
"扣库存失败"
);
}
}
...
@@ -206,7 +206,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
...
@@ -206,7 +206,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test
@Test
public
void
出奖兑吧实物
()
throws
Exception
{
public
void
出奖兑吧实物
()
throws
Exception
{
Map
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900440770170322 "
);
Map
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900440770170322 "
);
int
remaining
=
(
int
)
map
.
get
(
"stock"
);
long
remaining
=
(
long
)
map
.
get
(
"stock"
);
Response
response
=
newActivityService
.
doJoin2
(
"22637"
,
"h5ps61"
);
Response
response
=
newActivityService
.
doJoin2
(
"22637"
,
"h5ps61"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
...
@@ -233,7 +233,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
...
@@ -233,7 +233,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900440770170322 "
);
map
=
jdbc
.
findSimpleResult
(
"select * from stock.tb_stock where stock_id = 674900440770170322 "
);
int
remainingNew
=
(
int
)
map
.
get
(
"stock"
);
long
remainingNew
=
(
long
)
map
.
get
(
"stock"
);
Assert
.
assertEquals
(
remaining
-
1
,
remainingNew
,
"扣库存失败"
);
Assert
.
assertEquals
(
remaining
-
1
,
remainingNew
,
"扣库存失败"
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
ffe2f9b7
...
@@ -218,18 +218,18 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -218,18 +218,18 @@ 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"
);
map
.
put
(
"token"
,
"yrJRr7Cddp2YeQd"
);
map
.
put
(
"token"
,
"yrJRr7Cddp2YeQd"
);
Thread
.
sleep
(
4000
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
+
"/couponExchange/exchange"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
+
"/couponExchange/exchange"
);
response
.
prettyPrint
();
response
.
prettyPrint
();
//获取按钮状态
//获取按钮状态
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/ui/cases/test.java
View file @
ffe2f9b7
...
@@ -395,4 +395,160 @@ public class test extends DuibaBases {
...
@@ -395,4 +395,160 @@ public class test extends DuibaBases {
@Test
public
void
日历签到
(){
// Map<String,String> map = new HashMap<>();
// map.put("id","90");
//// map.put("signDate",getTime(0));
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(6));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/signactivity/doSign");
// response.prettyPrint();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
"90"
);
map
.
put
(
"signDate"
,
getTime
(
0
));
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
6
));
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
get
(
url
+
"/signactivity/reSign"
);
response
.
prettyPrint
();
}
@Test
public
void
契约签到
(){
// Map<String,String> map = new HashMap<>();
// map.put("activityId","149");
// map.put("betAmount","100");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(2));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/doJoin");
// response.prettyPrint();
// Map<String,String> map = new HashMap<>();
// map.put("activityId","149");
//
// String url = "http://activity.m.duibatest.com.cn";
//
// Map<String,String> header = new HashMap<>();
// header.put("User-Agent","windows mabo");
//
//
// Map<String,String> cookie = new HashMap<>(authorization.dafuwengLoginTest(2));
// Response response = given().headers(header).cookies(cookie).params(map).get(url+"/sign/contract/doSign");
// response.prettyPrint();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
"3123"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
5
));
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
get
(
url
+
"/sign/contract/getReward"
);
response
.
prettyPrint
();
}
@Test
public
void
宠物养成
(){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"activityId"
,
"18"
);
map
.
put
(
"petName"
,
"66"
);
String
url
=
"http://activity.m.duibatest.com.cn"
;
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"User-Agent"
,
"windows mabo"
);
Map
<
String
,
String
>
cookie
=
new
HashMap
<>(
authorization
.
dafuwengLoginTest
(
3580
));
Response
response
=
given
().
headers
(
header
).
cookies
(
cookie
).
params
(
map
).
post
(
url
+
"/signpet/adopte"
);
response
.
prettyPrint
();
}
// 获取时间方法
public
String
getTime
(
int
amount
){
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"EEE MMM d yyyy"
,
Locale
.
ENGLISH
);
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
amount
);
date
=
calendar
.
getTime
();
// System.out.println(dateFormat.format(date));
String
time
=
dateFormat
.
format
(
date
)+
" 08:00:00 GMT+0800 (CST)"
;
// System.out.println(time);
return
time
;
}
}
}
src/test/java/utils/RedisUtil.java
View file @
ffe2f9b7
...
@@ -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