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
593ac53f
Commit
593ac53f
authored
Apr 29, 2024
by
yangfangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增订单相关接口
parent
143dbfe6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
813 additions
and
0 deletions
+813
-0
module/polar/财务中心.xml
+17
-0
src/main/java/com/xiaomai/cases/polar/finance/order/OrderTools.java
+196
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageMemberVoucher.java
+59
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageMemberVoucherItem.java
+61
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageVoucher.java
+103
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageVoucherItem.java
+91
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestSumMemberVoucherAmount.java
+71
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestSumVoucherAmount.java
+113
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestSumVoucherItemAmount.java
+100
-0
src/main/java/com/xiaomai/enums/ApiModule.java
+2
-0
No files found.
module/polar/财务中心.xml
0 → 100644
View file @
593ac53f
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite
name=
"财务中心场景case"
>
<!-- 起一个好听且唯一的名字-->
<test
name=
"财务中心模块测试"
preserve-order=
"true"
verbose=
"3"
>
<!-- 再起一个听且唯一的名字 -->
<packages>
<package
name=
"com.xiaomai.cases.polar.finance.*"
></package>
<!-- 添加自己想要集成测试的case 范围自己定 -->
</packages>
</test>
<listeners>
<listener
class-name=
"com.xiaomai.client.RetryListener"
/>
<listener
class-name=
"com.xiaomai.client.TestListener"
/>
<listener
class-name=
"com.xiaomai.client.ExtentTestNGIReporterListener"
/>
</listeners>
</suite>
\ No newline at end of file
src/main/java/com/xiaomai/cases/polar/finance/order/OrderTools.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.client.DataUserInfo
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
public
class
OrderTools
extends
XMBaseTest
{
/**
* @param
* @description:获取会员详情-订单管理列表
* @author: yangfangfang
**/
public
JSONObject
testPageMemberVoucher
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageMemberVoucher"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取会员详情-订单管理金额统计
* @author: yangfangfang
**/
public
JSONObject
testSumMemberVoucherAmount
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumMemberVoucherAmount"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取会员详情-订单明细列表
* @author: yangfangfang
**/
public
JSONObject
testPageMemberVoucherItem
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageMemberVoucherItem"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取订单管理-订单管理列表
* @author: yangfangfang
**/
public
JSONObject
testPageVoucher
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageVoucher"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取订单管理-订单管理金额统计
* @author: yangfangfang
**/
public
JSONObject
testSumVoucherAmount
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumVoucherAmount"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取订单管理-订单明细列表
* @author: yangfangfang
**/
public
JSONObject
testPageVoucherItem
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageVoucherItem"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取订单管理-订单明细金额统计
* @author: yangfangfang
**/
public
JSONObject
testSumVoucherItemAmount
(
String
current
,
String
size
,
String
supplierId
,
String
receiverId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumVoucherItemAmount"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
""
);
jsonObject
.
put
(
"size"
,
""
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageMemberVoucher.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestPageMemberVoucher
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageMemberVoucher"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取会员详情-订单管理列表"
)
public
void
testPageMemberVoucher
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
"1777254935106740226"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取会员详情-订单管理列表失败"
);
}
@Test
(
description
=
"获取会员详情-订单管理列表-无会员ID"
)
public
void
testPageMemberVoucher1
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageMemberVoucherItem.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestPageMemberVoucherItem
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageMemberVoucherItem"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取会员详情-订单明细列表"
)
public
void
testPageMemberVoucherItem
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
"1777254935106740226"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取会员详情-订单明细列表失败"
);
}
@Test
(
description
=
"获取会员详情-订单明细列表-无会员ID"
)
public
void
testPageMemberVoucherItem1
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageVoucher.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
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
TestPageVoucher
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageVoucher"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取财务中心-订单管理列表-无筛选"
)
public
void
testPageVoucher
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取订单管理列表失败"
);
}
@Test
(
description
=
"获取财务中心-订单管理列表-无筛选-无卖家ID(场馆ID)、场馆ID、品牌ID、操作人ID"
)
public
void
testPageVoucher1
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
@Test
(
description
=
"获取财务中心-订单管理列表-有筛选"
)
public
void
testPageVoucher_sift
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"source"
,
"OFFLINE_SOURCE"
);
JSONArray
states
=
new
JSONArray
();
states
.
add
(
"ARREARS"
);
states
.
add
(
"PAID"
);
states
.
add
(
"WAITING"
);
states
.
add
(
"CANCEL"
);
states
.
add
(
"DISCARD"
);
states
.
add
(
"TIMEOUT"
);
jsonObject
.
put
(
"states"
,
states
);
jsonObject
.
put
(
"type"
,
"SIGN"
);
jsonObject
.
put
(
"createdStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"createdEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"lastPaymentTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"lastPaymentTimeEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"operationTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"operationTimeEnd"
,
TimeUtils
.
getCurrentTime
());
JSONArray
salesmanIds
=
new
JSONArray
();
salesmanIds
.
add
(
"1772880092185255937"
);
salesmanIds
.
add
(
"1774376463837065218"
);
jsonObject
.
put
(
"salesmanIds"
,
salesmanIds
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"筛选订单管理列表失败"
);
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestPageVoucherItem.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
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
TestPageVoucherItem
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageVoucherItem"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取财务中心-订单明细列表-无筛选"
)
public
void
testPageVoucherItem
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取订单明细列表失败"
);
}
@Test
(
description
=
"获取财务中心-订单明细列表-无筛选-无卖家ID(场馆ID)、场馆ID、品牌ID、操作人ID"
)
public
void
testPageVoucherItem1
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
@Test
(
description
=
"获取财务中心-订单明细列表-有筛选"
)
public
void
testPageVoucherItem_sift
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"createdStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"createdEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"lastPaymentTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"lastPaymentTimeEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"operationTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"operationTimeEnd"
,
TimeUtils
.
getCurrentTime
());
JSONArray
salesmanIds
=
new
JSONArray
();
salesmanIds
.
add
(
"1772880092185255937"
);
salesmanIds
.
add
(
"1774376463837065218"
);
jsonObject
.
put
(
"salesmanIds"
,
salesmanIds
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"筛选订单明细列表失败"
);
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestSumMemberVoucherAmount.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestSumMemberVoucherAmount
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumMemberVoucherAmount"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取会员详情-订单管理金额统计"
)
public
void
testSumMemberVoucherAmount
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
"1777254935106740226"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取会员详情-订单管理金额统计失败"
);
float
totalActualAmount
=
Float
.
parseFloat
(
response
.
getJSONObject
(
"result"
).
getString
(
"totalActualAmount"
));
float
totalUnpaidAmount
=
Float
.
parseFloat
(
response
.
getJSONObject
(
"result"
).
getString
(
"totalUnpaidAmount"
));
boolean
flag
=
true
;
if
(
totalActualAmount
<
0
){
flag
=
false
;
}
Assert
.
assertEquals
(
flag
,
true
,
"获取会员详情-订单金额统计小于0"
);
}
@Test
(
description
=
"获取会员详情-订单管理金额统计-无会员ID"
)
public
void
testSumMemberVoucherAmount1
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestSumVoucherAmount.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
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
TestSumVoucherAmount
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumVoucherAmount"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取财务中心-订单金额统计-不带筛选"
)
public
void
testSumVoucherAmount
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取财务中心-订单金额统计失败"
);
float
totalActualAmount
=
Float
.
parseFloat
(
response
.
getJSONObject
(
"result"
).
getString
(
"totalActualAmount"
));
float
totalUnpaidAmount
=
Float
.
parseFloat
(
response
.
getJSONObject
(
"result"
).
getString
(
"totalUnpaidAmount"
));
boolean
flag
=
true
;
if
(
totalActualAmount
<
0
){
flag
=
false
;
}
Assert
.
assertEquals
(
flag
,
true
,
"获取财务中心-订单金额统计小于0"
);
}
@Test
(
description
=
"获取财务中心-订单金额统计-带筛选"
)
public
void
testSumVoucherAmount_sift
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"source"
,
"OFFLINE_SOURCE"
);
JSONArray
states
=
new
JSONArray
();
states
.
add
(
"ARREARS"
);
states
.
add
(
"PAID"
);
states
.
add
(
"WAITING"
);
states
.
add
(
"CANCEL"
);
states
.
add
(
"DISCARD"
);
states
.
add
(
"TIMEOUT"
);
jsonObject
.
put
(
"states"
,
states
);
jsonObject
.
put
(
"type"
,
"SIGN"
);
jsonObject
.
put
(
"createdStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"createdEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"lastPaymentTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"lastPaymentTimeEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"operationTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"operationTimeEnd"
,
TimeUtils
.
getCurrentTime
());
JSONArray
salesmanIds
=
new
JSONArray
();
salesmanIds
.
add
(
"1772880092185255937"
);
salesmanIds
.
add
(
"1774376463837065218"
);
jsonObject
.
put
(
"salesmanIds"
,
salesmanIds
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取财务中心-订单金额统计(带筛选)失败"
);
}
@Test
(
description
=
"获取财务中心-订单金额统计-无场馆ID、品牌ID、操作人ID"
)
public
void
testSumVoucherAmount1
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
}
\ No newline at end of file
src/main/java/com/xiaomai/cases/polar/finance/order/TestSumVoucherItemAmount.java
0 → 100644
View file @
593ac53f
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
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
TestSumVoucherItemAmount
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumVoucherItemAmount"
)
.
setLoginUser
(
LoginAccount
.
YFF_DEV
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取财务中心-订单明细小计-无筛选"
)
public
void
testPageVoucherItem
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取财务中心-订单明细小计失败"
);
float
totalActualAmount
=
Float
.
parseFloat
(
response
.
getJSONObject
(
"result"
).
getString
(
"totalActualAmount"
));
boolean
flag
=
true
;
if
(
totalActualAmount
<
0
){
flag
=
false
;
}
Assert
.
assertEquals
(
flag
,
true
,
"获取财务中心-订单明细统计小于0"
);
}
@Test
(
description
=
"获取财务中心-订单明细小计-无筛选-无场馆ID、品牌ID、操作人ID"
)
public
void
testPageVoucherItem1
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
""
);
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"brandId"
,
""
);
jsonObject
.
put
(
"studioId"
,
""
);
jsonObject
.
put
(
"operatorId"
,
""
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
false
);
}
@Test
(
description
=
"获取财务中心-订单明细小计-有筛选"
)
public
void
testPageVoucherItem_sift
(){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"receiverId"
,
""
);
jsonObject
.
put
(
"createdStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"createdEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"lastPaymentTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"lastPaymentTimeEnd"
,
TimeUtils
.
getCurrentTime
());
jsonObject
.
put
(
"operationTimeStart"
,
TimeUtils
.
getMonthFristDay
());
jsonObject
.
put
(
"operationTimeEnd"
,
TimeUtils
.
getCurrentTime
());
JSONArray
salesmanIds
=
new
JSONArray
();
salesmanIds
.
add
(
"1772880092185255937"
);
salesmanIds
.
add
(
"1774376463837065218"
);
jsonObject
.
put
(
"salesmanIds"
,
salesmanIds
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"筛选财务中心-订单明细小计失败"
);
}
}
src/main/java/com/xiaomai/enums/ApiModule.java
View file @
593ac53f
...
...
@@ -11,6 +11,8 @@ public class ApiModule {
public
static
String
Polar_Clue
=
"polar_clue"
;
public
static
String
Polar_Member
=
"polar_member"
;
//会员管理
public
static
String
Polar_Finance
=
"polar_finance"
;
//财务中心
...
...
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