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
f12851d3
Commit
f12851d3
authored
Dec 21, 2019
by
panyuli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
核销二期代码
parent
bb0a2b6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
30 deletions
+15
-30
权益二期线上用户核销匹配权益及兑换码兑换_DuibaTest.java
...ses/equitySubjectTest/权益二期线上用户核销匹配权益及兑换码兑换_DuibaTest.java
+6
-22
equityPrizeService.java
src/test/java/http/service/Activity/equityPrizeService.java
+9
-8
No files found.
src/test/java/http/cases/equitySubjectTest/权益二期线上用户核销匹配权益及兑换码兑换_DuibaTest.java
View file @
f12851d3
...
...
@@ -53,7 +53,7 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT
logger
.
info
(
"权益类表数据返回正确 -结束了"
);
}
//
@Test
@Test
//(invocationCount=5)一个组件下面多少个权益数据
public
void
权益列表首页接口返回正确
()
throws
Exception
{
...
...
@@ -64,28 +64,12 @@ public class 权益二期线上用户核销匹配权益及兑换码兑换_DuibaT
Response
response
=
equityPrizeService
.
chwvisualeditorfindEquityListByIds
(
authorization
.
dafuwengLogin
(
uid
),
list
);
response
.
prettyPrint
();
String
code
=
response
.
jsonPath
().
getString
(
"code"
);
/* Assert.assertEquals(code,"0000000000","权益类表数据返回正确接口 失败,code:"+code );
String data= JSON.parseObject(response.asString()).getString("data");
JSONArray jsonArray = JSON.parseArray(data);
List<String> list1 = new ArrayList();*/
List
<
Integer
>
ids
=
response
.
jsonPath
().
getList
(
"data.id"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
"接口返回失败"
);
// Assert.assertEquals(code,"0000000000","权益类表数据返回正确接口 失败,code:"+code );
Assert
.
assertEquals
(
ids
.
size
(),
list
.
size
(),
"数据条数不匹配"
);
/* for (Object jsonobject:
jsonArray) {
String s = jsonobject.toString();
JSONObject js = JSON.parseObject(s);
String appitem = js.getString("appItemId");
list.add(appitem);
}*/
/* //数组长度的校验 长度判断
Assert.assertEquals(list.size()+"","2","接口数据返回listsize()数值 不一致,size:"+list.size() );
String appItemId= list.get(0);
logger.info("list.get(0) appItemId:"+appItemId+"list.get(1) appItemId1:"+ list.get(1));
Assert.assertEquals(appItemId,"199281","接口获取商品的1id 不一致,code:"+appItemId );
String appItemId1= list.get(1);
Assert.assertEquals(appItemId1,"199282","接口获取商品的2id 不一致,code:"+appItemId1 );*/
logger
.
info
(
"权益类表数据返回正确 -结束了"
);
logger
.
info
(
"权益列表首页接口返回正确 -结束了"
);
}
@Test
...
...
src/test/java/http/service/Activity/equityPrizeService.java
View file @
f12851d3
package
http
.
service
.
Activity
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Authorization
;
import
io.restassured.http.Cookies
;
import
io.restassured.response.Response
;
...
...
@@ -9,9 +11,7 @@ import org.springframework.stereotype.Service;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.*
;
import
static
base
.
Postman
.
logger
;
import
static
io
.
restassured
.
RestAssured
.
given
;
...
...
@@ -136,12 +136,13 @@ public Response gawequityPrizeexchange( Map cookies,String excCode,String app
*
* */
public
Response
chwvisualeditorfindEquityListByIds
(
Map
cookies
,
ArrayList
array
)
throws
Exception
{
Map
<
String
,
ArrayList
>
map
=
new
HashMap
<>();
public
Response
chwvisualeditorfindEquityListByIds
(
Map
cookies
,
List
<
Integer
>
array
)
throws
Exception
{
// JSONObject json = new JSONObject();
// json.put("equityIds", array);
Map
<
String
,
List
<
Integer
>>
map
=
new
HashMap
<>();
map
.
put
(
"equityIds"
,
array
);
// Response response = given().contentType("application/json;charset=UTF-8").cookies(cookies).params(map).get("http://" + url);
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/chw/visual-editor/findEquityListByIds"
);
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
cookies
).
body
(
map
).
post
(
activityHost
+
"/chw/visual-editor/findEquityListByIds"
);
//Response response = given().contentType("application/json;charset=UTF-8").body("{\"equityIds\":[25,24]}").cookies(cookies).post(activityHost + "/chw/visual-editor/findEquityListByIds");
try
{
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
getStatusCode
()),
"200"
,
" /chw/visual-editor/findEquityListByIds接口失败"
);
}
catch
(
Exception
e
)
{
...
...
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