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
bae3d858
Commit
bae3d858
authored
Apr 15, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选课中心用例
parent
cc3093ad
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
176 additions
and
47 deletions
+176
-47
test_auth_choose_class.py
...iarch_app/test_xin_choose_class/test_auth_choose_class.py
+133
-4
test_auth_classes.py
...atriarch_app/test_xin_students_class/test_auth_classes.py
+8
-2
test_auth_login.py
..._patriarch_app/test_xin_students_login/test_auth_login.py
+10
-10
test_auth_students.py
...triarch_app/test_xin_students_login/test_auth_students.py
+4
-4
xin_pay_order.py
...triarch_app/xin_static/xin_crm/xin_apply/xin_pay_order.py
+2
-4
xin_place_order.py
...iarch_app/xin_static/xin_crm/xin_apply/xin_place_order.py
+4
-4
xin_save_order.py
...riarch_app/xin_static/xin_crm/xin_apply/xin_save_order.py
+0
-2
xin_student.py
...n_project_patriarch_app/xin_static/xin_crm/xin_student.py
+1
-1
xin_add_class.py
..._static/xin_educational/xin_class_handle/xin_add_class.py
+2
-4
xin_delete_class.py
...atic/xin_educational/xin_class_handle/xin_delete_class.py
+1
-3
xin_update_class.py
...atic/xin_educational/xin_class_handle/xin_update_class.py
+1
-1
xin_course.py
...in_static/xin_educational/xin_course_handle/xin_course.py
+4
-2
xin_patriarch_login.py
..._patriarch_app/xin_static/xin_user/xin_patriarch_login.py
+6
-6
No files found.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class.py
View file @
bae3d858
...
@@ -275,7 +275,7 @@ class TestChooseClasses:
...
@@ -275,7 +275,7 @@ class TestChooseClasses:
@allure.story
(
'选课列表-班级'
)
@allure.story
(
'选课列表-班级'
)
@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
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
...
@@ -296,9 +296,139 @@ class TestChooseClasses:
...
@@ -296,9 +296,139 @@ class TestChooseClasses:
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
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'
)
with
assume
:
assert
'一对一定制班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
@allure.story
(
'选课列表-班级'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'购买了当期前的常规班,看不到常规班'
)
@allure.title
(
'购买了当期前的常规班,看不到常规班'
)
@allure.description
(
'购买了当期前的常规班,不能看到常规班和新生班'
)
@allure.description
(
'购买了当期前的常规班,不能看到常规班、和精品班,能看到新生班'
)
def
test_choose_buy_before_groove_not_now
(
self
):
studentPho
=
'173'
+
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'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'极趣班'
,
courseType
=
'常规班课'
,
year
=
StaticGlobal
.
YEAR
-
1
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
100
}
])
.
pay_order
()
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
'一对一定制班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'购买了当期的常规班,可以看到常规班'
)
@allure.description
(
'购买了当期的常规班,能看到常规班,不能看到新生班和精品班'
)
def
test_choose_buy_now_groove
(
self
):
studentPho
=
'173'
+
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'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'极趣班'
,
courseType
=
'常规班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
100
}
])
.
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'
)
with
assume
:
assert
'新生'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'一对一定制班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'购买了当期后的常规班,看不到常规班'
)
@allure.description
(
'购买了当期后的常规班,不能看到常规班和精品班,能看到新生班'
)
def
test_choose_buy_after_groove_not_now
(
self
):
def
test_choose_buy_after_groove_not_now
(
self
):
with
assume
:
assert
1
==
1
studentPho
=
'173'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
\ No newline at end of file
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'极趣班'
,
courseType
=
'常规班课'
,
year
=
StaticGlobal
.
YEAR
+
1
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
)
.
create_class
()[
'classId'
]
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId
,
amount
=
100
,
details
=
[{
"classId"
:
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
100
}
])
.
pay_order
()
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
'一对一定制班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'购买了班级,班级在网报时间内显示已报名标签'
)
@allure.description
(
'购买班级,班级显示已报名的标签'
)
def
test_choose_buy_show_bought
(
self
):
studentPho
=
'173'
+
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'
]
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'新生'
,
courseType
=
'常规班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
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
=
[{
"classId"
:
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
100
}
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
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
(
'signUp'
)
is
True
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_students_class/test_auth_classes.py
View file @
bae3d858
...
@@ -77,7 +77,7 @@ class TestAuthHaveClasses:
...
@@ -77,7 +77,7 @@ class TestAuthHaveClasses:
"discountId"
:
""
,
"discountId"
:
""
,
"category"
:
"CLASS"
"category"
:
"CLASS"
})
})
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
amount
=
700
,
details
=
self
.
details
)
.
save_order
()
[
'data'
]
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
amount
=
700
,
details
=
self
.
details
)
.
save_order
()
.
get
(
'data'
)
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
{
...
@@ -96,7 +96,13 @@ class TestAuthHaveClasses:
...
@@ -96,7 +96,13 @@ class TestAuthHaveClasses:
with
assume
:
assert
query_data
[
'msg'
]
==
'成功'
with
assume
:
assert
query_data
[
'msg'
]
==
'成功'
with
assume
:
assert
query_data
[
'data'
][
'studentClassInfoDtoList'
]
!=
[]
with
assume
:
assert
query_data
[
'data'
][
'studentClassInfoDtoList'
]
!=
[]
with
assume
:
assert
'常规班课'
in
jsonpath
.
jsonpath
(
query_data
,
'$...courseType'
)
with
assume
:
assert
'常规班课'
in
jsonpath
.
jsonpath
(
query_data
,
'$...courseType'
)
with
assume
:
assert
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)[
0
]
==
self
.
details
[
0
][
'classId'
]
with
assume
:
assert
self
.
details
[
0
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
with
assume
:
assert
self
.
details
[
1
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
with
assume
:
assert
self
.
details
[
2
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
with
assume
:
assert
self
.
details
[
3
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
with
assume
:
assert
self
.
details
[
4
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
with
assume
:
assert
self
.
details
[
5
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
with
assume
:
assert
self
.
details
[
6
][
'classId'
]
in
jsonpath
.
jsonpath
(
query_data
,
'$...classId'
)
@allure.story
(
'学生有在读班级'
)
@allure.story
(
'学生有在读班级'
)
@allure.title
(
'数学科目筛选'
)
@allure.title
(
'数学科目筛选'
)
...
...
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_students_login/test_auth_login.py
View file @
bae3d858
...
@@ -24,8 +24,8 @@ class TestAuthLogin:
...
@@ -24,8 +24,8 @@ class TestAuthLogin:
@allure.step
(
'输入用户名:13364004418,密码:geek1234'
)
@allure.step
(
'输入用户名:13364004418,密码:geek1234'
)
def
test_login01
(
self
):
def
test_login01
(
self
):
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'13364004418'
,
password
=
'geek1234'
)
.
get_auth_token
()
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'13364004418'
,
password
=
'geek1234'
)
.
get_auth_token
()
with
assume
:
assert
auth_data
[
'code'
]
==
0
with
assume
:
assert
auth_data
.
get
(
'code'
)
==
0
with
assume
:
assert
auth_data
[
'msg'
]
==
'成功'
with
assume
:
assert
auth_data
.
get
(
'msg'
)
==
'成功'
@allure.story
(
'登录验证'
)
@allure.story
(
'登录验证'
)
@allure.title
(
'用户名正确,密码不正确'
)
@allure.title
(
'用户名正确,密码不正确'
)
...
@@ -33,8 +33,8 @@ class TestAuthLogin:
...
@@ -33,8 +33,8 @@ class TestAuthLogin:
@allure.step
(
'输入用户名:13364004418,密码:123'
)
@allure.step
(
'输入用户名:13364004418,密码:123'
)
def
test_login02
(
self
):
def
test_login02
(
self
):
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'13364004418'
,
password
=
'123'
)
.
get_auth_token
()
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'13364004418'
,
password
=
'123'
)
.
get_auth_token
()
with
assume
:
assert
auth_data
[
'code'
]
!=
0
with
assume
:
assert
auth_data
.
get
(
'code'
)
!=
0
with
assume
:
assert
auth_data
[
'msg'
]
==
'用户名或密码错误!'
with
assume
:
assert
auth_data
.
get
(
'msg'
)
==
'用户名或密码错误!'
@allure.story
(
'登录验证'
)
@allure.story
(
'登录验证'
)
@allure.title
(
'用户名错误,密码正确'
)
@allure.title
(
'用户名错误,密码正确'
)
...
@@ -42,8 +42,8 @@ class TestAuthLogin:
...
@@ -42,8 +42,8 @@ class TestAuthLogin:
@allure.step
(
'输入用户名:11111111111,密码:geek1234'
)
@allure.step
(
'输入用户名:11111111111,密码:geek1234'
)
def
test_login03
(
self
):
def
test_login03
(
self
):
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'11111111111'
,
password
=
'geek1234'
)
.
get_auth_token
()
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'11111111111'
,
password
=
'geek1234'
)
.
get_auth_token
()
with
assume
:
assert
auth_data
[
'code'
]
!=
0
with
assume
:
assert
auth_data
.
get
(
'code'
)
!=
0
with
assume
:
assert
'该手机号未注册'
in
auth_data
[
'msg'
]
with
assume
:
assert
'该手机号未注册'
in
auth_data
.
get
(
'msg'
)
@allure.story
(
'登录验证'
)
@allure.story
(
'登录验证'
)
@allure.title
(
'用户名密码为空'
)
@allure.title
(
'用户名密码为空'
)
...
@@ -51,8 +51,8 @@ class TestAuthLogin:
...
@@ -51,8 +51,8 @@ class TestAuthLogin:
@allure.step
(
'接口不传用户名和密码'
)
@allure.step
(
'接口不传用户名和密码'
)
def
test_login04
(
self
):
def
test_login04
(
self
):
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
' '
,
password
=
' '
)
.
get_auth_token
()
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
' '
,
password
=
' '
)
.
get_auth_token
()
with
assume
:
assert
auth_data
[
'code'
]
!=
0
with
assume
:
assert
auth_data
.
get
(
'code'
)
!=
0
with
assume
:
assert
'该手机号未注册'
in
auth_data
[
'msg'
]
with
assume
:
assert
'该手机号未注册'
in
auth_data
.
get
(
'msg'
)
@allure.story
(
'登录验证'
)
@allure.story
(
'登录验证'
)
@allure.title
(
'用户名为中文,密码正确'
)
@allure.title
(
'用户名为中文,密码正确'
)
...
@@ -60,5 +60,5 @@ class TestAuthLogin:
...
@@ -60,5 +60,5 @@ class TestAuthLogin:
@allure.step
(
'用户名为中文,密码正确'
)
@allure.step
(
'用户名为中文,密码正确'
)
def
test_login05
(
self
):
def
test_login05
(
self
):
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'这是中文'
,
password
=
'geek1234'
)
.
get_auth_token
()
auth_data
=
AuthHeaders
(
server
=
self
.
server
,
username
=
'这是中文'
,
password
=
'geek1234'
)
.
get_auth_token
()
with
assume
:
assert
auth_data
[
'code'
]
!=
0
with
assume
:
assert
auth_data
.
get
(
'code'
)
!=
0
with
assume
:
assert
'该手机号未注册'
in
auth_data
[
'msg'
]
with
assume
:
assert
'该手机号未注册'
in
auth_data
.
get
(
'msg'
)
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_students_login/test_auth_students.py
View file @
bae3d858
...
@@ -19,9 +19,10 @@ class TestAuthStudents:
...
@@ -19,9 +19,10 @@ class TestAuthStudents:
@allure.description
(
'查询学生包含这个学生'
)
@allure.description
(
'查询学生包含这个学生'
)
def
test_students
(
self
):
def
test_students
(
self
):
students_data
=
app_students_phoneNumber_mobilePhoneNumberBounding_get
(
phoneNumber
=
'13364004418'
,
header
=
self
.
header
,
default_assert
=
False
)
students_data
=
app_students_phoneNumber_mobilePhoneNumberBounding_get
(
phoneNumber
=
'13364004418'
,
header
=
self
.
header
,
default_assert
=
False
)
with
assume
:
assert
students_data
[
'code'
]
==
0
with
assume
:
assert
students_data
.
get
(
'code'
)
==
0
with
assume
:
assert
'小黄测试学生三年级'
in
jsonpath
.
jsonpath
(
students_data
,
'$..name'
)
with
assume
:
assert
'小黄测试学生三年级'
in
jsonpath
.
jsonpath
(
students_data
,
'$..name'
)
with
assume
:
assert
students_data
[
'data'
][
0
][
'student'
][
'phones'
][
0
]
==
'13364004418'
for
students
in
jsonpath
.
jsonpath
(
students_data
,
'$...phones'
):
with
assume
:
assert
students
==
[
'13364004418'
]
@allure.story
(
'登录成功验证'
)
@allure.story
(
'登录成功验证'
)
@allure.title
(
'查询学生设备绑定关系'
)
@allure.title
(
'查询学生设备绑定关系'
)
...
@@ -33,5 +34,4 @@ class TestAuthStudents:
...
@@ -33,5 +34,4 @@ class TestAuthStudents:
"clientIdentify"
:
""
"clientIdentify"
:
""
}
}
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
[
'code'
]
==
0
with
assume
:
assert
push_data
.
get
(
'code'
)
==
0
script/xin_project_patriarch_app/xin_static/xin_crm/xin_apply/xin_pay_order.py
View file @
bae3d858
import
requests
from
script.base_api.api_operation_web.pay
import
pay_post
from
script.base_api
import
pay_post
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_jky_pc_login
import
Headers
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_jky_pc_login
import
Headers
...
@@ -35,7 +33,7 @@ class PayOrder:
...
@@ -35,7 +33,7 @@ class PayOrder:
"""
"""
self
.
payInfos
=
payInfos
self
.
payInfos
=
payInfos
self
.
pay_url
=
'/api-operation-web/pay'
#
self.pay_url = '/api-operation-web/pay'
self
.
pay_body
=
{
self
.
pay_body
=
{
"orderId"
:
self
.
orderId
,
"orderId"
:
self
.
orderId
,
"operatorId"
:
self
.
operatorId
,
"operatorId"
:
self
.
operatorId
,
...
...
script/xin_project_patriarch_app/xin_static/xin_crm/xin_apply/xin_place_order.py
View file @
bae3d858
import
requests
import
datetime
import
datetime
from
script.base_api.api_operation_web.pay
import
pay_post
from
script.base_api.api_operation_web.order
import
order_saveOrder_post
from
script.base_api.api_operation_web.order
import
order_saveOrder_post
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_student
import
CreateStudent
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_student
import
CreateStudent
from
script.xin_project_patriarch_app.xin_static.xin_service.xin_service
import
Service_get
from
script.xin_project_patriarch_app.xin_static.xin_service.xin_service
import
Service_get
...
@@ -13,8 +13,8 @@ class PlaceOrder:
...
@@ -13,8 +13,8 @@ class PlaceOrder:
password
=
None
,
password
=
None
,
studentId
=
None
):
studentId
=
None
):
self
.
server
=
server
self
.
server
=
server
self
.
sava_order_url
=
'/api-operation-web/order/saveOrder?
'
# self.sava_order_url = '/api-operation-web/order/saveOrder
'
self
.
pay_url
=
'/api-operation-web/pay'
#
self.pay_url = '/api-operation-web/pay'
self
.
username
=
username
self
.
username
=
username
self
.
password
=
password
self
.
password
=
password
self
.
studentId
=
studentId
self
.
studentId
=
studentId
...
@@ -58,7 +58,7 @@ class PlaceOrder:
...
@@ -58,7 +58,7 @@ class PlaceOrder:
}
}
]
]
}
}
pay_data
=
requests
.
post
(
self
.
server
+
self
.
pay_url
,
json
=
pay_body
,
headers
=
self
.
header
,
verify
=
False
)
pay_data
=
pay_post
(
body
=
pay_body
,
header
=
self
.
header
)
return
pay_data
.
json
()
return
pay_data
.
json
()
...
...
script/xin_project_patriarch_app/xin_static/xin_crm/xin_apply/xin_save_order.py
View file @
bae3d858
import
requests
from
script.base_api.api_operation_web
import
order_saveOrder_post
from
script.base_api.api_operation_web
import
order_saveOrder_post
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_jky_pc_login
import
Headers
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_jky_pc_login
import
Headers
...
...
script/xin_project_patriarch_app/xin_static/xin_crm/xin_student.py
View file @
bae3d858
...
@@ -149,7 +149,7 @@ class CreateStudent:
...
@@ -149,7 +149,7 @@ class CreateStudent:
urllib3
.
disable_warnings
(
urllib3
.
exceptions
.
InsecureRequestWarning
)
urllib3
.
disable_warnings
(
urllib3
.
exceptions
.
InsecureRequestWarning
)
json_data
=
clue_manualInputAdd_post
(
body
=
create_body
,
header
=
self
.
header
,
default_assert
=
False
)
json_data
=
clue_manualInputAdd_post
(
body
=
create_body
,
header
=
self
.
header
,
default_assert
=
False
)
# json_data = requests.post(url=self.server + create_url, json=create_body, headers=self.header, verify=False)
# json_data = requests.post(url=self.server + create_url, json=create_body, headers=self.header, verify=False)
if
json_data
[
'code'
]
==
0
and
json_data
[
'msg'
]
==
'成功'
:
if
json_data
.
get
(
'code'
)
==
0
and
json_data
.
get
(
'msg'
)
==
'成功'
:
return
self
.
query_student
()
return
self
.
query_student
()
else
:
else
:
return
json_data
return
json_data
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_class_handle/xin_add_class.py
View file @
bae3d858
import
jsonpath
import
jsonpath
import
requests
from
script.base_api
import
education_classes_add_post
,
education_courses_query_post
,
education_classes_query_post
from
script.base_api
import
education_classes_add_post
,
education_courses_query_post
,
education_classes_query_post
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_service.xin_service
import
Service_get
from
script.xin_project_patriarch_app.xin_static.xin_service.xin_service
import
Service_get
...
@@ -105,7 +103,7 @@ class CreateClass:
...
@@ -105,7 +103,7 @@ class CreateClass:
class_data
.
pop
(
'teacherId'
)
class_data
.
pop
(
'teacherId'
)
add_class_data
=
education_classes_add_post
(
params
=
'recommit-ticket=temp-ticket'
,
body
=
class_data
,
header
=
self
.
header
,
default_assert
=
False
)
add_class_data
=
education_classes_add_post
(
params
=
'recommit-ticket=temp-ticket'
,
body
=
class_data
,
header
=
self
.
header
,
default_assert
=
False
)
# add_class_data = requests.post(url=self.server + class_url, json=class_data, headers=self.header, verify=False)
# add_class_data = requests.post(url=self.server + class_url, json=class_data, headers=self.header, verify=False)
if
add_class_data
[
'code'
]
==
0
:
if
add_class_data
.
get
(
'code'
)
==
0
:
# query_url = '/service-education/education/classes/query'
# query_url = '/service-education/education/classes/query'
query_data
=
{
query_data
=
{
"pageSize"
:
30
,
"pageSize"
:
30
,
...
@@ -124,7 +122,7 @@ class CreateClass:
...
@@ -124,7 +122,7 @@ class CreateClass:
}
}
# query_class = requests.post(url=self.server + query_url, json=query_data, headers=self.header, verify=False)
# query_class = requests.post(url=self.server + query_url, json=query_data, headers=self.header, verify=False)
query_class
=
education_classes_query_post
(
body
=
query_data
,
header
=
self
.
header
,
default_assert
=
False
)
query_class
=
education_classes_query_post
(
body
=
query_data
,
header
=
self
.
header
,
default_assert
=
False
)
return
query_class
[
'data'
][
'list'
]
[
0
]
return
query_class
.
get
(
'data'
)
.
get
(
'list'
)
[
0
]
else
:
else
:
return
add_class_data
return
add_class_data
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_class_handle/xin_delete_class.py
View file @
bae3d858
import
requests
from
script.base_api
import
education_classes_delete_post
from
script.base_api
import
education_classes_delete_post
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_jky_pc_login
import
Headers
from
script.xin_project_patriarch_app.xin_static.xin_user.xin_jky_pc_login
import
Headers
...
@@ -19,7 +17,7 @@ class DeleteClass:
...
@@ -19,7 +17,7 @@ class DeleteClass:
# self.url = '/service-education/education/classes/delete'
# self.url = '/service-education/education/classes/delete'
def
delete_class
(
self
):
def
delete_class
(
self
):
delete_msg
=
education_classes_delete_post
(
body
=
self
.
classes
,
header
=
self
.
headers
,
default_assert
=
False
)
delete_msg
=
education_classes_delete_post
(
body
=
self
.
classes
,
header
=
self
.
headers
,
default_assert
=
False
)
return
delete_msg
return
delete_msg
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_class_handle/xin_update_class.py
View file @
bae3d858
...
@@ -124,7 +124,7 @@ class UpdateClass:
...
@@ -124,7 +124,7 @@ class UpdateClass:
# 修改是否属于外地生班
# 修改是否属于外地生班
def
update_class_outLandClass
(
self
,
value
:
bool
):
def
update_class_outLandClass
(
self
,
value
:
bool
):
outLandClass_url
=
'/service-education/education/classes/optionalUpdate'
#
outLandClass_url = '/service-education/education/classes/optionalUpdate'
fields
=
{
fields
=
{
"fields"
:
[
"fields"
:
[
{
{
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_course_handle/xin_course.py
View file @
bae3d858
import
datetime
import
requests
import
requests
from
script.base_api
import
education_courses_add_post
,
education_courses_query_post
,
education_courses_delete_post
from
script.base_api
import
education_courses_add_post
,
education_courses_query_post
,
education_courses_delete_post
...
@@ -36,7 +38,7 @@ class CreateCourse:
...
@@ -36,7 +38,7 @@ class CreateCourse:
schools
:
list
=
None
,
schools
:
list
=
None
,
cContent
=
None
,
cContent
=
None
,
):
):
self
.
courseName
=
courseName
or
"小黄
测试课程
"
self
.
courseName
=
courseName
or
"小黄"
self
.
term
=
term
or
"春"
self
.
term
=
term
or
"春"
self
.
subject
=
subject
or
"数学"
self
.
subject
=
subject
or
"数学"
self
.
productType
=
productType
or
"主线课程"
self
.
productType
=
productType
or
"主线课程"
...
@@ -86,7 +88,7 @@ class CreateCourse:
...
@@ -86,7 +88,7 @@ class CreateCourse:
# course_url = '/service-education/education/courses/add?recommit-ticket=temp-ticket'
# course_url = '/service-education/education/courses/add?recommit-ticket=temp-ticket'
course_body
=
[
course_body
=
[
{
{
"courseName"
:
self
.
courseName
+
self
.
classType
+
self
.
courseType
,
"courseName"
:
self
.
courseName
+
self
.
classType
+
self
.
courseType
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
,
"term"
:
self
.
term
,
"term"
:
self
.
term
,
"subject"
:
self
.
subject
,
"subject"
:
self
.
subject
,
"productType"
:
self
.
productType
,
"productType"
:
self
.
productType
,
...
...
script/xin_project_patriarch_app/xin_static/xin_user/xin_patriarch_login.py
View file @
bae3d858
...
@@ -2,10 +2,10 @@ import json
...
@@ -2,10 +2,10 @@ import json
import
allure
import
allure
import
requests
import
requests
from
requests.packages.urllib3.exceptions
import
InsecureRequestWarning
from
script.xin_project_patriarch_app.xin_static.xin_yaml
import
ReadYaml
,
WriteYaml
from
script.xin_project_patriarch_app.xin_static.xin_yaml
import
ReadYaml
,
WriteYaml
from
requests.packages.urllib3.exceptions
import
InsecureRequestWarning
requests
.
packages
.
urllib3
.
disable_warnings
(
InsecureRequestWarning
)
requests
.
packages
.
urllib3
.
disable_warnings
(
InsecureRequestWarning
)
...
@@ -44,8 +44,8 @@ class AuthHeaders:
...
@@ -44,8 +44,8 @@ class AuthHeaders:
auth_yaml
=
ReadYaml
.
read_yaml_data
(
r'\xin_static\xin_user\patriarch_user'
)
auth_yaml
=
ReadYaml
.
read_yaml_data
(
r'\xin_static\xin_user\patriarch_user'
)
try
:
try
:
for
auth_data
in
auth_yaml
:
for
auth_data
in
auth_yaml
:
if
auth_data
[
'server'
]
==
self
.
server
and
auth_data
[
'user'
]
==
self
.
username
:
if
auth_data
.
get
(
'server'
)
==
self
.
server
and
auth_data
.
get
(
'user'
)
==
self
.
username
:
return
auth_data
[
'headers'
]
return
auth_data
.
get
(
'headers'
)
return
self
.
add_auth_token
(
add
=
True
)
return
self
.
add_auth_token
(
add
=
True
)
except
TypeError
:
except
TypeError
:
return
self
.
add_auth_token
()
return
self
.
add_auth_token
()
...
@@ -53,7 +53,7 @@ class AuthHeaders:
...
@@ -53,7 +53,7 @@ class AuthHeaders:
def
add_auth_token
(
self
,
add
=
False
):
def
add_auth_token
(
self
,
add
=
False
):
auth_json
=
self
.
get_auth_token
()
auth_json
=
self
.
get_auth_token
()
# print(auth_json)
# print(auth_json)
token
=
"Bearer "
+
auth_json
[
'data'
][
'token'
]
token
=
"Bearer "
+
auth_json
.
get
(
'data'
)
.
get
(
'token'
)
headers
=
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
headers
=
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
'Authorization'
:
token
}
'Authorization'
:
token
}
content
=
[
content
=
[
...
@@ -61,7 +61,7 @@ class AuthHeaders:
...
@@ -61,7 +61,7 @@ class AuthHeaders:
'user'
:
self
.
username
,
'user'
:
self
.
username
,
'server'
:
self
.
server
,
'server'
:
self
.
server
,
'headers'
:
headers
,
'headers'
:
headers
,
'userId'
:
auth_json
[
'data'
][
'userId'
]
'userId'
:
auth_json
.
get
(
'data'
)
.
get
(
'userId'
)
}
}
]
]
if
add
:
if
add
:
...
...
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