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
36c4c632
Commit
36c4c632
authored
Jul 05, 2024
by
xyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix case
parent
8fd79888
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
3 deletions
+148
-3
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestBrandMerchantList.java
+5
-1
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestCheckUnbind.java
+41
-0
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetLatestApply.java
+4
-1
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetLatestSuccessApply.java
+40
-0
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetMerchant.java
+7
-0
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetStudioJoinBrandInfo.java
+47
-0
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestPageApply.java
+4
-1
No files found.
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestBrandMerchantList.java
View file @
36c4c632
...
...
@@ -34,12 +34,15 @@ public class TestBrandMerchantList extends XMBaseTest {
public
void
testBrandMerchantList
(){
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
//检验该品牌下有其他商户号数据
Assert
.
assertTrue
(
response
.
getJSONArray
(
"result"
).
size
()
>=
0
);
}
}
\ No newline at end of file
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestCheckUnbind.java
0 → 100644
View file @
36c4c632
package
com
.
xiaomai
.
cases
.
polar
.
brandMerchant
;
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
com.xiaomai.utils.XMJSONPath
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestCheckUnbind
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Merchant
)
.
setApiName
(
"API_checkUnbind"
)
.
setLoginUser
(
LoginAccount
.
XYY_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"xyy"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"检验未绑定状态"
)
public
void
testCheckUnbind
()
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
}
}
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetLatestApply.java
View file @
36c4c632
...
...
@@ -31,11 +31,14 @@ public class TestGetLatestApply extends XMBaseTest {
}
@Test
(
description
=
"获取最新商户号"
)
public
void
test
BrandMerchantList
(){
public
void
test
GetLatestApply
(){
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
...
...
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetLatestSuccessApply.java
0 → 100644
View file @
36c4c632
package
com
.
xiaomai
.
cases
.
polar
.
brandMerchant
;
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
com.xiaomai.utils.XMJSONPath
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestGetLatestSuccessApply
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Merchant
)
.
setApiName
(
"API_getLatestSuccessApply"
)
.
setLoginUser
(
LoginAccount
.
XYY_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"xyy"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"获取最近成功的商户号"
)
public
void
testGetLatestSuccessApply
()
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
}
}
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetMerchant.java
View file @
36c4c632
...
...
@@ -35,9 +35,15 @@ public class TestGetMerchant extends XMBaseTest {
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
//检验场馆绑定商户
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.result.studioId"
),
xmAppApi
.
getLoginInfo
().
getStudioId
());
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.result.openState"
),
"SUCCESS"
);
}
}
\ No newline at end of file
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetStudioJoinBrandInfo.java
0 → 100644
View file @
36c4c632
package
com
.
xiaomai
.
cases
.
polar
.
brandMerchant
;
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
com.xiaomai.utils.XMJSONPath
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestGetStudioJoinBrandInfo
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Merchant
)
.
setApiName
(
"API_getStudioJoinBrandInfo"
)
.
setLoginUser
(
LoginAccount
.
XYY_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"xyy"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
/**
* 乐动收银-修改记录里调用该接口
*/
@Test
(
description
=
"获取场馆品牌信息"
)
public
void
testGetStudioJoinBrandInfo
()
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"id"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.result.name"
),
"小麦乐动自动化场馆"
);
}
}
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestPageApply.java
View file @
36c4c632
...
...
@@ -37,11 +37,14 @@ public class TestPageApply extends XMBaseTest {
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"current"
,
0
);
object
.
put
(
"size"
,
20
);
object
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
object
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//调用请求
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
//获取商户修改信息至少有1次记录
int
total
=
Integer
.
parseInt
(
XMJSONPath
.
readPath
(
response
,
"$.result.total"
));
Assert
.
assertTrue
(
total
>=
0
);
}
...
...
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