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
44ee0265
Commit
44ee0265
authored
Nov 13, 2018
by
赵然
Browse files
Options
Browse Files
Download
Plain Diff
zr
parents
a3b57c44
344a25f3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
319 additions
and
12 deletions
+319
-12
虚拟商品_兑换异常测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/虚拟商品_兑换异常测试_ExchangeTest.java
+0
-0
商品管理操作_DuibaTest.java
...t/java/http/cases/SaasDeveloperTest/商品管理操作_DuibaTest.java
+108
-2
SpglczService.java
src/test/java/http/service/Saas/SpglczService.java
+210
-9
VirtualExchangeService.java
src/test/java/http/service/app/VirtualExchangeService.java
+1
-1
No files found.
src/test/java/http/cases/ExchangeTest/虚拟商品_兑换异常测试_ExchangeTest.java
View file @
44ee0265
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/SaasDeveloperTest/商品管理操作_DuibaTest.java
View file @
44ee0265
...
...
@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
/**
* Created by humengxin on 2018/11/0
2
.
* Created by humengxin on 2018/11/0
8
.
*/
@ContextConfiguration
(
classes
=
Config
.
class
)
...
...
@@ -82,10 +82,44 @@ public class 商品管理操作_DuibaTest extends AbstractTestNGSpringContextTes
logger
.
info
(
"校验title,belong成功"
);
// 查看完存在后,再删除复制的app数据
String
ids3
=
response2
.
jsonPath
().
getString
(
"data.list[0].id"
);
logger
.
info
(
ids3
);
String
ids4
=
response2
.
jsonPath
().
getString
(
"data.list[1].id"
);
logger
.
info
(
ids4
);
//先删除20979 app数据
czService
.
doBatchDel2
(
ids3
,
ids4
);
}
@Test
(
description
=
"批量复制-兑吧定向商品"
)
public
void
c_
批量复制兑吧定向商品
()
throws
Exception
{
String
data
=
PublicMethod
.
data
();
//查询实物商品集合
Response
response
=
czService
.
appItems3
();
// 获取到兑吧定向商品id
String
ids
=
response
.
jsonPath
().
getString
(
"data.list[0].id"
);
String
ids2
=
response
.
jsonPath
().
getString
(
"data.list[1].id"
);
//复制到另一个app
Response
response2
=
czService
.
batchCopy
(
ids
,
ids2
);
//提示兑吧商品不支持复制
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.errorList[0].message"
),
"定向商品不支持复制"
,
"校验异常场景失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.errorList[0].title"
),
"【SaaS-自动化测试】实物勿动"
,
"校验title失败"
);
logger
.
info
(
"校验message,title成功"
);
}
@Test
(
description
=
"批量删除"
)
public
void
c
_
批量删除
()
throws
Exception
{
public
void
d
_
批量删除
()
throws
Exception
{
String
data
=
PublicMethod
.
data
();
...
...
@@ -94,11 +128,83 @@ public class 商品管理操作_DuibaTest extends AbstractTestNGSpringContextTes
// 获取到上架商品id
String
ids
=
response
.
jsonPath
().
getString
(
"data.list[0].id"
);
String
ids2
=
response
.
jsonPath
().
getString
(
"data.list[1].id"
);
//先删除19515 app数据
czService
.
doBatchDel
(
ids
,
ids2
);
}
@Test
(
description
=
"添加商品分组并把2个商品加入分组"
)
public
void
e_
添加分组
()
throws
Exception
{
String
data
=
PublicMethod
.
data
();
//添加商品分组
czService
.
editClassify
();
// 查询商品分组是否添加成功
czService
.
classify
();
//先添加2个商品,加入到商品分组中
developerVirtualService
.
doUpdateVirtual
(
"【自动化】加钱购自有虚拟商品"
+
data
,
"标识符100=10+1"
);
developerVirtualService
.
doUpdateVirtual
(
"【自动化】加钱购自有虚拟商品"
+
data
,
"标识符100=10+1"
);
//查询实物商品集合
Response
response
=
czService
.
appItems
();
// 获取到上架商品id
String
s1
=
response
.
jsonPath
().
getString
(
"data.list[0].id"
);
String
s2
=
response
.
jsonPath
().
getString
(
"data.list[1].id"
);
Response
response2
=
czService
.
classify
();
String
classifyId
=
response2
.
jsonPath
().
getString
(
"data.list[0].id"
);
czService
.
saveToClassify
(
classifyId
,
s1
,
s2
);
//查询商品分组集合,确认2个商品是否添加到分组中
Response
response3
=
czService
.
classify
();
//查看商品列表确认是否上架成功
Assert
.
assertEquals
(
response3
.
jsonPath
().
getString
(
"data.list[0].appItemNum"
),
"2"
,
"校验商品加入分组成功"
);
Assert
.
assertEquals
(
response3
.
jsonPath
().
getString
(
"data.list[0].name"
),
"【自动化】商品分组1"
,
"校验商品分组名称失败"
);
logger
.
info
(
"校验商品分组成功"
);
}
@Test
(
description
=
"移除分组"
)
public
void
f_
移除分组
()
throws
Exception
{
String
data
=
PublicMethod
.
data
();
Response
response
=
czService
.
classify
();
String
classifyId
=
response
.
jsonPath
().
getString
(
"data.list[0].id"
);
Response
response2
=
czService
.
appItems4
(
classifyId
);
String
appItemId
=
response2
.
jsonPath
().
getString
(
"data.list[0].id"
);
String
appItemId2
=
response2
.
jsonPath
().
getString
(
"data.list[1].id"
);
//移除分组
czService
.
removeClassifyAppItem
(
appItemId
,
classifyId
);
czService
.
removeClassifyAppItem
(
appItemId2
,
classifyId
);
Assert
.
assertEquals
(
czService
.
removeClassifyAppItem
(
appItemId
,
classifyId
).
jsonPath
().
getString
(
"data.message"
),
"移除成功"
,
"校验移除商品接口成功"
);
logger
.
info
(
"校验移除商品分组成功"
);
}
@Test
(
description
=
"删除分组"
)
public
void
g_
删除分组
()
throws
Exception
{
String
data
=
PublicMethod
.
data
();
String
classifyId
=
czService
.
classify
().
jsonPath
().
getString
(
"data.list[0].id"
);
czService
.
deleteClassify
(
classifyId
);
// 查询商品分组列表
Response
response
=
czService
.
classify
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.totalCount"
),
"0"
,
"校验商品分组删除接口失败"
);
logger
.
info
(
"校验商品分组删除接口成功"
);
}
}
src/test/java/http/service/Saas/SpglczService.java
View file @
44ee0265
This diff is collapsed.
Click to expand it.
src/test/java/http/service/app/VirtualExchangeService.java
View file @
44ee0265
...
...
@@ -32,7 +32,7 @@ public class VirtualExchangeService {
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
throw
new
Exception
(
"/objectExchange/exchange接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
...
...
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