Commit d92abd02 authored by lanjiali's avatar lanjiali

学生费用预警查询

parent bc7885aa
......@@ -20,26 +20,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="关键字查询">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/0a9a9396-c2f6-4bee-ad80-415195b22e49-result.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/2ba7635c-a923-4ab2-b7f8-9580e63eb8b3-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/307f5007-2ef3-4d51-8179-66d95f86600f-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/3f18c4b4-ee2d-4907-bbe5-39a7de727f22-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/6e9fef3e-d23f-449c-bf80-7b1495c15cc0-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/73a8ab84-2f12-4cda-a519-4ad030346d0b-result.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/9111ab00-6e2e-43e8-a1ae-bd17d312f15d-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/92ed7752-9a57-420a-9bb0-322e9240842f-result.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/9b9a1cfb-a4d5-4149-9961-cd2ad10670f4-result.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/a631f938-e8b6-41ae-b29f-0deacb928652-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/b6f95a56-d09d-4e41-9522-09b4bf2e201a-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/c1832976-7ac2-4e1d-ae39-d3d1a649f552-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/c30faab2-5f74-4ed0-bd5f-8dcc276fb57d-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/ce14be75-53d0-45aa-8e37-b38a09de86c7-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/eb8d0292-a347-44e2-b0ae-711ef8147990-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/f7a1f6a6-70d7-4eaa-b527-31c3a13d5960-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_demo.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_demo.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/public_asserts.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/public_asserts.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -236,7 +217,14 @@
<option name="project" value="LOCAL" />
<updated>1618969030840</updated>
</task>
<option name="localTasksCounter" value="5" />
<task id="LOCAL-00005" summary="关键字查询">
<created>1619436346922</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1619436346922</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
......
......@@ -20,249 +20,247 @@ import pytest
class Test_select_student_expense:
@allure.story("学生费用预警查询")
#暂不执行
# @pytest.mark.skip(reason="调试中,这个测试用例暂时不执行")
# @allure.step("学生费用预警查询-关键字筛选")
# @pytest.mark.parametrize("keyword", keywords)
# def test_keywords_search(self,keyword):
# keyword_value = keyword.get("keyword")
# #关键字查询类型
# keyword_type = keyword.get("keyword_type")
# data = {
# "pageNum": 1,
# "pageSize": 10,
# "studentStatuses": [1110],
# "year": 2021,
# "keyword": keyword_value,
# "term": "春",
# "schoolAreaIds": school_areas
# }
# res = report_finance_student_expense_warning_post(body=data ,header=jyy_header )
# if keyword_type == "studentName":
# student_names = jsonpath.jsonpath(res, "$.data.list..studentName")
# result = public_asserts.assert_res_field_contain_value(student_names, keyword_value)
# pytest.assume(result)
# elif keyword_type == 'studentNo':
# student_NO = jsonpath.jsonpath(res,"$.data.list..studentNo")
# result = public_asserts.assert_res_field_equal_value(student_NO,keyword_value)
# pytest.assume(result)
# elif keyword_type == "phone":
# student_id = jsonpath.jsonpath(res,"$.data.list..studentId")
# # 调用查询返回的学生id下的学生手机号
# studentphone_list = select_student_phone(student_id)
# result = public_asserts.assert_res_field_equal_value(studentphone_list,keyword_value)
# pytest.assume(result)
#
#
# @allure.step("学生费用预警查询-年份筛选")
# @pytest.mark.parametrize("year",[select_year()])
# @allure.step("学生费用预警查询-年份筛选")
# def test_year_screen(self,year):
# data = {
# "pageNum": 1,
# "pageSize": 10,
# "studentStatuses": [1110],
# "year": year,
# "keyword": '蓝',
# "term": "春",
# "schoolAreaIds": school_areas
# }
# res = report_finance_student_expense_warning_post(header = jyy_header,body = data)
# years = jsonpath.jsonpath(res,"$.data.list..year")
# result = public_asserts.assert_res_field_equal_value(years,year)
# pytest.assume(result)
#
#
# @allure.step('学生费用预警-期段筛选')
# @pytest.mark.parametrize( "term",[select_term()])
# @allure.step("学生费用预警查询-期段筛选")
# def test_period_screen(self,term):
# data = {
# "pageNum": 1,
# "pageSize": 10,
# "studentStatuses": [1110],
# "year": 2021,
# "keyword": '蓝',
# "term": term,
# "schoolAreaIds": school_areas
# }
# res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
# terms = jsonpath.jsonpath(res,"$.data.list..term")
# result = public_asserts.assert_res_field_equal_value(terms,term)
# pytest.assume(result)
#
#
# @allure.step("学生费用预警-学生状态筛选")
# @pytest.mark.parametrize("statuses",student_statuses)
# @allure.step("学生费用预警查询-学生状态筛选")
# def test_student_status(self,statuses):
# status_value = statuses['status']
# status_meaning = statuses['meaning']
# data = {
# "pageNum": 1,
# "pageSize": 10,
# "studentStatuses": status_value,
# "year": select_year(),
# "keyword": '蓝',
# "term": select_term(),
# "schoolAreaIds": school_areas
# }
# res = report_finance_student_expense_warning_post(header= jyy_header, body= data)
# student_status = jsonpath.jsonpath(res,"$.data.list..studentStatus")
# if status_meaning == '在读学员':
# result = public_asserts.assert_res_field_in_list(student_status,status_value)
# pytest.assume(result)
# elif status_meaning == '结业学员':
# result = public_asserts.assert_res_field_in_list(student_status, status_value)
# pytest.assume(result)
# elif status_meaning == '出班学员':
# result = public_asserts.assert_res_field_in_list(student_status, status_value)
# pytest.assume(result)
# elif status_meaning == '全部学员':
# result = public_asserts.assert_res_field_in_list(student_status, status_value)
# pytest.assume(result)
#
# @allure.step('学生费用预警-年级筛选')
# @pytest.mark.parametrize("grade",grades)
# @allure.step("学生费用预警查询-年级筛选")
# def test_select_grade(self,grade):
# data = {
# "pageNum": 1,
# "pageSize": 10,
# "studentStatuses": [1110],
# "year": select_year(),
# "term": select_term(),
# "schoolAreaIds": school_areas,
# "grades": [grade]
# }
# res = report_finance_student_expense_warning_post(header= jyy_header,body= data)
# grade_list = jsonpath.jsonpath(res,"$.data.list..grade")
# if grade == '一年级':
# result = public_asserts.assert_res_field_equal_value(grade_list,'1年级')
# pytest.assume(result)
# elif grade == '二年级':
# result = public_asserts.assert_res_field_equal_value(grade_list,'2年级')
# pytest.assume(result)
# elif grade == '三年级':
# result = public_asserts.assert_res_field_equal_value(grade_list,'3年级')
# pytest.assume(result)
# elif grade == '四年级':
# result = public_asserts.assert_res_field_equal_value(grade_list,'4年级')
# pytest.assume(result)
#
# @allure.step('学生费用预警-学科筛选')
# @pytest.mark.parametrize("subject", subjects)
# @allure.step("学生费用预警查询-学科筛选")
# def test_select_subject(self,subject):
# data = {
# "pageNum": 1,
# "pageSize": 10,
# "studentStatuses": [1110],
# "year": select_year(),
# "term": select_term(),
# "schoolAreaIds": school_areas,
# "grades": ['一年级','九年级'],
# "subjects": [subject]
# }
# res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
# subject_list = jsonpath.jsonpath(res,'$.data.list..subject')
# if subject == '语文':
# result = public_asserts.assert_res_field_equal_value(subject_list,subject)
# pytest.assume(result)
# elif subject == '英语':
# result = public_asserts.assert_res_field_equal_value(subject_list,subject)
# pytest.assume(result)
# elif subject == '物理':
# result = public_asserts.assert_res_field_equal_value(subject_list,subject)
# pytest.assume(result)
# elif subject == '数学':
# result = public_asserts.assert_res_field_equal_value(subject_list,subject)
# pytest.assume(result)
# elif subject == '化学':
# result = public_asserts.assert_res_field_equal_value(subject_list,subject)
# pytest.assume(result)
#
# @allure.step("学生费用预警-班型筛选")
# @pytest.mark.parametrize("class_types",classTypes)
# @allure.step("学生费用预警查询-班型筛选")
# def test_select_classTypes(self,class_types):
# class_types_value = class_types['classType']
# classtype_name = class_types['classType_name']
# data = {
# "pageSize": 10,
# "pageNum": 1,
# "studentStatuses": [1110],
# "year": 2021,
# "term": "春",
# "subjects": ["数学", "语文"],
# "grades": ["三年级"],
# "classTypes": class_types_value,
# "schoolAreaIds": school_areas
# }
# res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
# class_type_list = jsonpath.jsonpath(res,"$.data.list..classType")
# if classtype_name == '常规班课':
# result = public_asserts.assert_res_field_in_list(class_type_list,class_types_value)
# pytest.assume(result)
# elif classtype_name == '精品定制课':
# result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
# pytest.assume(result)
# elif classtype_name == '集训班课':
# result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
# pytest.assume(result)
# elif classtype_name == '专题班课':
# result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
# pytest.assume(result)
# elif classtype_name == '服务班课':
# result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
# pytest.assume(result)
#
#
# @allure.step("学生费用预警-组合筛选")
# @allure.step("学生费用预警查询-组合筛选")
# def test_select_classTypes(self):
# data = {
# "pageSize": 10,
# "pageNum": 1,
# "studentStatuses": [1110],
# "keyword": '蓝',
# "year": 2021,
# "term": "春",
# "subjects": ["数学"],
# "grades": ["三年级"],
# "classTypes": ["极趣班"],
# "schoolAreaIds": school_areas
# }
# res = report_finance_student_expense_warning_post(header= jyy_header,body= data)
# print(res)
# #校验名字
# studentName_list = jsonpath.jsonpath(res,"$.data.list..studentName")
# keyword_res = public_asserts.assert_res_field_contain_value(studentName_list,'蓝')
# pytest.assume(keyword_res)
# #校验学生状态
# studentStatuse_list = jsonpath.jsonpath(res,"$.data.list..studentStatus")
# statue_res = public_asserts.assert_res_field_in_list(studentStatuse_list,[1110])
# pytest.assume(statue_res)
# #校验年份
# year_list = jsonpath.jsonpath(res,"$.data.list..year")
# year_res = public_asserts.assert_res_field_equal_value(year_list,'2021')
# pytest.assume(year_res)
# #校验期段
# term_list = jsonpath.jsonpath(res, "$.data.list..term")
# term_res = public_asserts.assert_res_field_in_list(term_list, ['春'])
# pytest.assume(term_res)
# #校验学科
# subjects_list = jsonpath.jsonpath(res, "$.data.list..subject")
# subjects_res = public_asserts.assert_res_field_equal_value(subjects_list, '数学')
# pytest.assume(subjects_res)
# #校验年级
# grade_list = jsonpath.jsonpath(res, "$.data.list..grade")
# grade_res = public_asserts.assert_res_field_equal_value(grade_list, '3年级')
# pytest.assume(grade_res)
# # 校验班型
# classType_list = jsonpath.jsonpath(res, "$.data.list..classType")
# classType_res = public_asserts.assert_res_field_equal_value(classType_list, '极趣班')
# pytest.assume(classType_res)
@allure.step("学生费用预警查询-关键字筛选")
@pytest.mark.parametrize("keyword", keywords)
def test_keywords_search(self,keyword):
keyword_value = keyword.get("keyword")
#关键字查询类型
keyword_type = keyword.get("keyword_type")
data = {
"pageNum": 1,
"pageSize": 10,
"studentStatuses": [1110],
"year": 2021,
"keyword": keyword_value,
"term": "春",
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(body=data ,header=jyy_header )
if keyword_type == "studentName":
student_names = jsonpath.jsonpath(res, "$.data.list..studentName")
result = public_asserts.assert_res_field_contain_value(student_names, keyword_value)
pytest.assume(result)
elif keyword_type == 'studentNo':
student_NO = jsonpath.jsonpath(res,"$.data.list..studentNo")
result = public_asserts.assert_res_field_equal_value(student_NO,keyword_value)
pytest.assume(result)
elif keyword_type == "phone":
student_id = jsonpath.jsonpath(res,"$.data.list..studentId")
# 调用查询返回的学生id下的学生手机号
studentphone_list = select_student_phone(student_id)
result = public_asserts.assert_res_field_equal_value(studentphone_list,keyword_value)
pytest.assume(result)
@allure.step("学生费用预警查询-年份筛选")
@pytest.mark.parametrize("year",[select_year()])
@allure.step("学生费用预警查询-年份筛选")
def test_year_screen(self,year):
data = {
"pageNum": 1,
"pageSize": 10,
"studentStatuses": [1110],
"year": year,
"keyword": '蓝',
"term": "春",
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(header = jyy_header,body = data)
years = jsonpath.jsonpath(res,"$.data.list..year")
result = public_asserts.assert_res_field_equal_value(years,year)
pytest.assume(result)
@allure.step('学生费用预警-期段筛选')
@pytest.mark.parametrize( "term",[select_term()])
@allure.step("学生费用预警查询-期段筛选")
def test_period_screen(self,term):
data = {
"pageNum": 1,
"pageSize": 10,
"studentStatuses": [1110],
"year": 2021,
"keyword": '蓝',
"term": term,
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
terms = jsonpath.jsonpath(res,"$.data.list..term")
result = public_asserts.assert_res_field_equal_value(terms,term)
pytest.assume(result)
@allure.step("学生费用预警-学生状态筛选")
@pytest.mark.parametrize("statuses",student_statuses)
@allure.step("学生费用预警查询-学生状态筛选")
def test_student_status(self,statuses):
status_value = statuses['status']
status_meaning = statuses['meaning']
data = {
"pageNum": 1,
"pageSize": 10,
"studentStatuses": status_value,
"year": select_year(),
"keyword": '蓝',
"term": select_term(),
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(header= jyy_header, body= data)
student_status = jsonpath.jsonpath(res,"$.data.list..studentStatus")
if status_meaning == '在读学员':
result = public_asserts.assert_res_field_in_list(student_status,status_value)
pytest.assume(result)
elif status_meaning == '结业学员':
result = public_asserts.assert_res_field_in_list(student_status, status_value)
pytest.assume(result)
elif status_meaning == '出班学员':
result = public_asserts.assert_res_field_in_list(student_status, status_value)
pytest.assume(result)
elif status_meaning == '全部学员':
result = public_asserts.assert_res_field_in_list(student_status, status_value)
pytest.assume(result)
@allure.step('学生费用预警-年级筛选')
@pytest.mark.parametrize("grade",grades)
@allure.step("学生费用预警查询-年级筛选")
def test_select_grade(self,grade):
data = {
"pageNum": 1,
"pageSize": 10,
"studentStatuses": [1110],
"year": select_year(),
"term": select_term(),
"schoolAreaIds": school_areas,
"grades": [grade]
}
res = report_finance_student_expense_warning_post(header= jyy_header,body= data)
grade_list = jsonpath.jsonpath(res,"$.data.list..grade")
if grade == '一年级':
result = public_asserts.assert_res_field_equal_value(grade_list,'1年级')
pytest.assume(result)
elif grade == '二年级':
result = public_asserts.assert_res_field_equal_value(grade_list,'2年级')
pytest.assume(result)
elif grade == '三年级':
result = public_asserts.assert_res_field_equal_value(grade_list,'3年级')
pytest.assume(result)
elif grade == '四年级':
result = public_asserts.assert_res_field_equal_value(grade_list,'4年级')
pytest.assume(result)
@allure.step('学生费用预警-学科筛选')
@pytest.mark.parametrize("subject", subjects)
@allure.step("学生费用预警查询-学科筛选")
def test_select_subject(self,subject):
data = {
"pageNum": 1,
"pageSize": 10,
"studentStatuses": [1110],
"year": select_year(),
"term": select_term(),
"schoolAreaIds": school_areas,
"grades": ['一年级','九年级'],
"subjects": [subject]
}
res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
subject_list = jsonpath.jsonpath(res,'$.data.list..subject')
if subject == '语文':
result = public_asserts.assert_res_field_equal_value(subject_list,subject)
pytest.assume(result)
elif subject == '英语':
result = public_asserts.assert_res_field_equal_value(subject_list,subject)
pytest.assume(result)
elif subject == '物理':
result = public_asserts.assert_res_field_equal_value(subject_list,subject)
pytest.assume(result)
elif subject == '数学':
result = public_asserts.assert_res_field_equal_value(subject_list,subject)
pytest.assume(result)
elif subject == '化学':
result = public_asserts.assert_res_field_equal_value(subject_list,subject)
pytest.assume(result)
@allure.step("学生费用预警-班型筛选")
@pytest.mark.parametrize("class_types",classTypes)
@allure.step("学生费用预警查询-班型筛选")
def test_select_classTypes(self,class_types):
class_types_value = class_types['classType']
classtype_name = class_types['classType_name']
data = {
"pageSize": 10,
"pageNum": 1,
"studentStatuses": [1110],
"year": 2021,
"term": "春",
"subjects": ["数学", "语文"],
"grades": ["三年级"],
"classTypes": class_types_value,
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
class_type_list = jsonpath.jsonpath(res,"$.data.list..classType")
if classtype_name == '常规班课':
result = public_asserts.assert_res_field_in_list(class_type_list,class_types_value)
pytest.assume(result)
elif classtype_name == '精品定制课':
result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
pytest.assume(result)
elif classtype_name == '集训班课':
result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
pytest.assume(result)
elif classtype_name == '专题班课':
result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
pytest.assume(result)
elif classtype_name == '服务班课':
result = public_asserts.assert_res_field_in_list(class_type_list, class_types_value)
pytest.assume(result)
@allure.step("学生费用预警-组合筛选")
@allure.step("学生费用预警查询-组合筛选")
def test_select_classTypes(self):
data = {
"pageSize": 10,
"pageNum": 1,
"studentStatuses": [1110],
"keyword": '蓝',
"year": 2021,
"term": "春",
"subjects": ["数学"],
"grades": ["三年级"],
"classTypes": ["极趣班"],
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(header= jyy_header,body= data)
print(res)
#校验名字
studentName_list = jsonpath.jsonpath(res,"$.data.list..studentName")
keyword_res = public_asserts.assert_res_field_contain_value(studentName_list,'蓝')
pytest.assume(keyword_res)
#校验学生状态
studentStatuse_list = jsonpath.jsonpath(res,"$.data.list..studentStatus")
statue_res = public_asserts.assert_res_field_in_list(studentStatuse_list,[1110])
pytest.assume(statue_res)
#校验年份
year_list = jsonpath.jsonpath(res,"$.data.list..year")
year_res = public_asserts.assert_res_field_equal_value(year_list,'2021')
pytest.assume(year_res)
#校验期段
term_list = jsonpath.jsonpath(res, "$.data.list..term")
term_res = public_asserts.assert_res_field_in_list(term_list, ['春'])
pytest.assume(term_res)
#校验学科
subjects_list = jsonpath.jsonpath(res, "$.data.list..subject")
subjects_res = public_asserts.assert_res_field_equal_value(subjects_list, '数学')
pytest.assume(subjects_res)
#校验年级
grade_list = jsonpath.jsonpath(res, "$.data.list..grade")
grade_res = public_asserts.assert_res_field_equal_value(grade_list, '3年级')
pytest.assume(grade_res)
# 校验班型
classType_list = jsonpath.jsonpath(res, "$.data.list..classType")
classType_res = public_asserts.assert_res_field_equal_value(classType_list, '极趣班')
pytest.assume(classType_res)
@allure.step("学生费用预警-列表数据汇总")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment