Commit 48a25d80 authored by lanjiali's avatar lanjiali

校区费用预警

parent a0875ccb
...@@ -20,11 +20,10 @@ ...@@ -20,11 +20,10 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="校区收入查询"> <list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="校区收入查询">
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_school_expense.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/run.py" beforeDir="false" afterPath="$PROJECT_DIR$/run.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/run.py" beforeDir="false" afterPath="$PROJECT_DIR$/run.py" afterDir="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/ji_yun_ying_pc/lanjiali_report/test_school_income.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_school_income.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_student_income.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_student_income.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -284,7 +283,14 @@ ...@@ -284,7 +283,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1620385172857</updated> <updated>1620385172857</updated>
</task> </task>
<option name="localTasksCounter" value="14" /> <task id="LOCAL-00014" summary="校区收入查询">
<created>1620468346117</created>
<option name="number" value="00014" />
<option name="presentableId" value="LOCAL-00014" />
<option name="project" value="LOCAL" />
<updated>1620468346117</updated>
</task>
<option name="localTasksCounter" value="15" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
......
...@@ -3,7 +3,7 @@ import os ...@@ -3,7 +3,7 @@ import os
if __name__ == '__main__': if __name__ == '__main__':
run_config = [ run_config = [
"-s", "./script/ji_yun_ying_pc/lanjiali_report/test_student_income.py::Test_student_income::test_diffient_studentincome", "-s", "./script/ji_yun_ying_pc/lanjiali_report/test_school_expense.py",
"--alluredir", "./report/xml", "--alluredir", "./report/xml",
"--host", "http://192.168.32.31", "--host", "http://192.168.32.31",
"--account", "b", "--account", "b",
......
...@@ -33,7 +33,11 @@ class Test_select_student_expense: ...@@ -33,7 +33,11 @@ class Test_select_student_expense:
"term": "春", "term": "春",
"schoolAreaIds": school_areas "schoolAreaIds": school_areas
} }
res = report_finance_student_expense_warning_post(body=data ,header=jyy_header ) res = report_finance_student_expense_warning_post(body=data ,header=jyy_header)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
if keyword_type == "studentName": if keyword_type == "studentName":
student_names = jsonpath.jsonpath(res, "$.data.list..studentName") student_names = jsonpath.jsonpath(res, "$.data.list..studentName")
result = public_asserts.assert_res_field_contain_value(student_names, keyword_value) result = public_asserts.assert_res_field_contain_value(student_names, keyword_value)
...@@ -57,11 +61,15 @@ class Test_select_student_expense: ...@@ -57,11 +61,15 @@ class Test_select_student_expense:
"pageSize": 10, "pageSize": 10,
"studentStatuses": [1110], "studentStatuses": [1110],
"year": year, "year": year,
"keyword": '蓝', "keyword": '',
"term": "春", "term": "春",
"schoolAreaIds": school_areas "schoolAreaIds": school_areas[0:50]
} }
res = report_finance_student_expense_warning_post(header = jyy_header,body = data) res = report_finance_student_expense_warning_post(header = jyy_header,body = data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
years = jsonpath.jsonpath(res,"$.data.list..year") years = jsonpath.jsonpath(res,"$.data.list..year")
result = public_asserts.assert_res_field_equal_value(years,year) result = public_asserts.assert_res_field_equal_value(years,year)
pytest.assume(result) pytest.assume(result)
...@@ -79,6 +87,10 @@ class Test_select_student_expense: ...@@ -79,6 +87,10 @@ class Test_select_student_expense:
"schoolAreaIds": school_areas "schoolAreaIds": school_areas
} }
res = report_finance_student_expense_warning_post(header=jyy_header, body=data) res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
terms = jsonpath.jsonpath(res,"$.data.list..term") terms = jsonpath.jsonpath(res,"$.data.list..term")
result = public_asserts.assert_res_field_equal_value(terms,term) result = public_asserts.assert_res_field_equal_value(terms,term)
pytest.assume(result) pytest.assume(result)
...@@ -98,6 +110,10 @@ class Test_select_student_expense: ...@@ -98,6 +110,10 @@ class Test_select_student_expense:
"schoolAreaIds": school_areas "schoolAreaIds": school_areas
} }
res = report_finance_student_expense_warning_post(header= jyy_header, body= data) res = report_finance_student_expense_warning_post(header= jyy_header, body= data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
student_status = jsonpath.jsonpath(res,"$.data.list..studentStatus") student_status = jsonpath.jsonpath(res,"$.data.list..studentStatus")
if status_meaning == '在读学员': if status_meaning == '在读学员':
result = public_asserts.assert_res_field_in_list(student_status,status_value) result = public_asserts.assert_res_field_in_list(student_status,status_value)
...@@ -125,6 +141,10 @@ class Test_select_student_expense: ...@@ -125,6 +141,10 @@ class Test_select_student_expense:
"grades": [grade] "grades": [grade]
} }
res = report_finance_student_expense_warning_post(header= jyy_header,body= data) res = report_finance_student_expense_warning_post(header= jyy_header,body= data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
grade_list = jsonpath.jsonpath(res,"$.data.list..grade") grade_list = jsonpath.jsonpath(res,"$.data.list..grade")
if grade == '一年级': if grade == '一年级':
result = public_asserts.assert_res_field_equal_value(grade_list,'1年级') result = public_asserts.assert_res_field_equal_value(grade_list,'1年级')
...@@ -139,7 +159,7 @@ class Test_select_student_expense: ...@@ -139,7 +159,7 @@ class Test_select_student_expense:
result = public_asserts.assert_res_field_equal_value(grade_list,'4年级') result = public_asserts.assert_res_field_equal_value(grade_list,'4年级')
pytest.assume(result) pytest.assume(result)
@allure.title('学生费用预警-学科筛选') @allure.story('学生费用预警-学科筛选')
@pytest.mark.parametrize("subject", subjects) @pytest.mark.parametrize("subject", subjects)
def test_select_subject(self,subject): def test_select_subject(self,subject):
data = { data = {
...@@ -153,6 +173,10 @@ class Test_select_student_expense: ...@@ -153,6 +173,10 @@ class Test_select_student_expense:
"subjects": [subject] "subjects": [subject]
} }
res = report_finance_student_expense_warning_post(header=jyy_header, body=data) res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
subject_list = jsonpath.jsonpath(res,'$.data.list..subject') subject_list = jsonpath.jsonpath(res,'$.data.list..subject')
if subject == '语文': if subject == '语文':
result = public_asserts.assert_res_field_equal_value(subject_list,subject) result = public_asserts.assert_res_field_equal_value(subject_list,subject)
...@@ -187,6 +211,10 @@ class Test_select_student_expense: ...@@ -187,6 +211,10 @@ class Test_select_student_expense:
"schoolAreaIds": school_areas "schoolAreaIds": school_areas
} }
res = report_finance_student_expense_warning_post(header=jyy_header, body=data) res = report_finance_student_expense_warning_post(header=jyy_header, body=data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
class_type_list = jsonpath.jsonpath(res,"$.data.list..classType") class_type_list = jsonpath.jsonpath(res,"$.data.list..classType")
if classtype_name == '常规班课': if classtype_name == '常规班课':
result = public_asserts.assert_res_field_in_list(class_type_list,class_types_value) result = public_asserts.assert_res_field_in_list(class_type_list,class_types_value)
...@@ -267,6 +295,10 @@ class Test_select_student_expense: ...@@ -267,6 +295,10 @@ class Test_select_student_expense:
"schoolAreaIds": school_areas "schoolAreaIds": school_areas
} }
res = report_finance_student_expense_warning_post(header= jyy_header,body= data) res = report_finance_student_expense_warning_post(header= jyy_header,body= data)
if res['data']['list'] == []:
assert res['msg'] == '成功'
assert res['code'] == 0
else:
#获取返回的学生预收课时数,判断与接口返回的计算结果一致 #获取返回的学生预收课时数,判断与接口返回的计算结果一致
total_prepaidNum = jsonpath.jsonpath(res,"$.data.extend.prepaidNum") total_prepaidNum = jsonpath.jsonpath(res,"$.data.extend.prepaidNum")
...@@ -379,9 +411,9 @@ class Test_select_student_expense: ...@@ -379,9 +411,9 @@ class Test_select_student_expense:
"pageSize": 10, "pageSize": 10,
"studentStatuses": [1110], "studentStatuses": [1110],
"year": select_year(), "year": select_year(),
"keyword": '蓝', "keyword": '',
"term": select_term(), "term": select_term(),
"schoolAreaIds": school_areas "schoolAreaIds": school_areas[0:20]
} }
res = report_finance_student_expense_warning_post(header=jyy_header,body=data) res = report_finance_student_expense_warning_post(header=jyy_header,body=data)
studentexpense_total = res['data']['total'] studentexpense_total = res['data']['total']
...@@ -394,9 +426,9 @@ class Test_select_student_expense: ...@@ -394,9 +426,9 @@ class Test_select_student_expense:
"pageSize": 10, "pageSize": 10,
"studentStatuses": [1110], "studentStatuses": [1110],
"year": select_year(), "year": select_year(),
"keyword": '蓝', "keyword": '',
"term": select_term(), "term": select_term(),
"schoolAreaIds": school_areas "schoolAreaIds": school_areas[0:20]
} }
res_page2 = report_finance_student_expense_warning_post(header=jyy_header,body=data2) res_page2 = report_finance_student_expense_warning_post(header=jyy_header,body=data2)
assert res_page2['msg'] == '成功' assert res_page2['msg'] == '成功'
......
This diff is collapsed.
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