Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-sportstest
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-sportstest
Commits
46ba5753
Commit
46ba5753
authored
Aug 09, 2024
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑会员卡增加断言
parent
49007f4a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/main/java/com/xiaomai/cases/polar/memberCard/TestTenantMemberCard_update.java
+12
-4
No files found.
src/main/java/com/xiaomai/cases/polar/memberCard/TestTenantMemberCard_update.java
View file @
46ba5753
...
...
@@ -9,6 +9,7 @@ import com.xiaomai.enums.Terminal;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.XMBaseTest
;
import
com.xiaomai.utils.XMJSONPath
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
...
...
@@ -30,6 +31,8 @@ public class TestTenantMemberCard_update extends XMBaseTest {
@Test
(
description
=
"编辑会员卡"
)
public
void
testmodifySharers
()
{
CardTools
Cardtools
=
new
CardTools
();
try
{
Thread
.
sleep
(
2000
);
}
catch
(
InterruptedException
e
)
{
...
...
@@ -40,6 +43,9 @@ public class TestTenantMemberCard_update extends XMBaseTest {
String
memberCardId
=
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result.records[0].id"
);
JSONObject
bodyJson2
=
Cardtools
.
fetchPageOfHistory
(
memberCardId
);
int
count
=
Integer
.
parseInt
(
XMJSONPath
.
readPath
(
bodyJson2
,
"$.result.total"
));
JSONArray
activatePatternList
=
new
JSONArray
();
activatePatternList
.
add
(
"PURCHASE"
);
...
...
@@ -64,9 +70,6 @@ public class TestTenantMemberCard_update extends XMBaseTest {
benefitList
.
add
(
Object
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"surfaceUrl"
,
"https://image.xiaomaiketang.com/xm/internal/HpRiJpFnTC.png"
);
//会员卡封面图片
jsonObject
.
put
(
"surfaceCornerMark"
,
"自动化标签"
);
...
...
@@ -76,7 +79,7 @@ public class TestTenantMemberCard_update extends XMBaseTest {
jsonObject
.
put
(
"sharePeopleLimit"
,
"2"
);
//共享人数
jsonObject
.
put
(
"benefitList"
,
benefitList
);
//使用权益
jsonObject
.
put
(
"price"
,
"1"
);
//价格
jsonObject
.
put
(
"underlinePrice"
,
"
10"
);
//划线价
jsonObject
.
put
(
"underlinePrice"
,
"
20"
);
//划线价:从10到20
jsonObject
.
put
(
"purchaseNumberLimit"
,
"-1"
);
//购买数量限制
jsonObject
.
put
(
"xcxSaleStatus"
,
"YES"
);
//小程序是否售卖
jsonObject
.
put
(
"creatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
...
...
@@ -90,6 +93,11 @@ public class TestTenantMemberCard_update extends XMBaseTest {
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
bodyJson1
=
Cardtools
.
fetchPageOfHistory
(
memberCardId
);
int
count1
=
Integer
.
parseInt
(
XMJSONPath
.
readPath
(
bodyJson1
,
"$.result.total"
));
Assert
.
assertTrue
(
count1
==
count
+
1
);
//编辑记录+1
Cardtools
.
fetchDetailById
(
memberCardId
);
Assert
.
assertTrue
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result.underlinePrice"
).
equals
(
"20.00"
),
"编辑会员卡,核对编辑的划线价是否改过来了"
);
}
}
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