Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jk_interface_test
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangqiang
jk_interface_test
Commits
96a48b36
Commit
96a48b36
authored
Apr 16, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选课中心班级详情测试用例
parent
5a80c2c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
190 additions
and
5 deletions
+190
-5
test_auth_choose_class.py
...iarch_app/test_xin_choose_class/test_auth_choose_class.py
+6
-4
test_auth_choose_class_details.py
...p/test_xin_choose_class/test_auth_choose_class_details.py
+183
-0
test_auth_update_choose_class.py
...pp/test_xin_choose_class/test_auth_update_choose_class.py
+1
-1
No files found.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class.py
View file @
96a48b36
...
...
@@ -360,7 +360,7 @@ class TestChooseClasses:
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
'极趣班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'极趣班'
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'专题'
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'新生'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'一对一定制班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
...
...
@@ -438,7 +438,7 @@ class TestChooseClasses:
def
test_choose_one_buy_class_two_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1
783'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
studentPho
=
'1
67'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
...
...
@@ -479,10 +479,11 @@ class TestChooseClasses:
def
test_choose_one_buy_now_class_two_not_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'17
82'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
studentPho
=
'17
7'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
time
.
sleep
(
0.5
)
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'新生'
,
...
...
@@ -518,10 +519,11 @@ class TestChooseClasses:
def
test_choose_one_buy_groove_two_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1
731'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
studentPho
=
'1
88'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
time
.
sleep
(
0.5
)
class_list
=
[]
for
class_count
in
range
(
2
):
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
...
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class_details.py
View file @
96a48b36
import
datetime
import
time
import
allure
from
pytest_assume.plugin
import
assume
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_choose_class.xin_choose_classes
import
courseDetails
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_public_class.xin_global_static
import
StaticGlobal
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_apply.xin_pay_order
import
PayOrder
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_apply.xin_save_order
import
SaveOrder
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_student
import
CreateStudent
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handle.xin_add_class
import
CreateClass
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handle.xin_update_class
import
UpdateClass
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_course_handle.xin_course
import
CreateCourse
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_network
import
NetWork
from
script.xin_project_patriarch_app.xin_static.xin_time
import
Time_get
@allure.epic
(
'家长APP接口自动化测试'
)
@allure.feature
(
'选课中心-班级详情'
)
class
TestAuthChoseClassDetails
:
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
schoolArea
=
StaticGlobal
.
SCHOOL
self
.
studentPho
=
'145'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
"""
购买一个常规班
"""
course_id
=
CreateCourse
(
server
=
self
.
server
,
classType
=
'极趣班'
,
courseType
=
'常规班课'
,
productType
=
'主线课程'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
self
.
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
self
.
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
amount
=
10
,
details
=
[{
"classId"
:
self
.
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
time
.
sleep
(
3
)
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'班级名称显示正确'
)
@allure.description
(
'验证班级名称显示正确'
)
def
test_auth_choose_class_name_details
(
self
):
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'courseType'
)
==
'常规班课'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'className'
)
==
f
'小黄测试极趣班{StaticGlobal.YEAR}{StaticGlobal.TERM}数学'
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'修改班级名称,班级名称显示正确'
)
@allure.description
(
'验证修改班级名称,班级名称显示正确'
)
def
test_auth_choose_update_class_name_details
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_className
(
value
=
'修改选课中心班级详情'
)
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'courseType'
)
==
'常规班课'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'className'
)
==
'修改选课中心班级详情'
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证班级校区正确'
)
@allure.description
(
'班级校区显示正确'
)
def
test_auth_choose_class_belong_school
(
self
):
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'schoolAreaId'
)
==
3052
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'schoolAreaName'
)
==
'测试成都校区'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'address'
)
==
'四川省成都市青羊区东坡街道东坡南一路'
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证没有教室正确'
)
@allure.description
(
'验证没有教室不显示教室名称'
)
def
test_auth_choose_class_room
(
self
):
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classroomName'
)
is
None
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证修改教室,显示正确'
)
@allure.description
(
'修改教室,返回的是修改之后教室的名称'
)
def
test_auth_choose_update_class_room
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_classroom
(
value
=
{
"id"
:
10009686
,
"name"
:
"常规全天"
})
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classroomName'
)
==
'常规全天'
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证班级没有老师,显示正确'
)
@allure.description
(
'验证班级没有老师,显示正确'
)
def
test_auth_choose_class_teacher
(
self
):
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
==
{}
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证修改班级老师,显示正确'
)
@allure.description
(
'验证修改班级老师,显示正确'
)
def
test_auth_choose_update_teacher
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_teacher
(
value
=
{
"id"
:
9384
,
"name"
:
"刘黄鑫"
})
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'teacherName'
)
==
'刘黄鑫'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'teachGrade'
)
==
'小低,小高,初中,高中'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'phone'
)
==
'17623669485'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'subject'
)
==
'数学'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'sex'
)
==
'男'
with
assume
:
assert
'测试成都校区'
in
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'schoolArea'
)
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证班级上课时间正确,报名开始时间正确'
)
@allure.description
(
'验证班级上课时间正确,报名开始时间正确'
)
def
test_auth_choose_class_time
(
self
):
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'signBeginDate'
)
==
Time_get
.
get_before_month_time_end
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'signEndDate'
)
==
Time_get
.
get_after_month_time_end
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classBeginDate'
)
==
Time_get
.
get_before_week_time_start
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classEndDate'
)
==
'2099-12-31 00:00:00'
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证修改班级上课时间,周期显示正确'
)
@allure.description
(
'验证修改班级上课时间,周期显示正确'
)
def
test_auth_choose_update_class_time
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_classroom
(
value
=
{
"id"
:
10009686
,
"name"
:
"常规全天"
})
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_teacher
(
value
=
{
"id"
:
9384
,
"name"
:
"刘黄鑫"
})
value
=
[
{
"classScheduleId"
:
0
,
"date"
:
Time_get
.
get_before_week_time_start
()
+
' 00:00:00'
,
"week"
:
"星期一"
,
"beginTime"
:
"07:35:00"
,
"endTime"
:
"07:40:00"
,
"duration"
:
10
,
"classScheduleIndex"
:
1
,
"employeeNumber"
:
"JKTR00397"
,
"classTeacher"
:
"刘黄鑫"
,
"classTeacherId"
:
9384
,
"classroomId"
:
10009686
,
"classroomName"
:
"常规全天"
}
]
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_schedule
(
classSchedule
=
value
)
details_data
=
courseDetails
(
server
=
self
.
server
,
classId
=
self
.
class_id
,
studentId
=
self
.
userId
)
.
query_course_details
()
with
assume
:
assert
details_data
.
get
(
'code'
)
==
0
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classId'
)
==
self
.
class_id
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classroomName'
)
==
'常规全天'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'signBeginDate'
)
==
Time_get
.
get_before_month_time_end
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'signEndDate'
)
==
Time_get
.
get_after_month_time_end
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classBeginDate'
)
==
Time_get
.
get_before_week_time_start
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classDetail'
)
.
get
(
'classEndDate'
)
==
Time_get
.
get_before_week_time_start
()
+
' 00:00:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'classScheduleDetail'
)
.
get
(
'1'
)
==
Time_get
.
get_before_week_time_start
()
+
' 07:35:00-07:40:00'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'teacherName'
)
==
'刘黄鑫'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'teachGrade'
)
==
'小低,小高,初中,高中'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'phone'
)
==
'17623669485'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'subject'
)
==
'数学'
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'sex'
)
==
'男'
with
assume
:
assert
'测试成都校区'
in
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'schoolArea'
)
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_update_choose_class.py
View file @
96a48b36
...
...
@@ -179,4 +179,4 @@ class TestAuthUpdateChooseClass:
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'price'
)
==
100.0
with
assume
:
assert
assert_data
.
get
(
'amount'
)
==
100.0
with
assume
:
assert
assert_data
.
get
(
'
1000
'
)
==
1000.0
with
assume
:
assert
assert_data
.
get
(
'
normalPrice
'
)
==
1000.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