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
23a17183
Commit
23a17183
authored
Jul 31, 2024
by
DuJunLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
930c0c82
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
213 additions
and
129 deletions
+213
-129
src/main/java/com/xiaomai/cases/polar/coupon/TestBatchSendCouponToMember.java
+2
-1
src/main/java/com/xiaomai/cases/polar/schedule/camp/CampScheduleTools.java
+49
-10
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestDelCampScheduleItem.java
+42
-40
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestEditCampRuleSchedule.java
+3
-1
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestEditCampScheduleItem.java
+0
-0
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestGetCampScheduleItemDetail.java
+6
-3
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestGetCampScheduleTable.java
+3
-1
src/main/java/com/xiaomai/cases/polar/schedule/group/GroupScheduleTools.java
+26
-12
src/main/java/com/xiaomai/cases/polar/schedule/group/TestCreateGroupRuleSchedule.java
+1
-1
src/main/java/com/xiaomai/cases/polar/schedule/group/TestDelGroupScheduleItem.java
+40
-40
src/main/java/com/xiaomai/cases/polar/schedule/group/TestEditGroupRuleSchedule.java
+3
-1
src/main/java/com/xiaomai/cases/polar/schedule/group/TestEditGroupSchedule.java
+0
-0
src/main/java/com/xiaomai/cases/polar/schedule/group/TestGetGroupScheduleTable.java
+3
-1
src/main/java/com/xiaomai/cases/polar/training/TestDoForceOpenTraining.java
+9
-7
src/main/java/com/xiaomai/cases/polar/training/TestDoSignCampOrder.java
+7
-5
src/main/java/com/xiaomai/cases/polar/training/TestEditTraining.java
+3
-1
src/main/java/com/xiaomai/cases/polar/training/TestSearchTrainingAccountRecordsList.java
+3
-1
src/main/java/com/xiaomai/cases/polar/training/TestSearchTrainingList.java
+3
-1
src/main/java/com/xiaomai/cases/polar/training/TrainingTools.java
+10
-3
No files found.
src/main/java/com/xiaomai/cases/polar/coupon/TestBatchSendCouponToMember.java
View file @
23a17183
...
...
@@ -85,7 +85,8 @@ public class TestBatchSendCouponToMember extends SelectTargetTrainingCampAndGetI
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"couponId"
,
couponId
);
body
.
put
(
"receiverIds"
,
receiverIds
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
String
taskId
=
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.result"
);
//check任务中心生成一条任务
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/CampScheduleTools.java
View file @
23a17183
...
...
@@ -10,6 +10,7 @@ import com.xiaomai.utils.CommUtil;
import
com.xiaomai.utils.XMBaseTest
;
import
com.xiaomai.utils.XMJSONPath
;
import
org.springframework.stereotype.Component
;
import
org.testng.Assert
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -74,7 +75,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"assistCoachIds"
,
assistCoachIds
);
//设置助教,可设置为空 new ArrayList<>();
body
.
put
(
"force"
,
force
);
//是否有冲突 true,false
body
.
put
(
"enableCustomerReserve"
,
"NO"
);
//能否用户自己约课,不能
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
/**
...
...
@@ -115,7 +118,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"assistCoachIds"
,
new
ArrayList
<>());
//设置助教,可设置为空 new ArrayList<>();
body
.
put
(
"force"
,
force
);
//是否有冲突 true,false
body
.
put
(
"enableCustomerReserve"
,
"NO"
);
//能否用户自己约课,不能
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -146,7 +151,9 @@ public class CampScheduleTools extends XMBaseTest {
body.put("coachId", coachId);
}*/
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -162,7 +169,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"force"
,
true
);
//删除学员约课记录
body
.
put
(
"ruleId"
,
ruleId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -180,7 +189,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"startDate"
,
startDate
);
body
.
put
(
"endDate"
,
endDate
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
if
(
Integer
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result.totalCount"
))
>
0
)
{
return
dataApi
.
getBodyInJSON
().
getJSONObject
(
"result"
).
getJSONArray
(
"timetableGroups"
).
getJSONObject
(
0
).
getJSONArray
(
"timetableList"
);
}
...
...
@@ -205,7 +216,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"startDate"
,
startDate
);
body
.
put
(
"endDate"
,
endDate
);
body
.
put
(
"weekdays"
,
weekdaysList
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
return
Integer
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result"
));
}
...
...
@@ -220,7 +233,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
ruldId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -235,7 +250,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
scheduleId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
/**
...
...
@@ -251,7 +268,9 @@ public class CampScheduleTools extends XMBaseTest {
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"scheduleId"
,
scheduleId
);
body
.
put
(
"applyRestRule"
,
applyRestRule
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
/**
...
...
@@ -283,7 +302,7 @@ public class CampScheduleTools extends XMBaseTest {
* @param ruldId
* @return
*/
public
Set
<
String
>
getCampTableDate
(
int
n
,
String
ruldId
)
{
/*
public Set<String> getCampTableDate(int n,String ruldId) {
//查看下周训练营课表
getCampScheduleTable(CommUtil.oneKeyGetNextWeekStartDay(), CommUtil.oneKeyGetNextWeekEndDay());
String date = CommUtil.oneKeyGetNextWeekXDay(n);//下周N 日期时间戳
...
...
@@ -301,6 +320,26 @@ public class CampScheduleTools extends XMBaseTest {
}
return null;
}*/
public
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"
);
String
scheduleId
=
array
.
toJavaList
(
JSONObject
.
class
).
stream
()
.
filter
(
e
->
e
.
getString
(
"date"
).
equals
(
date
))
//过滤出日期等于下周N的数据
.
flatMap
(
e
->
e
.
getJSONArray
(
"timetableList"
).
toJavaList
(
JSONObject
.
class
).
stream
())
//对过滤出的数据再次取目标数据重新组合成一个新的数据流
.
filter
(
e
->
null
!=
e
.
getString
(
"ruleId"
))
.
filter
(
e
->
e
.
getString
(
"ruleId"
).
equals
(
ruldId
))
.
map
(
e
->
e
.
getString
(
"scheduleId"
))
//获取scheduleId
.
findFirst
().
orElse
(
""
);
return
scheduleId
;
//如果当天没排课,
}
return
""
;
}
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestDelCampScheduleItem.java
View file @
23a17183
This diff is collapsed.
Click to expand it.
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestEditCampRuleSchedule.java
View file @
23a17183
...
...
@@ -124,7 +124,9 @@ public class TestEditCampRuleSchedule extends SelectTargetTrainingCampAndGetInfo
body
.
put
(
"endDate"
,
CommUtil
.
getNDayEndTimeTamp
(
22
));
//结束日期缩短了20天,
body
.
put
(
"force"
,
true
);
body
.
put
(
"retainBooking"
,
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
//查询训练营日程详情,check修改项是否被同步修改
campScheduleTools
.
getCampRuleScheduleDetail
(
ruldId
);
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestEditCampScheduleItem.java
View file @
23a17183
This diff is collapsed.
Click to expand it.
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestGetCampScheduleItemDetail.java
View file @
23a17183
package
com
.
xiaomai
.
cases
.
polar
.
schedule
.
camp
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.order.OrderTools
;
...
...
@@ -81,8 +82,8 @@ public class TestGetCampScheduleItemDetail extends SelectTargetTrainingCampAndGe
ruldId
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
).
getJSONObject
(
0
).
getString
(
"ruleId"
);
//查看下周5的日课表,期望值无数据
S
et
<
String
>
scheduleIds5
=
campScheduleTools
.
getCampTableDate
(
11
,
ruldId
);
Assert
.
assertTrue
(
scheduleIds5
.
size
()
==
0
||
scheduleIds5
==
null
,
"周五没排课,但是检查出有课次"
);
S
tring
scheduleIds5
=
campScheduleTools
.
getCampTableDate
(
11
,
ruldId
);
Assert
.
assertTrue
(
StringUtils
.
isEmpty
(
scheduleIds5
)
,
"周五没排课,但是检查出有课次"
);
//查看下周日的日课表,有数据,并查看课次详情
String
startDate
=
CommUtil
.
oneKeyGetNextWeekXDay
(
13
);
//下周日00点时间
...
...
@@ -104,7 +105,9 @@ public class TestGetCampScheduleItemDetail extends SelectTargetTrainingCampAndGe
body
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
scheduleId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
//断言check
//课次中有1个学员check
...
...
src/main/java/com/xiaomai/cases/polar/schedule/camp/TestGetCampScheduleTable.java
View file @
23a17183
...
...
@@ -104,7 +104,9 @@ public class TestGetCampScheduleTable extends SelectTargetTrainingCampAndGetInfo
body
.
put
(
"coachId"
,
coachId
);
body
.
put
(
"statusSet"
,
statusSet
);
body
.
put
(
"venueAreaId"
,
venueAreaId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
int
resultCount
=
Integer
.
parseInt
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.result.totalCount"
));
Assert
.
assertTrue
(
resultCount
>=
total
,
"查询到的课表数据和预期不一致"
);
}
...
...
src/main/java/com/xiaomai/cases/polar/schedule/group/GroupScheduleTools.java
View file @
23a17183
...
...
@@ -12,6 +12,7 @@ import com.xiaomai.utils.XMBaseTest;
import
com.xiaomai.utils.XMJSONPath
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.testng.Assert
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
...
...
@@ -74,7 +75,9 @@ public class GroupScheduleTools extends XMBaseTest {
body
.
put
(
"endDate"
,
CommUtil
.
getNDayEndTimeTamp
(
60
));
//排课结束日期,这里就设置自动延顺60天,结束日期会覆盖你传的endDate
}
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -98,7 +101,8 @@ public class GroupScheduleTools extends XMBaseTest {
if
(
coachId
!=
null
&&
coachId
.
length
()
!=
0
)
{
body
.
put
(
"coachId"
,
coachId
);
}
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
return
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
);
}
...
...
@@ -144,7 +148,9 @@ public class GroupScheduleTools extends XMBaseTest {
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"force"
,
force
);
body
.
put
(
"ruleId"
,
ruleId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -228,7 +234,9 @@ public class GroupScheduleTools extends XMBaseTest {
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
ruldId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -248,7 +256,9 @@ public class GroupScheduleTools extends XMBaseTest {
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
scheduleId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
return
dataApi
.
getBodyInJSON
().
getJSONObject
(
"result"
);
}
...
...
@@ -309,7 +319,9 @@ public class GroupScheduleTools extends XMBaseTest {
body
.
put
(
"assistCoachIds"
,
new
ArrayList
());
body
.
put
(
"spanMinutes"
,
60
);
body
.
put
(
"force"
,
false
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -331,7 +343,9 @@ public class GroupScheduleTools extends XMBaseTest {
body
.
put
(
"scheduleId"
,
scheduleId
);
body
.
put
(
"applyRestRule"
,
false
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
/**
...
...
@@ -367,7 +381,7 @@ public class GroupScheduleTools extends XMBaseTest {
* @param ruldId
* @return
*/
public
S
et
<
String
>
getTableDate
(
int
n
,
String
ruldId
)
{
public
S
tring
getTableDate
(
int
n
,
String
ruldId
)
{
//查看团课课表
getGroupScheduleTable
(
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekStartDay
()),
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekEndDay
()),
""
);
//获取下周周N及后续的课次
...
...
@@ -375,17 +389,17 @@ public class GroupScheduleTools extends XMBaseTest {
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
()
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
->
null
!=
e
.
getString
(
"ruleId"
))
.
filter
(
e
->
e
.
getString
(
"ruleId"
).
equals
(
ruldId
))
.
map
(
e
->
e
.
getString
(
"scheduleId"
))
//获取scheduleId
.
collect
(
Collectors
.
toSet
()
);
return
scheduleIds
;
//如果当天没排课,则scheduleIds.size()==0
.
findFirst
().
orElse
(
""
);
return
scheduleIds
;
}
return
null
;
return
""
;
}
...
...
src/main/java/com/xiaomai/cases/polar/schedule/group/TestCreateGroupRuleSchedule.java
View file @
23a17183
...
...
@@ -80,7 +80,7 @@ public class TestCreateGroupRuleSchedule extends BaseTestImpl {
List
<
String
>
assistCoachIdS
=
groupScheduleTools
.
getStudioAdminId
(
assistCoachIds
);
//1-创建排课日程
groupScheduleTools
.
createGroupRuleSchedule
(
courseId
,
chiefCoachIdS
,
todayStartTimeTamp
,
endDateTimeTamp
,
venueAreaIds
,
assistCoachIdS
,
fals
e
,
1
,
480
);
groupScheduleTools
.
createGroupRuleSchedule
(
courseId
,
chiefCoachIdS
,
todayStartTimeTamp
,
endDateTimeTamp
,
venueAreaIds
,
assistCoachIdS
,
tru
e
,
1
,
480
);
//2-查询排课日程
JSONArray
result
=
groupScheduleTools
.
getGroupRuleScheduleList
(
courseId
,
chiefCoachIdS
);
String
ruldId
=
XMJSONPath
.
readPath
(
result
.
getJSONObject
(
0
),
"$.ruleId"
);
...
...
src/main/java/com/xiaomai/cases/polar/schedule/group/TestDelGroupScheduleItem.java
View file @
23a17183
package
com
.
xiaomai
.
cases
.
polar
.
schedule
.
group
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
...
...
@@ -38,59 +39,60 @@ public class TestDelGroupScheduleItem extends UniversalDataScheduling {
@Test
(
description
=
"删除当前课次"
)
public
void
testDelCurrentGroupSchedule
()
{
//获取下周四的课次ID(匹配到刚创建的规则ID)
S
et
<
String
>
scheduleIds
=
groupScheduleTools
.
getTableDate
(
10
,
groupRuldId
);
S
tring
scheduleId
=
groupScheduleTools
.
getTableDate
(
10
,
groupRuldId
);
//如果课次ID有值则继续走删除的case
if
(
scheduleIds
!=
null
&&
scheduleIds
.
size
()
!=
0
)
{
scheduleIds
.
stream
().
forEach
(
scheduleId
->
{
JSONObject
body
=
new
JSONObject
(
);
body
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdmin
Id
());
body
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudio
Id
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
()
);
body
.
put
(
"applyRestRule"
,
false
);
body
.
put
(
"scheduleId"
,
scheduleId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
//删除成功后check 下周四课表是否有数据
groupScheduleTools
.
getGroupScheduleTable
(
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekXDay
(
10
)),
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekEndXDay
(
4
)),
courseId
);
Long
countA
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.timetableGroups"
).
toJavaList
(
JSONObject
.
class
).
stream
()
.
flatMap
(
e
->
e
.
getJSONArray
(
"timetableList"
).
toJavaList
(
JSONObject
.
class
).
stream
()
)
.
filter
(
e
->
e
.
getString
(
"scheduleId"
).
equals
(
scheduleId
)).
count
();
Assert
.
assertTrue
(
countA
==
0
,
"删除课次后,课表中后端返回数据有问题,目前还能发现数据"
);
}
);
if
(
!
StringUtils
.
isEmpty
(
scheduleId
)
)
{
JSONObject
body1
=
new
JSONObject
();
body1
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
()
);
body1
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudio
Id
());
body1
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrand
Id
());
body1
.
put
(
"applyRestRule"
,
false
);
body1
.
put
(
"scheduleId"
,
scheduleId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body1
.
toString
(),
headers
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.success"
))
==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
)
);
//删除成功后check 下周四课表是否有数据
groupScheduleTools
.
getGroupScheduleTable
(
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekXDay
(
10
)),
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekEndXDay
(
4
)),
courseId
);
Long
countA
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.timetableGroups"
).
toJavaList
(
JSONObject
.
class
).
stream
(
)
.
flatMap
(
e
->
e
.
getJSONArray
(
"timetableList"
).
toJavaList
(
JSONObject
.
class
).
stream
())
.
filter
(
e
->
e
.
getString
(
"scheduleId"
).
equals
(
scheduleId
)).
count
(
);
Assert
.
assertTrue
(
countA
==
0
,
"删除课次后,课表中后端返回数据有问题,目前还能发现数据"
);
}
}
@Test
(
description
=
"删除当前及后续课次"
,
dependsOnMethods
=
{
"testDelCurrentGroupSchedule"
},
alwaysRun
=
true
)
@Test
(
description
=
"删除当前及后续课次"
,
dependsOnMethods
=
{
"testDelCurrentGroupSchedule"
},
alwaysRun
=
true
)
public
void
testDelCurrentAndSubsequentGroupSchedule
()
{
//获取下周三的课次ID(匹配到对应的规则ID)
S
et
<
String
>
scheduleIds
=
groupScheduleTools
.
getTableDate
(
9
,
groupRuldId
);
S
tring
scheduleIdsG
=
groupScheduleTools
.
getTableDate
(
9
,
groupRuldId
);
//如果课次ID有值则继续走删除的case
if
(
scheduleIds
!=
null
&&
scheduleIds
.
size
()
!=
0
)
{
scheduleIds
.
stream
().
forEach
(
scheduleId
->
{
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
body
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"applyRestRule"
,
true
);
body
.
put
(
"scheduleId"
,
scheduleId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
//删除成功后check 从下周三到下周日课表是否有数据
groupScheduleTools
.
getGroupScheduleTable
(
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekXDay
(
9
)),
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekEndDay
()),
courseId
);
Long
countB
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.timetableGroups"
).
toJavaList
(
JSONObject
.
class
).
stream
()
.
flatMap
(
e
->
e
.
getJSONArray
(
"timetableList"
).
toJavaList
(
JSONObject
.
class
).
stream
())
.
filter
(
e
->
null
!=
e
.
getString
(
"ruleId"
))
.
filter
(
e
->
e
.
getString
(
"ruleId"
).
equals
(
groupRuldId
)).
count
();
Assert
.
assertTrue
(
countB
==
0
,
"删除当前及后续课次后,课表中后端返回数据有问题,目前还能发现数据"
);
});
if
(!
StringUtils
.
isEmpty
(
scheduleIdsG
))
{
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
body
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"applyRestRule"
,
true
);
body
.
put
(
"scheduleId"
,
scheduleIdsG
);
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"
));
//删除成功后check 从下周三到下周日课表是否有数据
groupScheduleTools
.
getGroupScheduleTable
(
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekXDay
(
9
)),
Long
.
valueOf
(
CommUtil
.
oneKeyGetNextWeekEndDay
()),
courseId
);
Long
countB
=
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result.timetableGroups"
).
toJavaList
(
JSONObject
.
class
).
stream
()
.
flatMap
(
e
->
e
.
getJSONArray
(
"timetableList"
).
toJavaList
(
JSONObject
.
class
).
stream
())
.
filter
(
e
->
null
!=
e
.
getString
(
"ruleId"
))
.
filter
(
e
->
e
.
getString
(
"ruleId"
).
equals
(
groupRuldId
)).
count
();
Assert
.
assertTrue
(
countB
==
0
,
"删除当前及后续课次后,课表中后端返回数据有问题,目前还能发现数据"
);
}
}
@AfterTest
(
description
=
"删除此case创建的日程"
)
public
void
delData
(){
public
void
delData
()
{
List
<
String
>
ruleIdIds
=
new
ArrayList
<>();
//查询这个case创建的相关日程
JSONArray
result
=
groupScheduleTools
.
getGroupRuleScheduleList
(
courseId
,
chiefCoachIdS
);
...
...
@@ -114,7 +116,6 @@ public class TestDelGroupScheduleItem extends UniversalDataScheduling {
}
}
\ No newline at end of file
src/main/java/com/xiaomai/cases/polar/schedule/group/TestEditGroupRuleSchedule.java
View file @
23a17183
...
...
@@ -86,7 +86,9 @@ public class TestEditGroupRuleSchedule extends BaseTestImpl {
body
.
put
(
"endDate"
,
CommUtil
.
getNDayEndTimeTamp
(
0
));
//结束日期缩短了,改成当天结束
body
.
put
(
"force"
,
false
);
body
.
put
(
"retainBooking"
,
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
//4-查看日程详情,check修改内容是否同步变更
groupScheduleTools
.
getGroupRuleScheduleDetail
(
ruldId
);
...
...
src/main/java/com/xiaomai/cases/polar/schedule/group/TestEditGroupSchedule.java
View file @
23a17183
This diff is collapsed.
Click to expand it.
src/main/java/com/xiaomai/cases/polar/schedule/group/TestGetGroupScheduleTable.java
View file @
23a17183
...
...
@@ -126,7 +126,9 @@ public class TestGetGroupScheduleTable extends BaseTestImpl {
body
.
put
(
"coachId"
,
coachId
);
body
.
put
(
"venueAreaId"
,
venueAreaId
);
body
.
put
(
"statusSet"
,
statusSet
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
int
resultCount
=
Integer
.
parseInt
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.result.totalCount"
));
Assert
.
assertTrue
(
resultCount
>=
totalCount
,
"查询到的课表数据和预期不一致"
);
...
...
src/main/java/com/xiaomai/cases/polar/training/TestDoForceOpenTraining.java
View file @
23a17183
...
...
@@ -54,9 +54,9 @@ public class TestDoForceOpenTraining extends BaseCreateTrainingData {
if
(
status
.
equals
(
"APPLY_NOT_START"
))
{
//对报名未开始的活动操作立即成营
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"operatorId"
,
data
Api
.
getLoginInfo
().
getAdminId
());
body
.
put
(
"studioId"
,
data
Api
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
data
Api
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"operatorId"
,
xmApp
Api
.
getLoginInfo
().
getAdminId
());
body
.
put
(
"studioId"
,
xmApp
Api
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
xmApp
Api
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
id
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
);
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
),
"只有报名中的训练营能【立即成营】"
);
...
...
@@ -80,11 +80,13 @@ public class TestDoForceOpenTraining extends BaseCreateTrainingData {
if
(
goalN
>
0
){
goalId
=
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result.records[0].id"
);
JSONObject
body1
=
new
JSONObject
();
body1
.
put
(
"operatorId"
,
data
Api
.
getLoginInfo
().
getAdminId
());
body1
.
put
(
"studioId"
,
data
Api
.
getLoginInfo
().
getStudioId
());
body1
.
put
(
"brandId"
,
data
Api
.
getLoginInfo
().
getBrandId
());
body1
.
put
(
"operatorId"
,
xmApp
Api
.
getLoginInfo
().
getAdminId
());
body1
.
put
(
"studioId"
,
xmApp
Api
.
getLoginInfo
().
getStudioId
());
body1
.
put
(
"brandId"
,
xmApp
Api
.
getLoginInfo
().
getBrandId
());
body1
.
put
(
"id"
,
goalId
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body1
.
toString
(),
headers
).
assetsSuccess
(
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body1
.
toString
(),
headers
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
));
}
...
...
src/main/java/com/xiaomai/cases/polar/training/TestDoSignCampOrder.java
View file @
23a17183
...
...
@@ -82,7 +82,7 @@ public class TestDoSignCampOrder extends SelectTargetTrainingCampAndGetInfo {
//退单后再搜索报名记录check
trainingTools
.
getTrainingApplyRecordsList
(
this
.
campId
,
phone
);
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
dataApi
.
getApi_response
(),
"$.result"
).
size
()
==
0
,
"给学员退单后,在报名列表中还能查询到数据"
);
Thread
.
sleep
(
1
000
);
Thread
.
sleep
(
2
000
);
//退单后check训练营报名记录(入口:报名记录):根据训练营,报名记录状态,来源
List
<
String
>
cardState
=
new
ArrayList
<>();
...
...
@@ -123,7 +123,7 @@ public class TestDoSignCampOrder extends SelectTargetTrainingCampAndGetInfo {
Assert
.
assertEquals
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
),
"签单失败,已报名该训练营无需重复操作"
);
}
@Test
(
description
=
"给学员报名训练营活动构造待支付订单"
,
priority
=
1
)
@Test
(
description
=
"给学员报名训练营活动构造待支付订单"
,
dependsOnMethods
=
{
"testDoSignCampOrder"
},
alwaysRun
=
true
)
public
void
testUnpaidOrder
()
throws
InterruptedException
{
//搜索目标会员
String
phone
=
"15658063769"
;
...
...
@@ -131,8 +131,8 @@ public class TestDoSignCampOrder extends SelectTargetTrainingCampAndGetInfo {
if
(
memberId2
.
isEmpty
())
{
memberId2
=
tools
.
create
(
"晨晨爸爸"
,
phone
).
getString
(
"result"
);
}
Thread
.
sleep
(
3
000
);
//报名接口做了重复调用限制,间隔3000秒,否则提示:调用过于频繁,请稍后重试
Thread
.
sleep
(
4
000
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
...
...
@@ -149,7 +149,9 @@ public class TestDoSignCampOrder extends SelectTargetTrainingCampAndGetInfo {
campInfo
.
put
(
"campId"
,
this
.
campId
);
body
.
put
(
"camp"
,
campInfo
);
body
.
put
(
"paymentWays"
,
new
JSONArray
());
//支付方式传空
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
orderId
=
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.result"
);
//报名成功后根据会员手机号,在报名会员列表搜索报名数据
trainingTools
.
getTrainingApplyRecordsList
(
this
.
campId
,
phone
);
...
...
src/main/java/com/xiaomai/cases/polar/training/TestEditTraining.java
View file @
23a17183
...
...
@@ -130,7 +130,9 @@ public class TestEditTraining extends BaseCreateTrainingData {
editBody
.
put
(
"xcxSaleStatus"
,
"YES"
);
//开启小程序售卖
editBody
.
put
(
"underlinePrice"
,
29.9
);
//可以修改
editBody
.
put
(
"id"
,
oneKeytTrainingId
);
//活动ID
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
editBody
.
toString
(),
headers
).
assetsSuccess
(
true
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
editBody
.
toString
(),
headers
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
xmAppApi
.
getApi_response
(),
"$.message"
));
//5.查看活动详情,check 不能修改项和一修改项是否被同步修改
trainingTools
.
findTrainingDetailById
(
oneKeytTrainingId
);
//5.1不能修改的字段check(修改后和修改前比对)
...
...
src/main/java/com/xiaomai/cases/polar/training/TestSearchTrainingAccountRecordsList.java
View file @
23a17183
...
...
@@ -99,7 +99,9 @@ public class TestSearchTrainingAccountRecordsList extends SelectTargetTrainingCa
}
body
.
put
(
"memberCardStateList"
,
memberCardState
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
//有存量数据,理论上每个查询都会至少有1条数据
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
xmAppApi
.
getApi_response
(),
"$.result.records"
).
size
()
>=
flag
,
"没有搜索到相关数据"
);
...
...
src/main/java/com/xiaomai/cases/polar/training/TestSearchTrainingList.java
View file @
23a17183
...
...
@@ -86,7 +86,9 @@ public class TestSearchTrainingList extends BaseCreateTrainingData {
body
.
put
(
"courseId"
,
courseId
);
body
.
put
(
"stateList"
,
stateList
);
body
.
put
(
"title"
,
title
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
body
.
toString
(),
headers
).
assetsSuccess
(
true
);
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"
));
//有存量数据,理论上每个查询都会至少有1条数据
Assert
.
assertTrue
(
XMJSONPath
.
getJSONArrayByReadPath
(
xmAppApi
.
getApi_response
(),
"$.result.records"
).
size
()>=
1
,
"没有搜索到相关数据"
);
...
...
src/main/java/com/xiaomai/cases/polar/training/TrainingTools.java
View file @
23a17183
...
...
@@ -9,6 +9,7 @@ import com.xiaomai.enums.Terminal;
import
com.xiaomai.utils.*
;
import
org.springframework.stereotype.Component
;
import
org.testng.Assert
;
import
org.testng.Reporter
;
import
java.util.List
;
...
...
@@ -367,7 +368,9 @@ public class TrainingTools extends XMBaseTest {
payObject
.
put
(
"voucherResourceIds"
,
new
JSONArray
());
paymentWays
.
add
(
payObject
);
body
.
put
(
"paymentWays"
,
paymentWays
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Reporter
.
log
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -418,7 +421,9 @@ public class TrainingTools extends XMBaseTest {
payObject
.
put
(
"voucherResourceIds"
,
new
JSONArray
());
paymentWays
.
add
(
payObject
);
body
.
put
(
"paymentWays"
,
paymentWays
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
@@ -489,7 +494,9 @@ public class TrainingTools extends XMBaseTest {
body
.
put
(
"current"
,
0
);
body
.
put
(
"size"
,
20
);
body
.
put
(
"memberId"
,
memberId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
...
...
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