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
822182e8
Commit
822182e8
authored
Aug 07, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
08c943bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
商品组件_DuibaTest.java
...test/java/http/cases/VisualEditorTest/商品组件_DuibaTest.java
+47
-0
DevItemNewService.java
src/test/java/http/service/hd/DevItemNewService.java
+32
-0
No files found.
src/test/java/http/cases/VisualEditorTest/商品组件_DuibaTest.java
0 → 100644
View file @
822182e8
package
http
.
cases
.
VisualEditorTest
;
import
base.Config
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.cases.ExchangeTest.Database
;
import
http.service.hd.DevItemNewService
;
import
http.service.app.ChwVisualEditorService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.testng.Assert
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
utils.PublicMethod
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
http.service.Authorization
;
/**
* created by lvwenyan 2019/8/7
*/
public
class
商品组件
_DuibaTest
extends
DuibaTestBase
{
@Autowired
DevItemNewService
devItemNewService
;
@Autowired
Authorization
authorization
;
@Test
(
description
=
"后台商品组件新商品展示"
)
public
void
后台商品组件新商品
(
String
appId
,
List
<
Integer
>
itemIdList
)
throws
Exception
{
Map
cookies
=
authorization
.
hdLoginCommonNew
(
"15855555555"
);
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
195115
);
Response
response
=
devItemNewService
.
appItems
(
cookies
,
appId
,
list
);
response
.
prettyPrint
();
}
}
src/test/java/http/service/hd/DevItemNewService.java
View file @
822182e8
...
...
@@ -127,6 +127,38 @@ public class DevItemNewService {
}
//商品组件
public
Response
appItems
(
Map
cookies
,
String
appId
,
List
<
Integer
>
itemIdList
)
throws
Exception
{
String
url
=
hdserverHost
+
"/devItemNew/appItems"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"status"
,
"on"
);
map
.
put
(
"pageSize"
,
"300"
);
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"itemIdList"
,
itemIdList
);
logger
.
info
(
"请求商品组件接口:"
+
"/devItemNew/appItems"
);
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
cookies
).
params
(
map
).
get
(
"http://"
+
url
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/devItemNew/appItems接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/devItemNew/appItems接口返回异常,返回信息:"
+
response
.
asString
());
}
return
response
;
}
...
...
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