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
5a80c2c3
Commit
5a80c2c3
authored
Apr 16, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选课中心班级信息显示
parent
bae3d858
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
6 deletions
+140
-6
test_auth_choose_class.py
...iarch_app/test_xin_choose_class/test_auth_choose_class.py
+135
-2
test_auth_choose_class_details.py
...p/test_xin_choose_class/test_auth_choose_class_details.py
+0
-0
test_auth_update_choose_class.py
...pp/test_xin_choose_class/test_auth_update_choose_class.py
+0
-0
xin_update_class.py
...atic/xin_educational/xin_class_handle/xin_update_class.py
+2
-2
xin_update_course.py
...ic/xin_educational/xin_course_handle/xin_update_course.py
+3
-2
No files found.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class.py
View file @
5a80c2c3
...
...
@@ -23,7 +23,7 @@ from script.xin_project_patriarch_app.xin_static.xin_time import Time_get
@allure.epic
(
'家长APP接口自动化测试'
)
@allure.feature
(
'选课中心'
)
@allure.feature
(
'选课中心
-显示规则
'
)
class
TestChooseClasses
:
global_class_id
=
None
...
...
@@ -359,7 +359,6 @@ class TestChooseClasses:
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
print
(
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
))
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'
)
...
...
@@ -432,3 +431,137 @@ class TestChooseClasses:
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_id
with
assume
:
assert
assert_data
.
get
(
'signUp'
)
is
True
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证专题满员,显示满员标签'
)
@allure.description
(
'验证专题满员,显示满员标签'
)
def
test_choose_one_buy_class_two_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1783'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
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
=
'专题'
,
courseType
=
'专题班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
classStudentNum
=
1
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
0
],
amount
=
10
,
details
=
[{
"classId"
:
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
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_id
)
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_id
with
assume
:
assert
assert_data
.
get
(
'fullClass'
)
is
True
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证新生班满员,不显示满员标签'
)
@allure.description
(
'验证新生班满员,不显示满员标签'
)
def
test_choose_one_buy_now_class_two_not_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1782'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'新生'
,
courseType
=
'常规班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
classStudentNum
=
1
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
0
],
amount
=
10
,
details
=
[{
"classId"
:
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
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_id
)
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_id
with
assume
:
assert
assert_data
.
get
(
'fullClass'
)
is
False
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证常规班满员,显示满员标签'
)
@allure.description
(
'验证常规班满员,显示满员标签'
)
def
test_choose_one_buy_groove_two_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1731'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
class_list
=
[]
for
class_count
in
range
(
2
):
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'副线课程'
,
classType
=
'专题'
,
courseType
=
'专题班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
classStudentNum
=
1
)
.
create_class
()[
'classId'
]
class_list
.
append
(
class_id
)
NetWork
(
server
=
self
.
server
,
resignClassIds
=
class_list
)
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
0
],
amount
=
10
,
details
=
[{
"classId"
:
class_list
[
0
],
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
order_id_two
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
amount
=
10
,
details
=
[{
"classId"
:
class_list
[
1
],
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id_two
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
time
.
sleep
(
1
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_list
[
0
])
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_list
[
0
]
with
assume
:
assert
assert_data
.
get
(
'fullClass'
)
is
True
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class_details.py
0 → 100644
View file @
5a80c2c3
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_update_choose_class.py
0 → 100644
View file @
5a80c2c3
This diff is collapsed.
Click to expand it.
script/xin_project_patriarch_app/xin_static/xin_educational/xin_class_handle/xin_update_class.py
View file @
5a80c2c3
...
...
@@ -135,7 +135,7 @@ class UpdateClass:
return
education_classes_optionalUpdate_post
(
body
=
dict
(
fields
,
**
self
.
body
),
header
=
self
.
headers
,
default_assert
=
False
)
# 修改排课
def
update_class_schedule
(
self
,
classSchedule
):
def
update_class_schedule
(
self
,
classSchedule
:
list
):
"""
classSchedule格式如下
[
...
...
@@ -159,7 +159,7 @@ class UpdateClass:
data
=
{
"classSchedule"
:
classSchedule
}
return
education_classes_update_post
(
body
=
d
ata
,
header
=
self
.
headers
,
default_assert
=
False
)
return
education_classes_update_post
(
body
=
d
ict
(
data
,
**
self
.
body
)
,
header
=
self
.
headers
,
default_assert
=
False
)
if
__name__
==
'__main__'
:
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_course_handle/xin_update_course.py
View file @
5a80c2c3
...
...
@@ -15,7 +15,7 @@ def query_course(courseId, headers):
"courseId"
:
courseId
,
"judgeUsed"
:
True
,
}
return
education_courses_queryById_get
(
params
=
query_data
,
header
s
=
headers
,
default_assert
=
False
)
return
education_courses_queryById_get
(
params
=
query_data
,
header
=
headers
,
default_assert
=
False
)
"""
...
...
@@ -136,11 +136,12 @@ class UpdateCoursePrice:
"normalPrice"
:
self
.
normalPrice
or
course_data
[
'data'
][
'course'
][
'normalPrice'
],
"isNormal"
:
self
.
isNormal
or
course_data
[
'data'
][
'course'
][
'isNormal'
],
"coursePrice"
:
self
.
coursePrice
or
course_data
[
'data'
][
'course'
][
'coursePrice'
],
"totalPrice"
:
course_data
[
'data'
][
'course'
][
'totalPrice'
]
if
self
.
coursePrice
is
None
or
course_data
[
'data'
][
'course'
][
'courseType'
]
==
'精品定制课'
"totalPrice"
:
course_data
[
'data'
][
'course'
][
'totalPrice'
]
if
self
.
coursePrice
is
None
else
float
(
course_data
[
'data'
][
'course'
][
'courseNumber'
])
*
self
.
coursePrice
}
if
course_data
[
'data'
][
'course'
][
'courseType'
]
==
'精品定制课'
:
update_price_data
.
pop
(
'isNormal'
)
update_price_data
[
'totalPrice'
]
=
course_data
[
'data'
][
'course'
][
'totalPrice'
]
return
education_courses_modifyPrice_post
(
header
=
self
.
headers
,
body
=
update_price_data
,
default_assert
=
False
)
# return requests.post(url=self.server + self.update_price_url, json=update_price_data, headers=self.headers, verify=False).json()
...
...
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