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
a0875ccb
Commit
a0875ccb
authored
May 08, 2021
by
lanjiali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校区收入查询
parent
e6ceac59
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
26 deletions
+79
-26
workspace.xml
.idea/workspace.xml
+13
-6
run.py
run.py
+1
-1
report_config.py
..._yun_ying_pc/lanjiali_report/data_config/report_config.py
+9
-0
test_school_income.py
script/ji_yun_ying_pc/lanjiali_report/test_school_income.py
+27
-19
test_student_income.py
script/ji_yun_ying_pc/lanjiali_report/test_student_income.py
+29
-0
No files found.
.idea/workspace.xml
View file @
a0875ccb
...
@@ -19,12 +19,10 @@
...
@@ -19,12 +19,10 @@
<select
/>
<select
/>
</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
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/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_expense.py"
beforeDir=
"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_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"
/>
<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>
...
@@ -179,9 +177,9 @@
...
@@ -179,9 +177,9 @@
<recent_temporary>
<recent_temporary>
<list>
<list>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.report_config"
/>
<item
itemvalue=
"Python.hooks"
/>
<item
itemvalue=
"Python.hooks"
/>
<item
itemvalue=
"Python tests.pytest for test_demo.Test_select_student_expense.test_period_screen"
/>
<item
itemvalue=
"Python tests.pytest for test_demo.Test_select_student_expense.test_period_screen"
/>
<item
itemvalue=
"Python.report_config"
/>
<item
itemvalue=
"Python tests.pytest for test_demo.Test_select_student_expense.test_student_exponse"
/>
<item
itemvalue=
"Python tests.pytest for test_demo.Test_select_student_expense.test_student_exponse"
/>
</list>
</list>
</recent_temporary>
</recent_temporary>
...
@@ -279,7 +277,14 @@
...
@@ -279,7 +277,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1620301228395
</updated>
<updated>
1620301228395
</updated>
</task>
</task>
<option
name=
"localTasksCounter"
value=
"13"
/>
<task
id=
"LOCAL-00013"
summary=
"校区收入查询"
>
<created>
1620385172857
</created>
<option
name=
"number"
value=
"00013"
/>
<option
name=
"presentableId"
value=
"LOCAL-00013"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1620385172857
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"14"
/>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"Vcs.Log.Tabs.Properties"
>
<component
name=
"Vcs.Log.Tabs.Properties"
>
...
@@ -305,6 +310,7 @@
...
@@ -305,6 +310,7 @@
<MESSAGE
value=
"学生费用预警查询-分页"
/>
<MESSAGE
value=
"学生费用预警查询-分页"
/>
<MESSAGE
value=
"校区费用预警-查询"
/>
<MESSAGE
value=
"校区费用预警-查询"
/>
<MESSAGE
value=
"学生收入查询"
/>
<MESSAGE
value=
"学生收入查询"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"学生收入查询"
/>
<MESSAGE
value=
"校区收入查询"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"校区收入查询"
/>
</component>
</component>
</project>
</project>
\ No newline at end of file
run.py
View file @
a0875ccb
...
@@ -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_s
chool_income.py::Test_school_income::test_school_income_total
"
,
"-s"
,
"./script/ji_yun_ying_pc/lanjiali_report/test_s
tudent_income.py::Test_student_income::test_diffient_studentincome
"
,
"--alluredir"
,
"./report/xml"
,
"--alluredir"
,
"./report/xml"
,
"--host"
,
"http://192.168.32.31"
,
"--host"
,
"http://192.168.32.31"
,
"--account"
,
"b"
,
"--account"
,
"b"
,
...
...
script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py
View file @
a0875ccb
...
@@ -154,3 +154,12 @@ def select_years():
...
@@ -154,3 +154,12 @@ def select_years():
year
=
today
.
year
year
=
today
.
year
years
=
[
year
-
1
,
year
]
years
=
[
year
-
1
,
year
]
return
years
return
years
#查询校区名称
def
get_schoolarea_name
(
school_area
):
schoolarea_id
=
str
(
school_area
)
sql
=
f
"select name from service_user.department where id in ('{schoolarea_id}')"
schoolarea_name
=
OperationDb
.
query_sql
(
sql
)
return
schoolarea_name
[
0
][
0
]
script/ji_yun_ying_pc/lanjiali_report/test_school_income.py
View file @
a0875ccb
...
@@ -154,32 +154,39 @@ class Test_school_income():
...
@@ -154,32 +154,39 @@ class Test_school_income():
"year"
:
[
select_year
()],
"year"
:
[
select_year
()],
"pageSize"
:
10
,
"pageSize"
:
10
,
"pageNum"
:
1
,
"pageNum"
:
1
,
"schoolArea"
:
school_area
"schoolArea"
:
[
3063
]
}
}
school_income_res
=
report_finance_school_income_list_post
(
body
=
school_income_data
,
header
=
jyy_header
)
school_income_res
=
report_finance_school_income_list_post
(
body
=
school_income_data
,
header
=
jyy_header
)
print
(
school_income_res
)
print
(
school_income_res
)
if
school_income_res
[
'data'
][
'list'
]
==
[]:
assert
school_income_res
[
'msg'
]
==
'成功'
assert
school_income_res
[
'msg'
]
==
'成功'
assert
school_income_res
[
'code'
]
==
0
assert
school_income_res
[
'code'
]
==
0
else
:
school_total_income
=
jsonpath
.
jsonpath
(
school_income_res
,
"$.data.list..totalIncome"
)
total_school_income
=
round
(
sum
(
school_total_income
,
2
)
)
@allure.story
(
"校区收入-分页查询"
)
print
(
total_school_income
)
def
test_schoolincome_page
(
self
):
student_income_data
=
{
school_income_data1
=
{
"keyword"
:
""
,
"keyword"
:
""
,
"studentStatus"
:
[
0
],
"classType"
:
[],
"grade"
:
[],
"subject"
:
[],
"termStr"
:
[
select_term
()],
"termStr"
:
[
select_term
()],
"year"
:
[
select_year
()],
"year"
:
[
select_year
()],
"pageSize"
:
10000
0
,
"pageSize"
:
1
0
,
"pageNum"
:
1
,
"pageNum"
:
1
,
"schoolArea"
:
school_area
"schoolArea"
:
school_areas
}
}
stuincome_res
=
report_finance_student_income_list_post
(
header
=
jyy_header
,
body
=
student_income_data
)
school_income_res
=
report_finance_school_income_list_post
(
body
=
school_income_data1
,
header
=
jyy_header
)
print
(
stuincome_res
)
total
=
school_income_res
[
'data'
][
'total'
]
student_totalincome_list
=
jsonpath
.
jsonpath
(
stuincome_res
,
"$.data.list..totalIncome"
)
print
(
total
)
total_student_income
=
round
(
sum
(
student_totalincome_list
),
2
)
if
total
<=
10
:
print
(
total_student_income
)
assert
school_income_res
[
'msg'
]
==
'成功'
assert
total_school_income
==
total_student_income
assert
school_income_res
[
'data'
][
'pageNum'
]
else
:
school_income_data2
=
{
"keyword"
:
""
,
"termStr"
:
[
select_term
()],
"year"
:
[
select_year
()],
"pageSize"
:
10
,
"pageNum"
:
2
,
"schoolArea"
:
school_areas
}
school_income_res2
=
report_finance_school_income_list_post
(
body
=
school_income_data2
,
header
=
jyy_header
)
assert
school_income_res2
[
'msg'
]
==
'成功'
assert
school_income_res2
[
'data'
][
'pageNum'
]
==
2
\ No newline at end of file
script/ji_yun_ying_pc/lanjiali_report/test_student_income.py
View file @
a0875ccb
# 报表-学生收入查询
# 报表-学生收入查询
import
random
import
allure
import
allure
import
pytest
import
pytest
import
jsonpath
import
jsonpath
...
@@ -196,6 +198,33 @@ class Test_student_income():
...
@@ -196,6 +198,33 @@ class Test_student_income():
assert
res
[
'code'
]
==
0
assert
res
[
'code'
]
==
0
@allure.story
(
"学员收入-不同校区的学生收入"
)
@pytest.mark.parametrize
(
"school_area"
,
random
.
sample
(
school_areas
,
3
))
def
test_diffient_studentincome
(
self
,
school_area
):
data
=
{
"keyword"
:
""
,
"studentStatus"
:
[
0
],
"classType"
:
[],
"grade"
:
[],
"subject"
:
[],
"termStr"
:
[
select_term
()],
"year"
:
[
select_year
()],
"pageSize"
:
10
,
"pageNum"
:
1
,
"schoolArea"
:
[
school_area
]
}
res
=
report_finance_student_income_list_post
(
header
=
jyy_header
,
body
=
data
)
if
res
[
'data'
][
'total'
]
==
0
:
assert
res
[
'msg'
]
==
'成功'
assert
res
[
"code"
]
==
0
else
:
school_area_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..schoolAreaName"
)
schoolarea_name
=
get_schoolarea_name
(
school_area
)
result
=
public_asserts
.
assert_res_field_equal_value
(
school_area_list
,
schoolarea_name
)
pytest
.
assume
(
result
)
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