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
6f3ce47f
Commit
6f3ce47f
authored
Aug 07, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
klv
parent
822182e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
146 additions
and
4 deletions
+146
-4
商品分组组件_DuibaTest.java
...st/java/http/cases/VisualEditorTest/商品分组组件_DuibaTest.java
+27
-0
商品组件_DuibaTest.java
...test/java/http/cases/VisualEditorTest/商品组件_DuibaTest.java
+116
-4
DevItemNewService.java
src/test/java/http/service/hd/DevItemNewService.java
+3
-0
No files found.
src/test/java/http/cases/VisualEditorTest/商品分组组件_DuibaTest.java
View file @
6f3ce47f
...
...
@@ -86,18 +86,23 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
case
1
:
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].title"
),
"10元话费"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].customCredits"
),
"1000"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].smallImage"
),
"//yun.duiba.com.cn/developer/img/phonebilldingzhi10/telephone_charge_breviary.jpg"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].title"
),
"支付宝充值"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].customCredits"
),
"100000"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].smallImage"
),
"//yun.dui88.com/images/201610/txqn3qz6o9.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].title"
),
"【自动化勿动】兑吧新实物"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].customCredits"
),
"300"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].smallImage"
),
"//yun.dui88.com/images/201904/dkk6pttatj.jpg"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].title"
),
"【自动化勿动】兑吧卡密跳转按钮"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].customCredits"
),
"200"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].smallImage"
),
"//yun.dui88.com/images/201904/pz4d6hof6w.jpg"
,
"校验第四个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].title"
),
"【自动化勿动】兑吧新优惠券普通券码跳转"
,
"校验第五个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].customCredits"
),
"100"
,
"校验第五个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].smallImage"
),
"//yun.dui88.com/images/201903/ibdef09gw3.png"
,
"校验第五个商品smallImage失败"
);
logger
.
info
(
"校验商品分组1-兑吧商品成功"
);
break
;
...
...
@@ -105,15 +110,19 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
case
2
:
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].title"
),
"【自动化勿动】自有卡密"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].customCredits"
),
"550"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].smallImage"
),
"//yun.dui88.com/images/201904/ug1ovw21ys.jpg"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].title"
),
"【自动化勿动】自有充值商品"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].customCredits"
),
"300"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].smallImage"
),
"//yun.dui88.com/images/201904/zhrc72q09p.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].title"
),
"【自动化勿动】自有新实物加钱购"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].customCredits"
),
"150"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].smallImage"
),
"//yun.dui88.com/images/201904/fzlunc5ji4.jpg"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].title"
),
"【自动化勿动】自有新优惠券跳转链接"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].customCredits"
),
"100"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].smallImage"
),
"//yun.dui88.com/images/201904/ic2vqnu3x0.jpg"
,
"校验第四个商品smallImage失败"
);
logger
.
info
(
"校验商品分组2-自有商品成功"
);
break
;
...
...
@@ -147,18 +156,23 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
case
1
:
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].title"
),
"【勿动】兑吧优惠券共享库存测试"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].customCredits"
),
"140"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].smallImage"
),
"//yun.dui88.com/images/201807/79r9bwt2my.png"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].title"
),
"【自动化勿动】兑吧实物日期兑换限制进行中"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].customCredits"
),
"700"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].smallImage"
),
"//yun.dui88.com/images/201806/28m2esmi0d.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].title"
),
"5元话费"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].customCredits"
),
"3500"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].smallImage"
),
"//yun.duiba.com.cn/images/5ayvpsoncj.jpg"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].title"
),
"Q币充值"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].customCredits"
),
"700"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].smallImage"
),
"//yun.dui88.com/images/201610/9qawkmx7eh.jpg"
,
"校验第四个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].title"
),
"支付宝充值"
,
"校验第五个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].customCredits"
),
"1000"
,
"校验第五个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].smallImage"
),
"//yun.dui88.com/images/201610/txqn3qz6o9.jpg"
,
"校验第五个商品smallImage失败"
);
logger
.
info
(
"校验商品分组1-兑吧商品成功"
);
break
;
...
...
@@ -166,12 +180,15 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
case
2
:
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].title"
),
"【自动化勿动】自有虚拟商品"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].customCredits"
),
"1000"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].smallImage"
),
"//yun.dui88.com/images/201904/n71mi1ixwf.gif"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].title"
),
"【自动化勿动】自有实物"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].customCredits"
),
"200"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].smallImage"
),
"//yun.dui88.com/images/201904/a410736wql.gif"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].title"
),
"【自动化勿动】自有优惠券"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].customCredits"
),
"100"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].smallImage"
),
"//yun.dui88.com/images/201904/5h0skt3nqp.png"
,
"校验第三个商品smallImage失败"
);
logger
.
info
(
"校验商品分组2-自有商品成功"
);
break
;
...
...
@@ -205,18 +222,23 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
//手机端接口排序与前端不一致
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
),
"【自动化勿动】兑吧新优惠券普通券码跳转"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].titleDownTxt"
),
"100积分"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].smallImage"
),
"//yun.dui88.com/images/201903/ibdef09gw3.png"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].title"
),
"【自动化勿动】兑吧卡密跳转按钮"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].titleDownTxt"
),
"200积分"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].smallImage"
),
"//yun.dui88.com/images/201904/pz4d6hof6w.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].title"
),
"【自动化勿动】兑吧新实物"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].titleDownTxt"
),
"300积分"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].smallImage"
),
"//yun.dui88.com/images/201904/dkk6pttatj.jpg"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].title"
),
"支付宝充值"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].titleDownTxt"
),
"10万积分"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].smallImage"
),
"//yun.dui88.com/images/201610/txqn3qz6o9.jpg"
,
"校验第四个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[4].title"
),
"10元话费"
,
"校验第五个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[4].titleDownTxt"
),
"1000积分"
,
"校验第五个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[4].smallImage"
),
"//yun.duiba.com.cn/developer/img/phonebilldingzhi10/telephone_charge_breviary.jpg"
,
"校验第五个商品smallImage失败"
);
logger
.
info
(
"校验商品分组1-兑吧新商品成功"
);
break
;
...
...
@@ -224,15 +246,19 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
case
2
:
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
),
"【自动化勿动】自有新优惠券跳转链接"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].titleDownTxt"
),
"100积分"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[0].smallImage"
),
"//yun.dui88.com/images/201904/ic2vqnu3x0.jpg"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].title"
),
"【自动化勿动】自有新实物加钱购"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].titleDownTxt"
),
"150积分 + 10.00元"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[1].smallImage"
),
"//yun.dui88.com/images/201904/fzlunc5ji4.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].title"
),
"【自动化勿动】自有充值商品"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].titleDownTxt"
),
"300积分"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[2].smallImage"
),
"//yun.dui88.com/images/201904/zhrc72q09p.jpg"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].title"
),
"【自动化勿动】自有卡密"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].titleDownTxt"
),
"550积分"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.list[3].smallImage"
),
"//yun.dui88.com/images/201904/ug1ovw21ys.jpg"
,
"校验第四个商品smallImage失败"
);
logger
.
info
(
"校验商品分组2-自有新商品成功"
);
break
;
...
...
@@ -318,4 +344,5 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
}
src/test/java/http/cases/VisualEditorTest/商品组件_DuibaTest.java
View file @
6f3ce47f
...
...
@@ -34,14 +34,126 @@ public class 商品组件_DuibaTest extends DuibaTestBase{
@Test
(
description
=
"后台商品组件新商品展示"
)
public
void
后台商品组件新商品
(
String
appId
,
List
<
Integer
>
itemIdList
)
throws
Exception
{
public
void
后台商品组件新商品
()
throws
Exception
{
Map
cookies
=
authorization
.
hdLoginCommonNew
(
"15855555555"
);
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
195115
);
Response
response
=
devItemNewService
.
appItems
(
cookies
,
appId
,
list
);
String
appId
=
"22561"
;
List
<
Integer
>
itemIdList
=
new
ArrayList
<>();
itemIdList
.
add
(
195113
);
itemIdList
.
add
(
195112
);
itemIdList
.
add
(
194709
);
itemIdList
.
add
(
195109
);
itemIdList
.
add
(
195116
);
itemIdList
.
add
(
195115
);
itemIdList
.
add
(
194962
);
itemIdList
.
add
(
196218
);
Response
response
=
devItemNewService
.
appItems
(
cookies
,
appId
,
itemIdList
);
response
.
prettyPrint
();
//校验兑吧商品
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].title"
),
"10元话费"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].customCredits"
),
"1000"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].facePrice"
),
"0.0"
,
"校验第一个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].smallImage"
),
"//yun.duiba.com.cn/developer/img/phonebilldingzhi10/telephone_charge_breviary.jpg"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].title"
),
"支付宝充值"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].customCredits"
),
"100000"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].facePrice"
),
"0.0"
,
"校验第二个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].smallImage"
),
"//yun.dui88.com/images/201610/txqn3qz6o9.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].title"
),
"【自动化勿动】兑吧新优惠券普通券码跳转"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].customCredits"
),
"100"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].facePrice"
),
"100.0"
,
"校验第三个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].smallImage"
),
"//yun.dui88.com/images/201903/ibdef09gw3.png"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].title"
),
"【自动化勿动】兑吧新实物"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].customCredits"
),
"300"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].facePrice"
),
"300.0"
,
"校验第四个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].smallImage"
),
"//yun.dui88.com/images/201904/dkk6pttatj.jpg"
,
"校验第四个商品smallImage失败"
);
logger
.
info
(
"校验后台商品组件兑吧商品展示成功"
);
//校验自有商品
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].title"
),
"【自动化勿动】自有卡密"
,
"校验第五个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].customCredits"
),
"550"
,
"校验第五个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].facePrice"
),
"200.0"
,
"校验第五个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].smallImage"
),
"//yun.dui88.com/images/201904/ug1ovw21ys.jpg"
,
"校验第五个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].title"
),
"【自动化勿动】自有充值商品"
,
"校验第六个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].customCredits"
),
"300"
,
"校验第六个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].facePrice"
),
"50.0"
,
"校验第六个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].smallImage"
),
"//yun.dui88.com/images/201904/zhrc72q09p.jpg"
,
"校验第六个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].title"
),
"【自动化勿动】自有新优惠券跳转链接"
,
"校验第七个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].customCredits"
),
"100"
,
"校验第七个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].facePrice"
),
"100.0"
,
"校验第七个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].smallImage"
),
"//yun.dui88.com/images/201904/ic2vqnu3x0.jpg"
,
"校验第七个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[7].title"
),
"【自动化勿动】自有实物sku"
,
"校验第八个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[7].customCredits"
),
"100"
,
"校验第八个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[7].facePrice"
),
"100.0"
,
"校验第八个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[7].smallImage"
),
"//yun.dui88.com/images/201906/9p72lmu1qn.jpg"
,
"校验第八个商品smallImage失败"
);
logger
.
info
(
"校验后台商品组件自有商品展示成功"
);
}
@Test
(
description
=
"后台商品组件老商品展示"
)
public
void
后台商品组件老商品
()
throws
Exception
{
Map
cookies
=
authorization
.
hdLoginCommonNew
(
"15833333333"
);
String
appId
=
"22542"
;
List
<
Integer
>
itemIdList
=
new
ArrayList
<>();
itemIdList
.
add
(
195485
);
itemIdList
.
add
(
191895
);
itemIdList
.
add
(
195487
);
itemIdList
.
add
(
195486
);
itemIdList
.
add
(
195490
);
itemIdList
.
add
(
195488
);
itemIdList
.
add
(
195489
);
Response
response
=
devItemNewService
.
appItems
(
cookies
,
appId
,
itemIdList
);
response
.
prettyPrint
();
//校验兑吧商品
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].title"
),
"5元话费"
,
"校验第一个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].customCredits"
),
"3500"
,
"校验第一个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].facePrice"
),
"0.0"
,
"校验第一个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[0].smallImage"
),
"//yun.duiba.com.cn/images/5ayvpsoncj.jpg"
,
"校验第一个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].title"
),
"支付宝充值"
,
"校验第二个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].customCredits"
),
"1000"
,
"校验第二个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].facePrice"
),
"0.0"
,
"校验第二个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[1].smallImage"
),
"//yun.dui88.com/images/201610/txqn3qz6o9.jpg"
,
"校验第二个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].title"
),
"【勿动】兑吧优惠券共享库存测试"
,
"校验第三个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].customCredits"
),
"140"
,
"校验第三个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].facePrice"
),
"100.0"
,
"校验第三个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[2].smallImage"
),
"//yun.dui88.com/images/201807/79r9bwt2my.png"
,
"校验第三个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].title"
),
"【自动化勿动】兑吧实物日期兑换限制进行中"
,
"校验第四个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].customCredits"
),
"700"
,
"校验第四个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].facePrice"
),
"10.0"
,
"校验第四个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[3].smallImage"
),
"//yun.dui88.com/images/201806/28m2esmi0d.jpg"
,
"校验第四个商品smallImage失败"
);
logger
.
info
(
"校验后台商品组件兑吧商品展示成功"
);
//校验自有商品
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].title"
),
"【自动化勿动】自有虚拟商品"
,
"校验第五个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].customCredits"
),
"1000"
,
"校验第五个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].facePrice"
),
"222.0"
,
"校验第五个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[4].smallImage"
),
"//yun.dui88.com/images/201904/n71mi1ixwf.gif"
,
"校验第五个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].title"
),
"【自动化勿动】自有优惠券"
,
"校验第六个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].customCredits"
),
"100"
,
"校验第六个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].facePrice"
),
"1.0"
,
"校验第六个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[5].smallImage"
),
"//yun.dui88.com/images/201904/5h0skt3nqp.png"
,
"校验第六个商品smallImage失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].title"
),
"【自动化勿动】自有实物"
,
"校验第七个商品title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].customCredits"
),
"200"
,
"校验第七个商品credits失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].facePrice"
),
"122.0"
,
"校验第七个商品facePrice失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.rows[6].smallImage"
),
"//yun.dui88.com/images/201904/a410736wql.gif"
,
"校验第七个商品smallImage失败"
);
logger
.
info
(
"校验后台商品组件自有商品展示成功"
);
}
}
src/test/java/http/service/hd/DevItemNewService.java
View file @
6f3ce47f
...
...
@@ -137,6 +137,9 @@ public class DevItemNewService {
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"itemIdList"
,
itemIdList
);
map
.
put
(
"sort"
,
"custom"
);
map
.
put
(
"soldOutType"
,
"show"
);
map
.
put
(
"forGoodsVisual"
,
"true"
);
logger
.
info
(
"请求商品组件接口:"
+
"/devItemNew/appItems"
);
...
...
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