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
a54a60e0
Commit
a54a60e0
authored
Jul 05, 2024
by
xyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix case
parent
d742037e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
4 deletions
+54
-4
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetApply.java
+25
-4
src/main/java/com/xiaomai/cases/polar/studioConfig/MerchantTools.java
+29
-0
No files found.
src/main/java/com/xiaomai/cases/polar/brandMerchant/TestGetApply.java
View file @
a54a60e0
package
com
.
xiaomai
.
cases
.
polar
.
brandMerchant
;
package
com
.
xiaomai
.
cases
.
polar
.
brandMerchant
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.studioConfig.MerchantTools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.RequestType
;
...
@@ -11,6 +12,8 @@ import org.testng.Assert;
...
@@ -11,6 +12,8 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
javax.annotation.Resource
;
/**
/**
* @Author: xyy
* @Author: xyy
* @CreateTime: 2024-04-23 11:48
* @CreateTime: 2024-04-23 11:48
...
@@ -19,6 +22,9 @@ import org.testng.annotations.Test;
...
@@ -19,6 +22,9 @@ import org.testng.annotations.Test;
*/
*/
public
class
TestGetApply
extends
XMBaseTest
{
public
class
TestGetApply
extends
XMBaseTest
{
@Resource
(
name
=
"merchantTools"
)
MerchantTools
merchantTools
;
@BeforeMethod
@BeforeMethod
public
void
beforeTest
(){
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Merchant
)
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Merchant
)
...
@@ -31,13 +37,28 @@ public class TestGetApply extends XMBaseTest {
...
@@ -31,13 +37,28 @@ public class TestGetApply extends XMBaseTest {
}
}
@Test
(
description
=
"获取修改记录详情"
)
@Test
(
description
=
"获取修改记录详情"
)
public
void
testPageApply
(){
public
void
testPageApply
()
{
JSONObject
body
=
merchantTools
.
getApplyPage
();
int
total
=
Integer
.
parseInt
(
body
.
getJSONObject
(
"result"
).
getString
(
"total"
));
String
applyId
=
body
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
JSONObject
object
=
new
JSONObject
();
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"id"
,
0
);
object
.
put
(
"id"
,
applyId
);
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
(
false
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
object
.
toJSONString
(),
headers
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"数据不存在"
);
if
(
total
!=
0
)
{
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"操作成功!"
);
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.result.applyType"
),
"BIND"
);
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.result.openState"
),
"SUCCESS"
);
}
else
{
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
response
,
"$.message"
),
"数据不存在"
);
}
}
}
}
}
src/main/java/com/xiaomai/cases/polar/studioConfig/MerchantTools.java
0 → 100644
View file @
a54a60e0
package
com
.
xiaomai
.
cases
.
polar
.
studioConfig
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.springframework.stereotype.Component
;
@Component
(
"merchantTools"
)
public
class
MerchantTools
extends
XMBaseTest
{
public
JSONObject
getApplyPage
(){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Merchant
)
.
setApiName
(
"API_pageApply"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
();
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"current"
,
0
);
object
.
put
(
"size"
,
20
);
object
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
object
.
put
(
"operatorId"
,
dataApi
.
getLoginInfo
().
getAdminId
());
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
object
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
return
dataApi
.
getBodyInJSON
();
}
}
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