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
84829639
Commit
84829639
authored
Nov 06, 2024
by
DuJunLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
54902544
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
src/main/java/com/xiaomai/cases/polar/schedule/group/TestSaveShareScheduleConfig.java
+17
-16
No files found.
src/main/java/com/xiaomai/cases/polar/schedule/group/TestSaveShareScheduleConfig.java
View file @
84829639
...
@@ -38,45 +38,46 @@ public class TestSaveShareScheduleConfig extends BaseTestImpl {
...
@@ -38,45 +38,46 @@ public class TestSaveShareScheduleConfig extends BaseTestImpl {
public
void
testSaveShareScheduleConfig
()
{
public
void
testSaveShareScheduleConfig
()
{
//点击分享获取课表配置信息:默认配置
//点击分享获取课表配置信息:默认配置
groupScheduleTools
.
getShareScheduleConfig
();
groupScheduleTools
.
getShareScheduleConfig
();
JSONObject
configInfo
=
XMJSONPath
.
getJSONObjectByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
);
JSONObject
configInfo
=
new
JSONObject
();
configInfo
=
XMJSONPath
.
getJSONObjectByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
);
//什么都不操作,走默认配置,下载课表
//什么都不操作,走默认配置,下载课表
groupScheduleTools
.
saveShareScheduleConfig
(
configInfo
);
groupScheduleTools
.
saveShareScheduleConfig
(
configInfo
);
//修改配置,然后操作下载课表check
//修改配置,然后操作下载课表check
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
String
shareTitle
=
"阿杜测试团课课表分享"
;
String
shareTitle
=
"阿杜测试团课课表分享"
;
body
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
body
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
body
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"shareTitle"
,
shareTitle
);
body
.
put
(
"shareTitle"
,
shareTitle
);
body
.
put
(
"showCustomBg"
,
false
);
body
.
put
(
"showCustomBg"
,
false
);
body
.
put
(
"showCustomQrCode"
,
false
);
body
.
put
(
"showCustomQrCode"
,
false
);
List
<
String
>
showContent
=
new
ArrayList
<>();
List
<
String
>
showContent
=
new
ArrayList
<>();
showContent
.
add
(
"COACH_NICK_NAME"
);
showContent
.
add
(
"COACH_NICK_NAME"
);
showContent
.
add
(
"AREA_NAME"
);
showContent
.
add
(
"AREA_NAME"
);
body
.
put
(
"showContent"
,
showContent
);
body
.
put
(
"showContent"
,
showContent
);
//修改后再调用获取配置接口check是否同步修改
//修改后再调用获取配置接口check是否同步修改
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
));
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.success"
))
==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
));
//查看配置信息
//查看配置信息
groupScheduleTools
.
getShareScheduleConfig
();
groupScheduleTools
.
getShareScheduleConfig
();
Assert
.
assertTrue
(
shareTitle
.
equals
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result.shareTitle"
)));
Assert
.
assertTrue
(
shareTitle
.
equals
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result.shareTitle"
)));
System
.
out
.
println
(
"***"
+
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
size
());
System
.
out
.
println
(
"***"
+
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
size
());
System
.
out
.
println
(
"***"
+!
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
contains
(
"AREA_NAME"
));
System
.
out
.
println
(
"***"
+
!
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
contains
(
"AREA_NAME"
));
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
size
()==
2
&&
!
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
contains
(
"COURSE_COLOR"
));
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
size
()
==
2
&&
!
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.showContent"
).
contains
(
"COURSE_COLOR"
));
//还原配置
//还原配置
configInfo
.
put
(
"shareTitle"
,
"课程表"
);
showContent
.
add
(
"COURSE_COLOR"
);
configInfo
.
put
(
"showContent"
,
showContent
);
groupScheduleTools
.
saveShareScheduleConfig
(
configInfo
);
groupScheduleTools
.
saveShareScheduleConfig
(
configInfo
);
//还原配置后获取配置信息
//还原配置后获取配置信息
groupScheduleTools
.
getShareScheduleConfig
();
groupScheduleTools
.
getShareScheduleConfig
();
JSONObject
configInfoA
=
XMJSONPath
.
getJSONObjectByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
);
JSONObject
configInfoA
=
XMJSONPath
.
getJSONObjectByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
);
//check configInfoA和configInfo是否相等
//check configInfoA和configInfo是否相等
Assert
.
assertTrue
(
configInfoA
.
getString
(
"shareTitle"
).
equals
(
configInfo
.
getString
(
"shareTitle"
)),
"还原配置后,课表名称没恢复"
);
Assert
.
assertTrue
(
configInfoA
.
getString
(
"shareTitle"
).
equals
(
configInfo
.
getString
(
"shareTitle"
)),
"还原配置后,课表名称没恢复"
);
Assert
.
assertTrue
(
configInfoA
.
getJSONArray
(
"showContent"
).
containsAll
(
configInfo
.
getJSONArray
(
"showContent"
)),
"还原配置后,课表内容展示没恢复默认"
);
Assert
.
assertTrue
(
configInfoA
.
getJSONArray
(
"showContent"
).
containsAll
(
configInfo
.
getJSONArray
(
"showContent"
)),
"还原配置后,课表内容展示没恢复默认"
);
}
}
...
...
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