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
09e47033
Commit
09e47033
authored
May 11, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加到购课单
parent
d762bafd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
159 additions
and
18 deletions
+159
-18
test_auth_choose_class_details.py
...p/test_xin_choose_class/test_auth_choose_class_details.py
+43
-1
test_auth_add_purchase.py
...rch_app/test_xin_purchase_class/test_auth_add_purchase.py
+0
-0
test_auth_remove_purchase.py
..._app/test_xin_purchase_class/test_auth_remove_purchase.py
+5
-0
test_auth_update_puchase.py
...h_app/test_xin_purchase_class/test_auth_update_puchase.py
+0
-0
test_auth_update_purchase.py
..._app/test_xin_purchase_class/test_auth_update_purchase.py
+5
-0
test_show_puchase.py
...atriarch_app/test_xin_purchase_class/test_show_puchase.py
+0
-0
test_show_purchase.py
...triarch_app/test_xin_purchase_class/test_show_purchase.py
+5
-0
__init__.py
...ic/xin_choose_class/xin_add_class_to_purchase/__init__.py
+0
-0
xin_class_add_to_purchase.py
...ss/xin_add_class_to_purchase/xin_class_add_to_purchase.py
+32
-0
xin_change_list_index.py
...patriach_static/xin_public_class/xin_change_list_index.py
+10
-0
xin_global_static.py
...xin_patriach_static/xin_public_class/xin_global_static.py
+3
-0
xin_student.py
...n_project_patriarch_app/xin_static/xin_crm/xin_student.py
+0
-1
xin_add_class.py
..._static/xin_educational/xin_class_handle/xin_add_class.py
+2
-2
xin_course.py
...in_static/xin_educational/xin_course_handle/xin_course.py
+0
-3
xin_update_course.py
...ic/xin_educational/xin_course_handle/xin_update_course.py
+28
-1
xin_school.py
...roject_patriarch_app/xin_static/xin_setting/xin_school.py
+26
-10
No files found.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class_details.py
View file @
09e47033
import
datetime
import
datetime
import
time
import
time
from
datetime
import
timedelta
import
allure
import
allure
from
pytest_assume.plugin
import
assume
from
pytest_assume.plugin
import
assume
...
@@ -13,6 +13,7 @@ from script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handl
...
@@ -13,6 +13,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_class_handle.xin_update_class
import
UpdateClass
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_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_setting
import
School
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
...
@@ -180,3 +181,44 @@ class TestAuthChoseClassDetails:
...
@@ -180,3 +181,44 @@ 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'
)
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证上下分段的班级只能买上,排课显示正确'
)
@allure.description
(
'验证上下分段的班级只能买上,排课显示正确'
)
def
test_subsection_top_class_time
(
self
):
# 获取当前时间后两天为分段上的结束时间
start_time
=
datetime
.
datetime
.
now
()
+
timedelta
(
days
=
2
)
# 获取当前时间后七天的时间作为下的结束时间
end_time
=
datetime
.
datetime
.
now
()
+
timedelta
(
days
=
2
)
# 格式化成后端接受的参数
start_time
=
start_time
.
strftime
(
"
%
Y/
%
m/
%
d"
)
+
' 23:59:59'
end_time
=
end_time
.
strftime
(
"
%
Y/
%
m/
%
d"
)
+
' 23:59:59'
sectionValue
=
[
{
"term"
:
StaticGlobal
.
TERM
,
"upRegisterDeadline"
:
start_time
,
"registerDeadline"
:
end_time
}
]
# 修改校区为分段
School
(
body
=
School
.
param
(
sectionValue
=
sectionValue
),
server
=
self
.
server
)
.
school_update
()
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证上下分段的班级上下一起买,排课显示正确'
)
@allure.description
(
'验证上下分段的班级上下一起买,排课显示正确'
)
def
test_subsection_bottom_class_time
(
self
):
pass
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证上下分段的班级只能买上,金额显示正确'
)
@allure.description
(
'验证上下分段的班级只能买上,金额显示正确'
)
def
test_subsection_top_class_price
(
self
):
pass
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'验证上下分段的班级上下一起买,金额显示正确'
)
@allure.description
(
'验证上下分段的班级上下一起买,金额显示正确'
)
def
test_subsection_bottom_class_price
(
self
):
pass
@allure.story
(
'选课列表-班级详情'
)
@allure.title
(
'删除班级,查看班级详情'
)
@allure.description
(
'删除班级,查看班级详情'
)
def
test_delete_class_and_query_class
(
self
):
pass
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_purchase_class/test_auth_add_purchase.py
View file @
09e47033
This diff is collapsed.
Click to expand it.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_purchase_class/test_auth_remove_purchase.py
0 → 100644
View file @
09e47033
"""
@encoding: utf-8
@Author: LiuHangXin
@Time: 2021/5/6
"""
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_purchase_class/test_auth_update_puchase.py
deleted
100644 → 0
View file @
d762bafd
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_purchase_class/test_auth_update_purchase.py
0 → 100644
View file @
09e47033
"""
@encoding: utf-8
@Author: LiuHangXin
@Time: 2021/5/6
"""
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_purchase_class/test_show_puchase.py
deleted
100644 → 0
View file @
d762bafd
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_purchase_class/test_show_purchase.py
0 → 100644
View file @
09e47033
"""
@encoding: utf-8
@Author: LiuHangXin
@Time: 2021/5/6
"""
script/xin_project_patriarch_app/xin_patriarch_app/
test_xin_purchase_class/test_auth_remove_puchase
.py
→
script/xin_project_patriarch_app/xin_patriarch_app/
xin_patriach_static/xin_choose_class/xin_add_class_to_purchase/__init__
.py
View file @
09e47033
File moved
script/xin_project_patriarch_app/xin_patriarch_app/xin_patriach_static/xin_choose_class/xin_add_class_to_purchase/xin_class_add_to_purchase.py
0 → 100644
View file @
09e47033
from
script.base_api
import
app_purchaseOrder_studentId_student_post
class
AddClassToPurchase
:
def
__init__
(
self
,
server
,
classId
,
header
,
studentId
):
"""
@param server: 服务
@param classId: 班级id
@param header: 请求头
@param studentId: 学生id
"""
self
.
server
=
server
self
.
classId
=
classId
self
.
studentId
=
studentId
self
.
headers
=
header
self
.
body
=
{
"type"
:
"single"
,
"classes"
:
[
str
(
self
.
classId
)
]
}
"""
家长APP加入购课单
"""
def
class_add_to_purchase
(
self
):
results_data
=
app_purchaseOrder_studentId_student_post
(
header
=
self
.
headers
,
body
=
self
.
body
,
studentId
=
self
.
studentId
)
return
results_data
script/xin_project_patriarch_app/xin_patriarch_app/xin_patriach_static/xin_public_class/xin_change_list_index.py
View file @
09e47033
class
ChangeListIndex
:
class
ChangeListIndex
:
"""
用来返回info_name所在列表的值以及下标
"""
@classmethod
@classmethod
def
change_list_index
(
cls
,
data
:
list
,
key_name
,
info_name
):
def
change_list_index
(
cls
,
data
:
list
,
key_name
,
info_name
):
"""
@param data: 列表
@param key_name: 列表中的主键
@param info_name: value值
@return: 返回列表
"""
return
dict
((
data_msg
[
key_name
],
dict
(
data_msg
,
index
=
index
))
for
(
index
,
data_msg
)
in
enumerate
(
data
))[
info_name
]
return
dict
((
data_msg
[
key_name
],
dict
(
data_msg
,
index
=
index
))
for
(
index
,
data_msg
)
in
enumerate
(
data
))[
info_name
]
script/xin_project_patriarch_app/xin_patriarch_app/xin_patriach_static/xin_public_class/xin_global_static.py
View file @
09e47033
from
common.common_config
import
common_config
class
StaticGlobal
:
class
StaticGlobal
:
YEAR
=
2021
YEAR
=
2021
TERM
=
'春'
TERM
=
'春'
...
...
script/xin_project_patriarch_app/xin_static/xin_crm/xin_student.py
View file @
09e47033
import
requests
import
urllib3
import
urllib3
from
script.base_api
import
clue_manualInputAdd_post
,
clue_delete_delete
from
script.base_api
import
clue_manualInputAdd_post
,
clue_delete_delete
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_class_handle/xin_add_class.py
View file @
09e47033
...
@@ -61,7 +61,7 @@ class CreateClass:
...
@@ -61,7 +61,7 @@ class CreateClass:
year
=
jsonpath
.
jsonpath
(
courseId
,
'$...year'
)[
0
]
year
=
jsonpath
.
jsonpath
(
courseId
,
'$...year'
)[
0
]
subject
=
jsonpath
.
jsonpath
(
courseId
,
'$...subject'
)[
0
]
subject
=
jsonpath
.
jsonpath
(
courseId
,
'$...subject'
)[
0
]
term
=
jsonpath
.
jsonpath
(
courseId
,
'$...term'
)[
0
]
term
=
jsonpath
.
jsonpath
(
courseId
,
'$...term'
)[
0
]
registerGrade
=
jsonpath
.
jsonpath
(
courseId
,
'$...registerG
rade'
)[
0
]
grade
=
jsonpath
.
jsonpath
(
courseId
,
'$...g
rade'
)[
0
]
classType
=
jsonpath
.
jsonpath
(
courseId
,
'$...classType'
)[
0
]
classType
=
jsonpath
.
jsonpath
(
courseId
,
'$...classType'
)[
0
]
self
.
courseId
=
jsonpath
.
jsonpath
(
courseId
,
'$...courseId'
)[
0
]
self
.
courseId
=
jsonpath
.
jsonpath
(
courseId
,
'$...courseId'
)[
0
]
courseType
=
jsonpath
.
jsonpath
(
courseId
,
'$...courseType'
)[
0
]
courseType
=
jsonpath
.
jsonpath
(
courseId
,
'$...courseType'
)[
0
]
...
@@ -113,7 +113,7 @@ class CreateClass:
...
@@ -113,7 +113,7 @@ class CreateClass:
"classType"
:
classType
,
"classType"
:
classType
,
"year"
:
year
,
"year"
:
year
,
"term"
:
term
,
"term"
:
term
,
"grade"
:
registerG
rade
,
"grade"
:
g
rade
,
"subject"
:
subject
,
"subject"
:
subject
,
"classStatus"
:
"在读"
,
"classStatus"
:
"在读"
,
"schoolAreaIds"
:
[
"schoolAreaIds"
:
[
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_course_handle/xin_course.py
View file @
09e47033
import
datetime
import
datetime
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
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
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_educational/xin_course_handle/xin_update_course.py
View file @
09e47033
import
requests
import
requests
from
script.base_api
import
education_courses_modifyPrice_post
,
education_courses_queryById_get
,
education_update_course_class_post
from
script.base_api
import
education_courses_modifyPrice_post
,
education_courses_queryById_get
,
education_update_course_class_post
,
education_courses_startOrStop_put
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
...
@@ -181,6 +181,33 @@ class UpdateCourseSchool:
...
@@ -181,6 +181,33 @@ class UpdateCourseSchool:
return
requests
.
post
(
url
=
self
.
server
+
self
.
update_school_url
,
json
=
self
.
update_body
,
headers
=
self
.
headers
,
verify
=
False
)
.
json
()
return
requests
.
post
(
url
=
self
.
server
+
self
.
update_school_url
,
json
=
self
.
update_body
,
headers
=
self
.
headers
,
verify
=
False
)
.
json
()
"""
停用或启用课程
"""
class
StopOrStartCourse
:
def
__init__
(
self
,
server
,
course_data
,
username
=
None
,
password
=
None
):
"""
@param server: 服务
@param course_data: [{"courseId":10038356,"courseStatus":2}],请求参数,1是启用,2是停用
@param username: 用户名
@param password: 密码
"""
self
.
server
=
server
self
.
course_data
=
course_data
self
.
username
=
username
self
.
password
=
password
self
.
headers
=
Headers
(
server
=
self
.
server
,
username
=
self
.
username
,
password
=
self
.
password
)
.
get_headers
()
def
stop_or_start_course
(
self
):
return
education_courses_startOrStop_put
(
body
=
self
.
course_data
,
header
=
self
.
headers
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
server_ip
=
'http://172.10.62.94'
server_ip
=
'http://172.10.62.94'
return_data
=
UpdateCoursePrice
(
server
=
server_ip
,
courseId
=
10035293
,
coursePrice
=
100
)
.
update_course_price
()
return_data
=
UpdateCoursePrice
(
server
=
server_ip
,
courseId
=
10035293
,
coursePrice
=
100
)
.
update_course_price
()
...
...
script/xin_project_patriarch_app/xin_static/xin_setting/xin_school.py
View file @
09e47033
...
@@ -19,10 +19,20 @@ class School:
...
@@ -19,10 +19,20 @@ class School:
def
school_update
(
self
):
def
school_update
(
self
):
# school_url = '/service-user/departments/school'
# school_url = '/service-user/departments/school'
school_data
=
departments_school_post
(
body
=
self
.
body
,
header
=
self
.
headers
,
default_assert
=
False
)
school_data
=
departments_school_post
(
body
=
self
.
body
,
header
=
self
.
headers
,
default_assert
=
False
)
return
school_data
.
json
()
return
school_data
@classmethod
@classmethod
def
param
(
cls
,
sectionSetting
=
1
):
def
param
(
cls
,
sectionValue
,
sectionSetting
=
1
):
"""
@param sectionValue: 连报 "sectionValue": [
{"term": "秋", "upRegisterDeadline": "2021/01/27 23:59:59", "registerDeadline": "2021/2/28 23:59:59"},
{"term": "寒", "upRegisterDeadline": "2020/10/30 23:59:59", "registerDeadline": "2020/10/31 23:59:59"},
{"term": "春", "upRegisterDeadline": "2021/03/27 23:59:59", "registerDeadline": "2021/04/30 23:59:59"},
{"term": "暑", "upRegisterDeadline": "2021/01/27 23:59:59", "registerDeadline": "2021/01/30 23:59:59"},
]
@param sectionSetting: 是否设置连报,1为是,0为否
@return:
"""
data
=
{
data
=
{
"id"
:
3052
,
"id"
:
3052
,
"name"
:
"测试成都校区"
,
"name"
:
"测试成都校区"
,
...
@@ -42,22 +52,28 @@ class School:
...
@@ -42,22 +52,28 @@ class School:
"latitude"
:
30.654541
,
"latitude"
:
30.654541
,
"seatRule"
:
{
"enable"
:
True
},
"seatRule"
:
{
"enable"
:
True
},
"sectionSetting"
:
1
,
"sectionSetting"
:
1
,
"sectionValue"
:
[
"sectionValue"
:
sectionValue
,
{
"term"
:
"秋"
,
"upRegisterDeadline"
:
"2021/01/27 23:59:59"
,
"registerDeadline"
:
"2021/2/28 23:59:59"
},
{
"term"
:
"寒"
,
"upRegisterDeadline"
:
"2020/10/30 23:59:59"
,
"registerDeadline"
:
"2020/10/31 23:59:59"
},
{
"term"
:
"春"
,
"upRegisterDeadline"
:
"2021/03/27 23:59:59"
,
"registerDeadline"
:
"2021/04/30 23:59:59"
},
{
"term"
:
"暑"
,
"upRegisterDeadline"
:
"2021/01/27 23:59:59"
,
"registerDeadline"
:
"2021/01/30 23:59:59"
},
],
}
}
if
sectionSetting
==
0
:
if
sectionSetting
==
0
:
data
[
'sectionSetting'
]
=
0
data
[
'sectionSetting'
]
=
0
data
.
pop
(
'sectionValue'
)
data
.
pop
(
'sectionValue'
)
print
(
data
)
return
data
return
data
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
print
(
School
(
server
=
Service_get
.
service_content
(
'94'
),
body
=
School
.
param
())
.
school_update
())
print
(
School
(
server
=
Service_get
.
service_content
(
'36'
),
body
=
School
.
param
(
sectionSetting
=
1
,
sectionValue
=
[
print
(
School
.
param
())
{
"term"
:
"秋"
,
"upRegisterDeadline"
:
"2021/01/27 23:59:59"
,
"registerDeadline"
:
"2022/2/28 23:59:59"
},
{
"term"
:
"寒"
,
"upRegisterDeadline"
:
"2020/10/30 23:59:59"
,
"registerDeadline"
:
"2020/10/31 23:59:59"
},
{
"term"
:
"春"
,
"upRegisterDeadline"
:
"2021/03/27 23:59:59"
,
"registerDeadline"
:
"2021/04/30 23:59:59"
},
{
"term"
:
"暑"
,
"upRegisterDeadline"
:
"2021/01/27 23:59:59"
,
"registerDeadline"
:
"2021/01/30 23:59:59"
},
]))
.
school_update
())
# print(School.param(sectionValue=[
# {"term": "秋", "upRegisterDeadline": "2021/01/27 23:59:59", "registerDeadline": "2021/2/28 23:59:59"},
# {"term": "寒", "upRegisterDeadline": "2020/10/30 23:59:59", "registerDeadline": "2020/10/31 23:59:59"},
# {"term": "春", "upRegisterDeadline": "2021/03/27 23:59:59", "registerDeadline": "2021/04/30 23:59:59"},
# {"term": "暑", "upRegisterDeadline": "2021/01/27 23:59:59", "registerDeadline": "2021/01/30 23:59:59"},
# ]))
"""
"""
这是是否连报设置
这是是否连报设置
"communiqueRule": {
"communiqueRule": {
...
...
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