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
b721cfb1
Commit
b721cfb1
authored
Jul 02, 2024
by
yangfangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单相关的接口
parent
583518e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
12 deletions
+83
-12
src/main/java/com/xiaomai/cases/polar/finance/order/TestCancel.java
+23
-3
src/main/java/com/xiaomai/cases/polar/finance/order/TestDiscard.java
+19
-3
src/main/java/com/xiaomai/cases/polar/finance/order/TestModifyMemo.java
+19
-3
src/main/java/com/xiaomai/cases/polar/finance/order/TestSignOrder.java
+22
-3
No files found.
src/main/java/com/xiaomai/cases/polar/finance/order/TestCancel.java
View file @
b721cfb1
...
...
@@ -2,19 +2,28 @@ package com.xiaomai.cases.polar.finance.order;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.cases.polar.memberCard.CardTools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestCancel
extends
XMBaseTest
{
String
memberId
;
String
cardId
;
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
CardTools
cardTools
=
new
CardTools
();
@BeforeMethod
public
void
beforeTest
(){
...
...
@@ -30,18 +39,29 @@ public class TestCancel extends XMBaseTest {
@Test
(
description
=
"取消订单"
)
public
void
testCancel
(){
String
name
=
"创建订单潜在会员"
+
RandomStringUtil
.
randomString
(
3
);
String
phone
=
RandomStringUtil
.
randomMobile
(
"666"
);
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
memberTotal
=
Integer
.
parseInt
(
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
memberTotal
==
0
)
{
memberId
=
tools
.
create
(
name
,
phone
).
getString
(
"result"
);
}
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
int
cardTotal
=
Integer
.
parseInt
(
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
cardTotal
==
0
)
{
cardId
=
cardTools
.
memberCardCreate
(
"创建订单会员卡"
+
TimeUtils
.
getCurrentTime
()).
getString
(
"result"
);
}
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
...
...
src/main/java/com/xiaomai/cases/polar/finance/order/TestDiscard.java
View file @
b721cfb1
...
...
@@ -4,23 +4,29 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.revenueAndExpenditure.RevenueAndExpenditureTools
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.cases.polar.memberCard.CardTools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestDiscard
extends
XMBaseTest
{
String
memberId
;
String
cardId
;
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
RevenueAndExpenditureTools
revenueAndExpenditureTools
=
new
RevenueAndExpenditureTools
();
CardTools
cardTools
=
new
CardTools
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
...
...
@@ -36,18 +42,28 @@ public class TestDiscard extends XMBaseTest {
public
void
testDiscard
(){
String
name
=
"创建订单潜在会员"
+
RandomStringUtil
.
randomString
(
3
);
String
phone
=
RandomStringUtil
.
randomMobile
(
"666"
);
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
memberTotal
=
Integer
.
parseInt
(
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
memberTotal
==
0
)
{
memberId
=
tools
.
create
(
name
,
phone
).
getString
(
"result"
);
}
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
int
cardTotal
=
Integer
.
parseInt
(
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
cardTotal
==
0
)
{
cardId
=
cardTools
.
memberCardCreate
(
"创建订单会员卡"
+
TimeUtils
.
getCurrentTime
()).
getString
(
"result"
);
}
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
...
...
src/main/java/com/xiaomai/cases/polar/finance/order/TestModifyMemo.java
View file @
b721cfb1
...
...
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.revenueAndExpenditure.RevenueAndExpenditureTools
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.cases.polar.memberCard.CardTools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
...
...
@@ -17,11 +19,15 @@ import java.util.Random;
public
class
TestModifyMemo
extends
XMBaseTest
{
String
memberId
;
String
cardId
;
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
CardTools
cardTools
=
new
CardTools
();
@BeforeMethod
public
void
beforeTest
(){
...
...
@@ -37,18 +43,28 @@ public class TestModifyMemo extends XMBaseTest {
@Test
(
description
=
"修改备注"
)
public
void
testModifyMemo
(){
String
name
=
"创建订单潜在会员"
+
RandomStringUtil
.
randomString
(
3
);
String
phone
=
RandomStringUtil
.
randomMobile
(
"666"
);
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
memberTotal
=
Integer
.
parseInt
(
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
memberTotal
==
0
)
{
memberId
=
tools
.
create
(
name
,
phone
).
getString
(
"result"
);
}
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
int
cardTotal
=
Integer
.
parseInt
(
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
cardTotal
==
0
)
{
cardId
=
cardTools
.
memberCardCreate
(
"创建订单会员卡"
+
TimeUtils
.
getCurrentTime
()).
getString
(
"result"
);
}
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
...
...
src/main/java/com/xiaomai/cases/polar/finance/order/TestSignOrder.java
View file @
b721cfb1
...
...
@@ -4,9 +4,12 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.revenueAndExpenditure.RevenueAndExpenditureTools
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.cases.polar.memberCard.CardTools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
...
...
@@ -15,12 +18,18 @@ import org.testng.annotations.Test;
public
class
TestSignOrder
extends
XMBaseTest
{
String
memberId
;
String
cardId
;
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
RevenueAndExpenditureTools
revenueAndExpenditureTools
=
new
RevenueAndExpenditureTools
();
CardTools
cardTools
=
new
CardTools
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
...
...
@@ -35,18 +44,28 @@ public class TestSignOrder extends XMBaseTest {
@Test
(
description
=
"创建订单"
)
public
void
testSignOrder
(){
String
name
=
"创建订单潜在会员"
+
RandomStringUtil
.
randomString
(
3
);
String
phone
=
RandomStringUtil
.
randomMobile
(
"666"
);
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
memberTotal
=
Integer
.
parseInt
(
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
memberTotal
==
0
)
{
memberId
=
tools
.
create
(
name
,
phone
).
getString
(
"result"
);
}
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
int
cardTotal
=
Integer
.
parseInt
(
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"total"
));
if
(
cardTotal
==
0
)
{
cardId
=
cardTools
.
memberCardCreate
(
"创建订单会员卡"
+
TimeUtils
.
getCurrentTime
()).
getString
(
"result"
);
}
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
...
...
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