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
e4e4048f
Commit
e4e4048f
authored
Jul 25, 2024
by
DuJunLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决线上报错case,优化代码
parent
0046e234
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
13 deletions
+38
-13
src/main/java/com/xiaomai/cases/polar/reserve/ReserveTools.java
+1
-1
src/main/java/com/xiaomai/cases/polar/schedule/camp/CampScheduleTools.java
+25
-0
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestEditCampRuleSchedule.java
+2
-1
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestGetCampScheduleItemDetail.java
+1
-1
src/main/java/com/xiaomai/cases/polar/schedule/group/TestCreateGroupRuleSchedule.java
+2
-1
src/main/java/com/xiaomai/cases/polar/schedule/group/TestEditGroupSchedule.java
+0
-3
src/main/java/com/xiaomai/cases/polar/training/TestDoForceOpenTraining.java
+1
-1
src/main/java/com/xiaomai/cases/polar/training/TestEditTraining.java
+3
-2
src/main/java/com/xiaomai/cases/polar/training/TrainingTools.java
+3
-3
No files found.
src/main/java/com/xiaomai/cases/polar/reserve/ReserveTools.java
View file @
e4e4048f
...
@@ -157,7 +157,7 @@ public class ReserveTools extends XMBaseTest {
...
@@ -157,7 +157,7 @@ public class ReserveTools extends XMBaseTest {
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"current"
,
0
);
body
.
put
(
"current"
,
0
);
body
.
put
(
"size"
,
2
00
);
body
.
put
(
"size"
,
5
00
);
if
(!
courseId
.
equals
(
""
)){
if
(!
courseId
.
equals
(
""
)){
body
.
put
(
"courseId"
,
courseId
);
body
.
put
(
"courseId"
,
courseId
);
}
}
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/CampScheduleTools.java
View file @
e4e4048f
...
@@ -277,6 +277,31 @@ public class CampScheduleTools extends XMBaseTest {
...
@@ -277,6 +277,31 @@ public class CampScheduleTools extends XMBaseTest {
}
}
/**
* 选择匹配到对应规则ID的课次
* @param n
* @param ruldId
* @return
*/
public
Set
<
String
>
getCampTableDate
(
int
n
,
String
ruldId
)
{
//查看下周训练营课表
getCampScheduleTable
(
CommUtil
.
oneKeyGetNextWeekStartDay
(),
CommUtil
.
oneKeyGetNextWeekEndDay
());
String
date
=
CommUtil
.
oneKeyGetNextWeekXDay
(
n
);
//下周N 日期时间戳
int
count
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.timetableGroups"
).
size
();
if
(
count
>
0
)
{
JSONArray
array
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.timetableGroups"
);
Set
<
String
>
scheduleIds
=
array
.
toJavaList
(
JSONObject
.
class
).
stream
()
.
filter
(
e
->
e
.
getString
(
"date"
).
equals
(
date
))
//过滤出日期等于下周N的数据
.
flatMap
(
e
->
e
.
getJSONArray
(
"timetableList"
).
toJavaList
(
JSONObject
.
class
).
stream
())
//对过滤出的数据再次取目标数据重新组合成一个新的数据流
.
filter
(
e
->
e
.
getString
(
"ruleId"
).
equals
(
ruldId
))
.
map
(
e
->
e
.
getString
(
"scheduleId"
))
//获取scheduleId
.
collect
(
Collectors
.
toSet
());
return
scheduleIds
;
//如果当天没排课,则scheduleIds.size()==0
}
return
null
;
}
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestEditCampRuleSchedule.java
View file @
e4e4048f
...
@@ -58,7 +58,7 @@ public class TestEditCampRuleSchedule extends SelectTargetTrainingCampAndGetInfo
...
@@ -58,7 +58,7 @@ public class TestEditCampRuleSchedule extends SelectTargetTrainingCampAndGetInfo
}
}
@Test
(
description
=
"编辑训练营排课规则"
)
@Test
(
description
=
"编辑训练营排课规则"
)
public
void
testEditCampRuleSchedule
()
{
public
void
testEditCampRuleSchedule
()
throws
InterruptedException
{
//获取选择的训练营ID
//获取选择的训练营ID
campId
=
super
.
campId
;
campId
=
super
.
campId
;
//获取训练营活动的指定教练ID
//获取训练营活动的指定教练ID
...
@@ -89,6 +89,7 @@ public class TestEditCampRuleSchedule extends SelectTargetTrainingCampAndGetInfo
...
@@ -89,6 +89,7 @@ public class TestEditCampRuleSchedule extends SelectTargetTrainingCampAndGetInfo
//给会员报名
//给会员报名
trainingTools
.
doSignCampOrder
(
memberId
,
this
.
price
,
this
.
campId
);
trainingTools
.
doSignCampOrder
(
memberId
,
this
.
price
,
this
.
campId
);
orderId
=
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result"
);
orderId
=
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result"
);
Thread
.
sleep
(
2000
);
//check 预约记录(训练营预约记录,根据训练营活动筛选)
//check 预约记录(训练营预约记录,根据训练营活动筛选)
JSONArray
reserverList
=
reserveTools
.
getPageByStudio
(
""
,
""
,
""
,
""
,
null
,
JSONArray
reserverList
=
reserveTools
.
getPageByStudio
(
""
,
""
,
""
,
""
,
null
,
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestGetCampScheduleItemDetail.java
View file @
e4e4048f
...
@@ -80,7 +80,7 @@ public class TestGetCampScheduleItemDetail extends SelectTargetTrainingCampAndGe
...
@@ -80,7 +80,7 @@ public class TestGetCampScheduleItemDetail extends SelectTargetTrainingCampAndGe
ruldId
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
).
getJSONObject
(
0
).
getString
(
"ruleId"
);
ruldId
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
).
getJSONObject
(
0
).
getString
(
"ruleId"
);
//查看下周5的日课表,期望值无数据
//查看下周5的日课表,期望值无数据
Set
<
String
>
scheduleIds5
=
campScheduleTools
.
getCampTableDate
(
11
);
Set
<
String
>
scheduleIds5
=
campScheduleTools
.
getCampTableDate
(
11
,
ruldId
);
Assert
.
assertTrue
(
scheduleIds5
.
size
()
==
0
||
scheduleIds5
==
null
,
"周五没排课,但是检查出有课次"
);
Assert
.
assertTrue
(
scheduleIds5
.
size
()
==
0
||
scheduleIds5
==
null
,
"周五没排课,但是检查出有课次"
);
//查看下周日的日课表,有数据,并查看课次详情
//查看下周日的日课表,有数据,并查看课次详情
...
...
src/main/java/com/xiaomai/cases/polar/schedule/group/TestCreateGroupRuleSchedule.java
View file @
e4e4048f
...
@@ -53,7 +53,7 @@ public class TestCreateGroupRuleSchedule extends BaseTestImpl {
...
@@ -53,7 +53,7 @@ public class TestCreateGroupRuleSchedule extends BaseTestImpl {
}
}
@Test
(
description
=
"测试新建团课排课"
)
@Test
(
description
=
"测试新建团课排课"
)
public
void
testCreateGroupRuleSchedule
()
{
public
void
testCreateGroupRuleSchedule
()
throws
InterruptedException
{
//查询今日待上课的数据
//查询今日待上课的数据
HomeTools
homeTools
=
new
HomeTools
();
HomeTools
homeTools
=
new
HomeTools
();
int
num
=
homeTools
.
queryTodaySchedule
().
getJSONArray
(
"result"
).
size
();
int
num
=
homeTools
.
queryTodaySchedule
().
getJSONArray
(
"result"
).
size
();
...
@@ -91,6 +91,7 @@ public class TestCreateGroupRuleSchedule extends BaseTestImpl {
...
@@ -91,6 +91,7 @@ public class TestCreateGroupRuleSchedule extends BaseTestImpl {
int
size
=
result
.
size
();
int
size
=
result
.
size
();
String
ruldId
=
XMJSONPath
.
readPath
(
result
.
getJSONObject
(
0
),
"$.ruleId"
);
String
ruldId
=
XMJSONPath
.
readPath
(
result
.
getJSONObject
(
0
),
"$.ruleId"
);
groupScheduleTools
.
delGroupRuleSchedule
(
ruldId
,
true
);
groupScheduleTools
.
delGroupRuleSchedule
(
ruldId
,
true
);
Thread
.
sleep
(
1000
);
JSONArray
result2
=
groupScheduleTools
.
getGroupRuleScheduleList
(
courseId
,
chiefCoachIdS
);
JSONArray
result2
=
groupScheduleTools
.
getGroupRuleScheduleList
(
courseId
,
chiefCoachIdS
);
//删除成功后,统计查询到的目标日程数量是否-1
//删除成功后,统计查询到的目标日程数量是否-1
...
...
src/main/java/com/xiaomai/cases/polar/schedule/group/TestEditGroupSchedule.java
View file @
e4e4048f
...
@@ -152,9 +152,6 @@ public class TestEditGroupSchedule extends UniversalDataScheduling {
...
@@ -152,9 +152,6 @@ public class TestEditGroupSchedule extends UniversalDataScheduling {
});
});
}
}
}
}
...
...
src/main/java/com/xiaomai/cases/polar/training/TestDoForceOpenTraining.java
View file @
e4e4048f
...
@@ -64,7 +64,7 @@ public class TestDoForceOpenTraining extends BaseCreateTrainingData {
...
@@ -64,7 +64,7 @@ public class TestDoForceOpenTraining extends BaseCreateTrainingData {
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
).
size
()
>
0
,
"活动创建后,根据活动名称全局搜索没有数据"
);
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
).
size
()
>
0
,
"活动创建后,根据活动名称全局搜索没有数据"
);
Thread
.
sleep
(
5000
);
//延迟5
秒后,活动达到报名时间(可能状态没同步,定时任务没到时间执行,但是数据库中已是报名中)
Thread
.
sleep
(
10000
);
//延迟10
秒后,活动达到报名时间(可能状态没同步,定时任务没到时间执行,但是数据库中已是报名中)
//4.对报名中的活动操作立即成营
//4.对报名中的活动操作立即成营
JSONObject
body1
=
new
JSONObject
();
JSONObject
body1
=
new
JSONObject
();
body1
.
put
(
"operatorId"
,
dataApi
.
getLoginInfo
().
getAdminId
());
body1
.
put
(
"operatorId"
,
dataApi
.
getLoginInfo
().
getAdminId
());
...
...
src/main/java/com/xiaomai/cases/polar/training/TestEditTraining.java
View file @
e4e4048f
...
@@ -83,13 +83,14 @@ public class TestEditTraining extends BaseCreateTrainingData {
...
@@ -83,13 +83,14 @@ public class TestEditTraining extends BaseCreateTrainingData {
}
}
@Test
(
description
=
"编辑已发布训练营活动"
)
@Test
(
description
=
"编辑已发布训练营活动"
,
priority
=
1
)
public
void
editPublishTraining
()
{
public
void
editPublishTraining
()
throws
InterruptedException
{
//1.查询关联对应课程的活动数据
//1.查询关联对应课程的活动数据
trainingTools
.
searchTrainingList
(
courseId
,
""
,
new
ArrayList
<>());
trainingTools
.
searchTrainingList
(
courseId
,
""
,
new
ArrayList
<>());
int
listCountBefore
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.records"
).
size
();
int
listCountBefore
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.records"
).
size
();
//2.创建已发布的训练营活动
//2.创建已发布的训练营活动
oneKeytTrainingId
=
trainingTools
.
oneKeyCreateTraining
(
courseId
,
trainerListIdS
);
oneKeytTrainingId
=
trainingTools
.
oneKeyCreateTraining
(
courseId
,
trainerListIdS
);
Thread
.
sleep
(
2000
);
//3.列表搜索数据check
//3.列表搜索数据check
trainingTools
.
searchTrainingList
(
courseId
,
""
,
new
ArrayList
<>());
trainingTools
.
searchTrainingList
(
courseId
,
""
,
new
ArrayList
<>());
int
listCountAfter
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.records"
).
size
();
int
listCountAfter
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.records"
).
size
();
...
...
src/main/java/com/xiaomai/cases/polar/training/TrainingTools.java
View file @
e4e4048f
...
@@ -26,8 +26,8 @@ public class TrainingTools extends XMBaseTest {
...
@@ -26,8 +26,8 @@ public class TrainingTools extends XMBaseTest {
String
openEndDate0
=
CommUtil
.
getNDayEndTimeTamp
(
2
);
//后天23:59:59
String
openEndDate0
=
CommUtil
.
getNDayEndTimeTamp
(
2
);
//后天23:59:59
long
currentTimestamp
=
System
.
currentTimeMillis
();
long
currentTimestamp
=
System
.
currentTimeMillis
();
// 在当前时间的基础上,加上
5秒(5
000毫秒)
// 在当前时间的基础上,加上
10秒(10
000毫秒)
long
futureTimestamp
=
currentTimestamp
+
5
000
;
long
futureTimestamp
=
currentTimestamp
+
10
000
;
String
futureTimestampS
=
String
.
valueOf
(
futureTimestamp
);
String
futureTimestampS
=
String
.
valueOf
(
futureTimestamp
);
...
@@ -234,7 +234,7 @@ public class TrainingTools extends XMBaseTest {
...
@@ -234,7 +234,7 @@ public class TrainingTools extends XMBaseTest {
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"current"
,
0
);
body
.
put
(
"current"
,
0
);
body
.
put
(
"size"
,
2
0
);
body
.
put
(
"size"
,
50
0
);
body
.
put
(
"courseId"
,
courseId
);
body
.
put
(
"courseId"
,
courseId
);
body
.
put
(
"stateList"
,
stateList
);
body
.
put
(
"stateList"
,
stateList
);
if
(!
trainingName
.
isEmpty
())
{
if
(!
trainingName
.
isEmpty
())
{
...
...
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