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
d8e4aef3
Commit
d8e4aef3
authored
Dec 24, 2018
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zr' into develop
parents
95ed0a4e
1ee13797
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
180 additions
and
22 deletions
+180
-22
ActiveGroup_FloorTest.java
...test/java/http/cases/FloorTest/ActiveGroup_FloorTest.java
+2
-2
Banner_FloorTest.java
src/test/java/http/cases/FloorTest/Banner_FloorTest.java
+2
-2
Coupon_FloorTest.java
src/test/java/http/cases/FloorTest/Coupon_FloorTest.java
+2
-2
Game_FloorTest.java
src/test/java/http/cases/FloorTest/Game_FloorTest.java
+2
-2
Icon_FloorTest.java
src/test/java/http/cases/FloorTest/Icon_FloorTest.java
+4
-4
Item_FloorTest.java
src/test/java/http/cases/FloorTest/Item_FloorTest.java
+2
-2
Seckill_FloorTest.java
src/test/java/http/cases/FloorTest/Seckill_FloorTest.java
+2
-2
Showcase_FloorTest.java
src/test/java/http/cases/FloorTest/Showcase_FloorTest.java
+2
-2
Sign_FloorTest.java
src/test/java/http/cases/FloorTest/Sign_FloorTest.java
+2
-2
补给站_活动_DuibaTest.java
...t/java/http/cases/SaasDeveloperTest/补给站_活动_DuibaTest.java
+13
-0
购物车测试.java
src/test/java/http/cases/SaasDeveloperTest/购物车测试.java
+56
-0
Authorization.java
src/test/java/http/service/Authorization.java
+2
-2
MallService.java
src/test/java/http/service/Saas/MallService.java
+89
-0
No files found.
src/test/java/http/cases/FloorTest/ActiveGroup_FloorTest.java
View file @
d8e4aef3
...
...
@@ -387,7 +387,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_创建活动楼层皮肤"
})
@Test
public
void
B_
手机端活动
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -444,7 +444,7 @@ public class ActiveGroup_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_手机端活动"
})
@Test
public
void
C_
删除活动楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
src/test/java/http/cases/FloorTest/Banner_FloorTest.java
View file @
d8e4aef3
...
...
@@ -154,7 +154,7 @@ public class Banner_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_创建banner楼层皮肤"
})
@Test
public
void
B_banner
楼层活动校验
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
@@ -212,7 +212,7 @@ public class Banner_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_banner楼层活动校验"
})
@Test
public
void
C_banner
商品校验
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
src/test/java/http/cases/FloorTest/Coupon_FloorTest.java
View file @
d8e4aef3
...
...
@@ -342,7 +342,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_创建优惠券楼层皮肤"
})
@Test
public
void
B_
优惠券手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -392,7 +392,7 @@ public class Coupon_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_优惠券手机端"
})
@Test
public
void
C_
删除优惠券楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Game_FloorTest.java
View file @
d8e4aef3
...
...
@@ -230,7 +230,7 @@ public class Game_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_创建游戏楼层皮肤"
})
@Test
public
void
B_
游戏手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -272,7 +272,7 @@ public class Game_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_游戏手机端"
})
@Test
public
void
C_
删除游戏楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Icon_FloorTest.java
View file @
d8e4aef3
...
...
@@ -222,7 +222,7 @@ public class Icon_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_创建icon楼层皮肤"
})
@Test
public
void
B_icon
添加图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
@@ -296,7 +296,7 @@ public class Icon_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_icon添加图标"
})
@Test
public
void
C_icon
编辑图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -352,7 +352,7 @@ public class Icon_FloorTest extends DuibaTestBase {
Assert
.
assertEquals
(
map
.
get
(
"logo"
),
"//yun.dui88.com/images/201806/9lz5ifre0h.png"
,
"今日必抢logo校验错误"
);
}
@Test
(
dependsOnMethods
=
{
"C_icon编辑图标"
})
@Test
public
void
D_icon
删除图标
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -388,7 +388,7 @@ public class Icon_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"D_icon删除图标"
})
@Test
public
void
E_
删除
icon
楼层皮肤
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
src/test/java/http/cases/FloorTest/Item_FloorTest.java
View file @
d8e4aef3
...
...
@@ -362,7 +362,7 @@ public class Item_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_item创建楼层皮肤"
})
@Test
public
void
B_item
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
@@ -404,7 +404,7 @@ public class Item_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_item手机端"
})
@Test
public
void
C_item
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Seckill_FloorTest.java
View file @
d8e4aef3
...
...
@@ -806,7 +806,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
response
=
floorService
.
switchOpenState
(
authorization
.
ssoLogin
(),
skinId
,
"true"
);
}
@Test
(
dependsOnMethods
=
{
"A_Seckill创建楼层皮肤"
})
@Test
public
void
B_Seckill
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -849,7 +849,7 @@ public class Seckill_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_Seckill手机端"
})
@Test
public
void
C_Seckill
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Showcase_FloorTest.java
View file @
d8e4aef3
...
...
@@ -244,7 +244,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_Showcase创建楼层皮肤"
})
@Test
public
void
B_Showcase
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
...
...
@@ -289,7 +289,7 @@ public class Showcase_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_Showcase手机端"
})
@Test
public
void
C_Showcase
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/FloorTest/Sign_FloorTest.java
View file @
d8e4aef3
...
...
@@ -510,7 +510,7 @@ public class Sign_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"A_sign创建楼层皮肤"
})
@Test
public
void
B_sign
手机端
()
throws
Exception
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
);
//设置日期格式
logger
.
info
(
df
.
format
(
new
Date
()));
...
...
@@ -545,7 +545,7 @@ public class Sign_FloorTest extends DuibaTestBase {
}
@Test
(
dependsOnMethods
=
{
"B_sign手机端"
})
@Test
public
void
C_sign
删除楼层皮肤
()
throws
Exception
{
...
...
src/test/java/http/cases/SaasDeveloperTest/补给站_活动_DuibaTest.java
View file @
d8e4aef3
...
...
@@ -28,6 +28,19 @@ public class 补给站_活动_DuibaTest extends AbstractTestNGSpringContextTests
//添加活动
@Test
(
description
=
"//添加活动"
)
public
void
a_
添加活动
()
throws
Exception
{
//查询订单列表
Response
orderResponse
=
developerBJZ
.
selectOrders
(
"1"
,
appId
);
String
id
=
orderResponse
.
jsonPath
().
getString
(
"data.list"
);
logger
.
info
(
"待付款订单id为:"
+
id
);
if
(
id
.
equals
(
"[]"
)){
logger
.
info
(
"订购列表无待付款订单"
);
}
else
{
id
=
orderResponse
.
jsonPath
().
getString
(
"data.list[0].id"
);
logger
.
info
(
"待付款订单id为:"
+
id
);
developerBJZ
.
cancleOrder
(
id
,
appId
);
logger
.
info
(
"待付款订单取消成功"
);
}
//查询热门活动-活动列表,获取商品ID
Response
response
=
developerBJZ
.
saasActivitys
(
"3"
,
appId
);
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[0].id"
));
...
...
src/test/java/http/cases/SaasDeveloperTest/购物车测试.java
0 → 100644
View file @
d8e4aef3
/**
* Copyright (C), 2015-2018
* FileName: 购物车测试
* Author: zhaoran
* Date: 2018/12/10 19:45
* Description:
*/
package
http
.
cases
.
SaasDeveloperTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.Activity.PkService
;
import
http.service.Authorization
;
import
http.service.Saas.MallService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.testng.Assert
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
public
class
购物车测试
extends
DuibaTestBase
{
@Value
(
"${activity.host}"
)
String
activityHost
;
@Autowired
MallService
mallService
;
@Autowired
Authorization
authorization
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
static
Integer
uid
=
5415
;
@Test
public
void
加入购物车
()
throws
Exception
{
//获取当前购物车数量
Response
response
=
mallService
.
getMallCount
(
uid
);
response
.
prettyPrint
();
logger
.
info
(
"购物车当前的数量为:"
+
response
.
jsonPath
().
getString
(
"data.trolleyItemCount"
));
}
}
\ No newline at end of file
src/test/java/http/service/Authorization.java
View file @
d8e4aef3
...
...
@@ -300,7 +300,7 @@ public class Authorization {
public
Map
hdLoginSaasNew
(
String
account
,
String
appId
){
String
path
=
"/doLoginNew"
;
int
i
=
10
;
logger
.
info
(
"hdCookiesSaas
ByApp
cookies:"
+
hdCookiesSaasNew
.
toString
());
logger
.
info
(
"hdCookiesSaas
New
cookies:"
+
hdCookiesSaasNew
.
toString
());
Map
<
String
,
String
>
hdCookies
=
hdCookiesSaasNew
.
get
(
appId
);
while
((
hdCookies
==
null
||
hdCookies
.
size
()==
0
)&&
i
>
0
)
{
Response
token
=
this
.
hdGetToken
();
...
...
@@ -328,7 +328,7 @@ public class Authorization {
i
--;
}
logger
.
info
(
"hdCookiesSaas
ByApp
cookies集合:"
+
hdCookiesSaasNew
.
toString
());
logger
.
info
(
"hdCookiesSaas
New
cookies集合:"
+
hdCookiesSaasNew
.
toString
());
return
hdCookies
;
}
...
...
src/test/java/http/service/Saas/MallService.java
0 → 100644
View file @
d8e4aef3
package
http
.
service
.
Saas
;
import
base.DuibaLog
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.testng.Assert
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
/**
* Created by zhaoran on 2018/12/19.
*/
@Service
public
class
MallService
{
@Value
(
"${activity.host}"
)
String
activityHost
;
@Autowired
Authorization
authorization
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//获取购物车列表商品
public
Response
mallget
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/mall-api/consumer/shopping-trolley/get"
;
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
get
(
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"购物车列表接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"购物车列表接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//获取购物车列表商品
public
Response
getMallCount
(
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/mall-api/consumer/market-activity/getMallCount"
;
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
get
(
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"购物车数目接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"购物车数目接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
// 加入购物车
public
Response
malladd
(
String
appItemId
,
Integer
uid
)
throws
Exception
{
String
url
=
activityHost
+
"/mall-api/consumer/shopping-trolley/add"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appItemId"
,
appItemId
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
body
(
jsonParam
).
post
(
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"添加购物车接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"添加购物车接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
\ No newline at end of file
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