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
f807e02c
Commit
f807e02c
authored
Jul 11, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab2.dui88.com:mabo/test-platform
parents
eaa7a856
1c06e4e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
6 deletions
+163
-6
自有活动出奖_DuibaTest.java
src/test/java/http/cases/DeveloperTest/自有活动出奖_DuibaTest.java
+6
-6
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+1
-0
test.java
src/test/java/ui/cases/test.java
+156
-0
No files found.
src/test/java/http/cases/DeveloperTest/自有活动出奖_DuibaTest.java
View file @
f807e02c
...
...
@@ -33,7 +33,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public
void
出奖自有实物
()
throws
Exception
{
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"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
...
...
@@ -61,7 +61,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread
.
sleep
(
1000
);
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
,
"扣库存失败"
);
...
...
@@ -170,7 +170,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
public
void
出奖自有虚拟商品
()
throws
Exception
{
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"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
...
...
@@ -198,7 +198,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread
.
sleep
(
1000
);
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
,
"扣库存失败"
);
}
...
...
@@ -206,7 +206,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
@Test
public
void
出奖兑吧实物
()
throws
Exception
{
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"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
response
=
newActivityService
.
getOrderStatus2
(
orderId
);
...
...
@@ -233,7 +233,7 @@ public class 自有活动出奖_DuibaTest extends DuibaTestBase {
Thread
.
sleep
(
1000
);
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
,
"扣库存失败"
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
f807e02c
...
...
@@ -224,6 +224,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
map
.
put
(
"itemId"
,
"30319"
);
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
.
prettyPrint
();
...
...
src/test/java/ui/cases/test.java
View file @
f807e02c
...
...
@@ -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
;
}
}
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