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
c789b585
Commit
c789b585
authored
Apr 19, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录成功后请求所有的接口
parent
96a48b36
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
20 deletions
+102
-20
test_auth_choose_class.py
...iarch_app/test_xin_choose_class/test_auth_choose_class.py
+29
-14
test_auth_choose_class_details.py
...p/test_xin_choose_class/test_auth_choose_class_details.py
+1
-2
test_auth_classes.py
...atriarch_app/test_xin_students_class/test_auth_classes.py
+2
-2
test_auth_students_classes.py
...app/test_xin_students_class/test_auth_students_classes.py
+1
-1
test_auth_students.py
...triarch_app/test_xin_students_login/test_auth_students.py
+69
-1
No files found.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class.py
View file @
c789b585
...
@@ -5,6 +5,7 @@ import allure
...
@@ -5,6 +5,7 @@ import allure
import
jsonpath
import
jsonpath
from
pytest_assume.plugin
import
assume
from
pytest_assume.plugin
import
assume
from
script.base_api
import
app_class_schoolAreaId_getSameLevelSchoolArea_get
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_choose_class.xin_choose_classes
import
ChooseClasses
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_choose_class.xin_choose_classes
import
ChooseClasses
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_public_class.xin_change_list_index
import
ChangeListIndex
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_public_class.xin_change_list_index
import
ChangeListIndex
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_patriarch_app.xin_patriach_static.xin_public_class.xin_global_static
import
StaticGlobal
...
@@ -16,6 +17,7 @@ from script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handl
...
@@ -16,6 +17,7 @@ from script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handl
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_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_educational.xin_network
import
NetWork
from
script.xin_project_patriarch_app.xin_static.xin_time
import
Time_get
from
script.xin_project_patriarch_app.xin_static.xin_time
import
Time_get
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_patriarch_login
import
AuthHeaders
"""
"""
选课列表
选课列表
...
@@ -33,6 +35,7 @@ class TestChooseClasses:
...
@@ -33,6 +35,7 @@ class TestChooseClasses:
self
.
studentPho
=
'189'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
self
.
studentPho
=
'189'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
header
=
AuthHeaders
(
server
=
self
.
server
,
username
=
self
.
studentPho
,
password
=
'geek1234'
)
.
get_auth_headers
()
"""
"""
先让选课中心有一个班级,保证后面的断言正确
先让选课中心有一个班级,保证后面的断言正确
"""
"""
...
@@ -56,6 +59,18 @@ class TestChooseClasses:
...
@@ -56,6 +59,18 @@ class TestChooseClasses:
with
assume
:
assert
query_data
[
'data'
][
0
][
'student'
][
'schoolName'
]
==
'测试成都校区'
with
assume
:
assert
query_data
[
'data'
][
0
][
'student'
][
'schoolName'
]
==
'测试成都校区'
with
assume
:
assert
self
.
studentPho
in
query_data
[
'data'
][
0
][
'student'
][
'phones'
]
with
assume
:
assert
self
.
studentPho
in
query_data
[
'data'
][
0
][
'student'
][
'phones'
]
# 断言可选中心校
@allure.story
(
'选课中心-校区'
)
@allure.title
(
'验证可选校区正确'
)
@allure.description
(
'验证可选校区正确'
)
def
test_can_choose_class_school
(
self
):
school_data
=
app_class_schoolAreaId_getSameLevelSchoolArea_get
(
schoolAreaId
=
'3052'
,
header
=
self
.
header
)
with
assume
:
assert
school_data
.
get
(
'code'
)
==
0
with
assume
:
assert
'测试成都校区'
in
jsonpath
.
jsonpath
(
school_data
,
'$..schoolAreaName'
)
with
assume
:
assert
'测试校区一'
in
jsonpath
.
jsonpath
(
school_data
,
'$..schoolAreaName'
)
with
assume
:
assert
3052
in
jsonpath
.
jsonpath
(
school_data
,
'$..schoolAreaId'
)
with
assume
:
assert
3015
in
jsonpath
.
jsonpath
(
school_data
,
'$..schoolAreaId'
)
# 断言班级没有网报时间,不显示
# 断言班级没有网报时间,不显示
@allure.story
(
'选课列表-班级'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证没有网报时间,不显示'
)
@allure.title
(
'验证没有网报时间,不显示'
)
...
@@ -162,6 +177,7 @@ class TestChooseClasses:
...
@@ -162,6 +177,7 @@ class TestChooseClasses:
year
=
StaticGlobal
.
YEAR
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
'极趣班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'极趣班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
...
@@ -245,7 +261,7 @@ class TestChooseClasses:
...
@@ -245,7 +261,7 @@ class TestChooseClasses:
@allure.title
(
'购买了新生班,看不到常规班'
)
@allure.title
(
'购买了新生班,看不到常规班'
)
@allure.description
(
'学生购买了新生班,不能看到常规班'
)
@allure.description
(
'学生购买了新生班,不能看到常规班'
)
def
test_choose_buy_new_not_groove
(
self
):
def
test_choose_buy_new_not_groove
(
self
):
studentPho
=
'144'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'144'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
@@ -277,7 +293,7 @@ class TestChooseClasses:
...
@@ -277,7 +293,7 @@ class TestChooseClasses:
@allure.title
(
'购买了副线班,看不到常规班'
)
@allure.title
(
'购买了副线班,看不到常规班'
)
@allure.description
(
'学生购买了副线班,不能看到常规班和精品班'
)
@allure.description
(
'学生购买了副线班,不能看到常规班和精品班'
)
def
test_choose_buy_subLine_not_groove
(
self
):
def
test_choose_buy_subLine_not_groove
(
self
):
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
...
@@ -302,7 +318,7 @@ class TestChooseClasses:
...
@@ -302,7 +318,7 @@ class TestChooseClasses:
@allure.title
(
'购买了当期前的常规班,看不到常规班'
)
@allure.title
(
'购买了当期前的常规班,看不到常规班'
)
@allure.description
(
'购买了当期前的常规班,不能看到常规班、和精品班,能看到新生班'
)
@allure.description
(
'购买了当期前的常规班,不能看到常规班、和精品班,能看到新生班'
)
def
test_choose_buy_before_groove_not_now
(
self
):
def
test_choose_buy_before_groove_not_now
(
self
):
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
@@ -312,6 +328,7 @@ class TestChooseClasses:
...
@@ -312,6 +328,7 @@ class TestChooseClasses:
year
=
StaticGlobal
.
YEAR
-
1
,
year
=
StaticGlobal
.
YEAR
-
1
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
class_id
,
"classId"
:
class_id
,
"num"
:
10
,
"num"
:
10
,
...
@@ -335,7 +352,7 @@ class TestChooseClasses:
...
@@ -335,7 +352,7 @@ class TestChooseClasses:
@allure.title
(
'购买了当期的常规班,可以看到常规班'
)
@allure.title
(
'购买了当期的常规班,可以看到常规班'
)
@allure.description
(
'购买了当期的常规班,能看到常规班,不能看到新生班和精品班'
)
@allure.description
(
'购买了当期的常规班,能看到常规班,不能看到新生班和精品班'
)
def
test_choose_buy_now_groove
(
self
):
def
test_choose_buy_now_groove
(
self
):
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
@@ -345,6 +362,7 @@ class TestChooseClasses:
...
@@ -345,6 +362,7 @@ class TestChooseClasses:
year
=
StaticGlobal
.
YEAR
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
class_id
,
"classId"
:
class_id
,
"num"
:
10
,
"num"
:
10
,
...
@@ -369,7 +387,7 @@ class TestChooseClasses:
...
@@ -369,7 +387,7 @@ class TestChooseClasses:
@allure.title
(
'购买了当期后的常规班,看不到常规班'
)
@allure.title
(
'购买了当期后的常规班,看不到常规班'
)
@allure.description
(
'购买了当期后的常规班,不能看到常规班和精品班,能看到新生班'
)
@allure.description
(
'购买了当期后的常规班,不能看到常规班和精品班,能看到新生班'
)
def
test_choose_buy_after_groove_not_now
(
self
):
def
test_choose_buy_after_groove_not_now
(
self
):
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
@@ -379,6 +397,7 @@ class TestChooseClasses:
...
@@ -379,6 +397,7 @@ class TestChooseClasses:
year
=
StaticGlobal
.
YEAR
+
1
,
year
=
StaticGlobal
.
YEAR
+
1
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
class_id
,
"classId"
:
class_id
,
"num"
:
10
,
"num"
:
10
,
...
@@ -402,7 +421,7 @@ class TestChooseClasses:
...
@@ -402,7 +421,7 @@ class TestChooseClasses:
@allure.title
(
'购买了班级,班级在网报时间内显示已报名标签'
)
@allure.title
(
'购买了班级,班级在网报时间内显示已报名标签'
)
@allure.description
(
'购买班级,班级显示已报名的标签'
)
@allure.description
(
'购买班级,班级显示已报名的标签'
)
def
test_choose_buy_show_bought
(
self
):
def
test_choose_buy_show_bought
(
self
):
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
@@ -438,12 +457,10 @@ class TestChooseClasses:
...
@@ -438,12 +457,10 @@ class TestChooseClasses:
def
test_choose_one_buy_class_two_show
(
self
):
def
test_choose_one_buy_class_two_show
(
self
):
userId_list
=
[]
userId_list
=
[]
for
student_count
in
range
(
2
):
for
student_count
in
range
(
2
):
studentPho
=
'167'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'167'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
userId_list
.
append
(
userId
)
# 等待,请求快后端直减判定重复提交
time
.
sleep
(
0.5
)
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'副线课程'
,
productType
=
'副线课程'
,
classType
=
'专题'
,
classType
=
'专题'
,
...
@@ -479,11 +496,10 @@ class TestChooseClasses:
...
@@ -479,11 +496,10 @@ class TestChooseClasses:
def
test_choose_one_buy_now_class_two_not_show
(
self
):
def
test_choose_one_buy_now_class_two_not_show
(
self
):
userId_list
=
[]
userId_list
=
[]
for
student_count
in
range
(
2
):
for
student_count
in
range
(
2
):
studentPho
=
'177'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'177'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
userId_list
.
append
(
userId
)
time
.
sleep
(
0.5
)
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
productType
=
'主线课程'
,
classType
=
'新生'
,
classType
=
'新生'
,
...
@@ -519,11 +535,10 @@ class TestChooseClasses:
...
@@ -519,11 +535,10 @@ class TestChooseClasses:
def
test_choose_one_buy_groove_two_show
(
self
):
def
test_choose_one_buy_groove_two_show
(
self
):
userId_list
=
[]
userId_list
=
[]
for
student_count
in
range
(
2
):
for
student_count
in
range
(
2
):
studentPho
=
'188'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
studentPho
=
'188'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
userId_list
.
append
(
userId
)
time
.
sleep
(
0.5
)
class_list
=
[]
class_list
=
[]
for
class_count
in
range
(
2
):
for
class_count
in
range
(
2
):
course_id
=
CreateCourse
(
server
=
self
.
server
,
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
@@ -561,7 +576,7 @@ class TestChooseClasses:
...
@@ -561,7 +576,7 @@ class TestChooseClasses:
"payAmount"
:
10
"payAmount"
:
10
}
}
])
.
pay_order
()
])
.
pay_order
()
time
.
sleep
(
1
)
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
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
])
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_list
[
0
])
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
choose_data
[
'code'
]
==
0
...
...
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class_details.py
View file @
c789b585
...
@@ -22,7 +22,7 @@ class TestAuthChoseClassDetails:
...
@@ -22,7 +22,7 @@ class TestAuthChoseClassDetails:
def
setup_class
(
self
):
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
server
=
StaticGlobal
.
SERVER
self
.
schoolArea
=
StaticGlobal
.
SCHOOL
self
.
schoolArea
=
StaticGlobal
.
SCHOOL
self
.
studentPho
=
'145'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
self
.
studentPho
=
'145'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
"""
"""
...
@@ -180,4 +180,3 @@ class TestAuthChoseClassDetails:
...
@@ -180,4 +180,3 @@ class TestAuthChoseClassDetails:
with
assume
:
assert
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'subject'
)
==
'数学'
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
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'sex'
)
==
'男'
with
assume
:
assert
'测试成都校区'
in
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'schoolArea'
)
with
assume
:
assert
'测试成都校区'
in
details_data
.
get
(
'data'
)
.
get
(
'teacherDetail'
)
.
get
(
'schoolArea'
)
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_students_class/test_auth_classes.py
View file @
c789b585
...
@@ -24,7 +24,7 @@ from script.xin_project_patriarch_app.xin_static.xin_user.xin_patriarch_login im
...
@@ -24,7 +24,7 @@ from script.xin_project_patriarch_app.xin_static.xin_user.xin_patriarch_login im
class
TestAuthNotBuyClasses
:
class
TestAuthNotBuyClasses
:
def
setup_class
(
self
):
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
server
=
StaticGlobal
.
SERVER
self
.
studentPho
=
'133'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
self
.
studentPho
=
'133'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
header
=
AuthHeaders
(
server
=
self
.
server
,
username
=
self
.
studentPho
,
password
=
'geek1234'
)
.
get_auth_headers
()
self
.
header
=
AuthHeaders
(
server
=
self
.
server
,
username
=
self
.
studentPho
,
password
=
'geek1234'
)
.
get_auth_headers
()
...
@@ -53,7 +53,7 @@ class TestAuthNotBuyClasses:
...
@@ -53,7 +53,7 @@ class TestAuthNotBuyClasses:
class
TestAuthHaveClasses
:
class
TestAuthHaveClasses
:
def
setup_class
(
self
):
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
server
=
StaticGlobal
.
SERVER
self
.
studentPho
=
'133'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
self
.
studentPho
=
'133'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
self
.
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
self
.
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
userId
=
self
.
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
create_class_data
=
[[
'主线课程'
,
'极趣班'
,
'常规班课'
,
'数学'
],
self
.
create_class_data
=
[[
'主线课程'
,
'极趣班'
,
'常规班课'
,
'数学'
],
...
...
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_students_class/test_auth_students_classes.py
View file @
c789b585
...
@@ -23,7 +23,7 @@ from script.xin_project_patriarch_app.xin_static.xin_educational.xin_course_hand
...
@@ -23,7 +23,7 @@ from script.xin_project_patriarch_app.xin_static.xin_educational.xin_course_hand
class
TestAuthStudentsClassMessage
:
class
TestAuthStudentsClassMessage
:
def
setup_class
(
self
):
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
server
=
StaticGlobal
.
SERVER
self
.
studentPho
=
'167'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S
'
)
self
.
studentPho
=
'167'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
S
%
f
'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
self
.
course_id
=
CreateCourse
(
server
=
self
.
server
,
self
.
course_id
=
CreateCourse
(
server
=
self
.
server
,
...
...
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_students_login/test_auth_students.py
View file @
c789b585
...
@@ -2,8 +2,11 @@ import allure
...
@@ -2,8 +2,11 @@ import allure
import
jsonpath
import
jsonpath
from
pytest_assume.plugin
import
assume
from
pytest_assume.plugin
import
assume
from
script.base_api
import
app_students_phoneNumber_mobilePhoneNumberBounding_get
,
app_pushRelationship_post
from
script.base_api
import
app_students_phoneNumber_mobilePhoneNumberBounding_get
,
app_pushRelationship_post
,
plaso_student_token_get
,
plaso_student_exist_get
,
app_notice_getNotReadCount_get
from
script.base_api
import
app_purchaseOrder_studentId_student_count_get
,
app_course_courseNoticeMessage_post
,
app_course_recentClassTime_get
,
examination_app_queryExamination_get
from
script.base_api
import
app_zeGou_queryClassesIsAvailableVideo_post
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_patriarch_app.xin_patriach_static.xin_public_class.xin_global_static
import
StaticGlobal
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_students_message.xin_query_students_message
import
QueryStudentsMessage
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_patriarch_login
import
AuthHeaders
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_patriarch_login
import
AuthHeaders
...
@@ -13,6 +16,8 @@ class TestAuthStudents:
...
@@ -13,6 +16,8 @@ class TestAuthStudents:
def
setup_class
(
self
):
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
server
=
StaticGlobal
.
SERVER
self
.
header
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'13364004418'
,
password
=
'geek1234'
)
.
get_auth_headers
()
self
.
header
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'13364004418'
,
password
=
'geek1234'
)
.
get_auth_headers
()
students_message
=
QueryStudentsMessage
(
server
=
self
.
server
,
studentPno
=
'13364004418'
)
.
query_students_message
()
self
.
student_id
=
students_message
.
get
(
'data'
)[
0
]
.
get
(
'student'
)
.
get
(
'id'
)
@allure.story
(
'登录成功验证'
)
@allure.story
(
'登录成功验证'
)
@allure.title
(
'验证查询学生信息正确'
)
@allure.title
(
'验证查询学生信息正确'
)
...
@@ -35,3 +40,66 @@ class TestAuthStudents:
...
@@ -35,3 +40,66 @@ class TestAuthStudents:
}
}
push_data
=
app_pushRelationship_post
(
body
=
push_data
,
header
=
self
.
header
,
default_assert
=
False
)
push_data
=
app_pushRelationship_post
(
body
=
push_data
,
header
=
self
.
header
,
default_assert
=
False
)
with
assume
:
assert
push_data
.
get
(
'code'
)
==
0
with
assume
:
assert
push_data
.
get
(
'code'
)
==
0
@allure.story
(
'登录成功验证'
)
@allure.title
(
'伯索获取学生用户token'
)
@allure.description
(
'伯索获取学生用户token'
)
def
test_auth_three_token
(
self
):
auth_data
=
plaso_student_token_get
(
header
=
self
.
header
,
params
=
{
"id"
:
self
.
student_id
})
with
assume
:
assert
auth_data
.
get
(
'code'
)
==
0
with
assume
:
assert
auth_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'是否存在伯索学生身份'
)
@allure.description
(
'是否存在伯索学生身份'
)
def
test_auth_exist_student
(
self
):
exist_data
=
plaso_student_exist_get
(
params
=
{
'id'
:
self
.
student_id
},
header
=
self
.
header
)
with
assume
:
assert
exist_data
.
get
(
'code'
)
==
0
with
assume
:
assert
exist_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'验证学生所有消息未读数'
)
@allure.description
(
'验证学生所有消息未读数'
)
def
test_auth_not_read_message
(
self
):
message_data
=
app_notice_getNotReadCount_get
(
params
=
{
'userId'
:
self
.
student_id
},
header
=
self
.
header
)
with
assume
:
assert
message_data
.
get
(
'code'
)
==
0
with
assume
:
assert
message_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'获取某个学生购课单中课程总数'
)
@allure.description
(
'获取某个学生购课单中课程总数'
)
def
test_auth_purchase_order_count
(
self
):
purchase_order_data
=
app_purchaseOrder_studentId_student_count_get
(
studentId
=
self
.
student_id
,
header
=
self
.
header
)
with
assume
:
assert
purchase_order_data
.
get
(
'code'
)
==
0
with
assume
:
assert
purchase_order_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'验证学生的课程提醒'
)
@allure.description
(
'验证学生的课程提醒'
)
def
test_auth_course_notice_message
(
self
):
notice_data
=
app_course_courseNoticeMessage_post
(
params
=
{
"studentId"
:
self
.
student_id
},
header
=
self
.
header
)
with
assume
:
assert
notice_data
.
get
(
'code'
)
==
0
with
assume
:
assert
notice_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'验证学生的最近上课时间'
)
@allure.description
(
'验证学生的最近上课时间'
)
def
test_auth_course_recent_class_time
(
self
):
recent_data
=
app_course_recentClassTime_get
(
params
=
{
"studentId"
:
self
.
student_id
},
header
=
self
.
header
)
with
assume
:
assert
recent_data
.
get
(
'code'
)
==
0
with
assume
:
assert
recent_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'验证学生的考试列表'
)
@allure.description
(
'验证学生的考试列表'
)
def
test_auth_course_examination
(
self
):
examination_data
=
examination_app_queryExamination_get
(
params
=
{
"studentId"
:
self
.
student_id
},
header
=
self
.
header
)
with
assume
:
assert
examination_data
.
get
(
'code'
)
==
0
with
assume
:
assert
examination_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录成功验证'
)
@allure.title
(
'获取班级当前排课'
)
@allure.description
(
'获取班级当前排课'
)
def
test_auth_available_video
(
self
):
video_data
=
app_zeGou_queryClassesIsAvailableVideo_post
(
header
=
self
.
header
,
body
=
[])
with
assume
:
assert
video_data
.
get
(
'code'
)
==
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