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
1667d579
Commit
1667d579
authored
Apr 21, 2021
by
lanjiali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关键字查询
parent
db573bf4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
102 additions
and
32 deletions
+102
-32
jk_interface_test.iml
.idea/jk_interface_test.iml
+1
-1
misc.xml
.idea/misc.xml
+2
-1
shelved.patch
...t_at_2021_4_12,_11_11_[Default_Changelist]1/shelved.patch
+0
-16
Uncommitted_changes_before_Checkout_at_2021_4_12__11_11__Default_Changelist_1.xml
...re_Checkout_at_2021_4_12__11_11__Default_Changelist_1.xml
+0
-5
shelved.patch
...te_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch
+0
-0
Uncommitted_changes_before_Update_at_2021_4_13__20_21__Default_Changelist_.xml
...efore_Update_at_2021_4_13__20_21__Default_Changelist_.xml
+0
-5
workspace.xml
.idea/workspace.xml
+0
-0
run.py
run.py
+4
-4
data_config.py
script/ji_yun_ying_pc/data_config/data_config.py
+2
-0
__init__.py
script/ji_yun_ying_pc/lanjiali_report/__init__.py
+0
-0
__init__.py
...pt/ji_yun_ying_pc/lanjiali_report/data_config/__init__.py
+0
-0
report_config.py
..._yun_ying_pc/lanjiali_report/data_config/report_config.py
+30
-0
test_demo.py
script/ji_yun_ying_pc/lanjiali_report/test_demo.py
+62
-0
public_asserts.py
script/public_asserts.py
+1
-0
No files found.
.idea/jk_interface_test.iml
View file @
1667d579
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
/>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.7 (
GeekInterfaceTes
t)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.7 (
Jkw_projec
t)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</component>
<component
name=
"PyDocumentationSettings"
>
<component
name=
"PyDocumentationSettings"
>
...
...
.idea/misc.xml
View file @
1667d579
...
@@ -3,5 +3,5 @@
...
@@ -3,5 +3,5 @@
<component
name=
"ProjectPlainTextFileTypeManager"
>
<component
name=
"ProjectPlainTextFileTypeManager"
>
<file
url=
"file://$PROJECT_DIR$/script/base_api/api_operation_web/big_screen_temp.py"
/>
<file
url=
"file://$PROJECT_DIR$/script/base_api/api_operation_web/big_screen_temp.py"
/>
</component>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (
GeekInterfaceTes
t)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (
Jkw_projec
t)"
project-jdk-type=
"Python SDK"
/>
</project>
</project>
\ No newline at end of file
.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12,_11_11_[Default_Changelist]1/shelved.patch
deleted
100644 → 0
View file @
db573bf4
Index: run.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>import pytest\nimport os\n\n\nif __name__ == '__main__':\n run_config = [\n \"-s\", \"./script/ji_yun_ying_app\", \"--alluredir\", \"./report/xml\", \"--host=http://172.10.62.94:3000\",\n ]\n pytest.main(run_config)\n # os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)\n # os.system(\"/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean\")\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- run.py (revision afc678929e714343bc935d0e182aeb8e4de75fff)
+++ run.py (date 1618196902142)
@@ -8,4 +8,4 @@
]
pytest.main(run_config)
# os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)
- # os.system("/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean")
+ os.system("/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean")
\ No newline at end of file
.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12__11_11__Default_Changelist_1.xml
deleted
100644 → 0
View file @
db573bf4
<changelist
name=
"Uncommitted_changes_before_Checkout_at_2021_4_12,_11_11_[Default_Changelist]1"
date=
"1618197069375"
recycled=
"true"
deleted=
"true"
>
<option
name=
"PATH"
value=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12,_11_11_[Default_Changelist]1/shelved.patch"
/>
<option
name=
"DESCRIPTION"
value=
"Uncommitted changes before Checkout at 2021/4/12, 11:11 [Default Changelist]"
/>
</changelist>
\ No newline at end of file
.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch
deleted
100644 → 0
View file @
db573bf4
This source diff could not be displayed because it is too large. You can
view the blob
instead.
.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13__20_21__Default_Changelist_.xml
deleted
100644 → 0
View file @
db573bf4
<changelist
name=
"Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]"
date=
"1618316475949"
recycled=
"true"
deleted=
"true"
>
<option
name=
"PATH"
value=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch"
/>
<option
name=
"DESCRIPTION"
value=
"Uncommitted changes before Update at 2021/4/13, 20:21 [Default Changelist]"
/>
</changelist>
\ No newline at end of file
.idea/workspace.xml
View file @
1667d579
This diff is collapsed.
Click to expand it.
run.py
View file @
1667d579
...
@@ -3,12 +3,12 @@ import os
...
@@ -3,12 +3,12 @@ import os
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
run_config
=
[
run_config
=
[
"-s"
,
"./script/ji_yun_ying_pc/
statistical_report/test_receipt_detail
.py"
,
"-s"
,
"./script/ji_yun_ying_pc/
lanjiali_report/test_demo
.py"
,
"--alluredir"
,
"./report/xml"
,
"--alluredir"
,
"./report/xml"
,
"--host"
,
"http://192.168.32.3
6
"
,
"--host"
,
"http://192.168.32.3
1
"
,
"--account"
,
"b"
,
"--account"
,
"b"
,
"--db"
,
"3
6
"
"--db"
,
"3
1
"
]
]
x
=
pytest
.
main
(
run_config
)
x
=
pytest
.
main
(
run_config
)
# os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)
# os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)
os
.
system
(
"
/Users/huangqiang/WorkPlace/allure-2.13.8/bin/
allure generate ./report/xml -o ./report/html --clean"
)
os
.
system
(
"allure generate ./report/xml -o ./report/html --clean"
)
script/ji_yun_ying_pc/data_config/data_config.py
View file @
1667d579
...
@@ -9,6 +9,8 @@ def get_order_infos():
...
@@ -9,6 +9,8 @@ def get_order_infos():
return
omd
.
query_data
(
table_name
,
condition
=
condition
,
fields
=
fields
)
return
omd
.
query_data
(
table_name
,
condition
=
condition
,
fields
=
fields
)
login_data
=
[
login_data
=
[
{
"type"
:
"employee"
,
{
"type"
:
"employee"
,
"identityType"
:
1
,
"identityType"
:
1
,
...
...
script/ji_yun_ying_pc/lanjiali_report/__init__.py
0 → 100644
View file @
1667d579
script/ji_yun_ying_pc/lanjiali_report/data_config/__init__.py
0 → 100644
View file @
1667d579
script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py
0 → 100644
View file @
1667d579
#费用预警&收入报表参数配置文件
#学生关键字查询
keywords
=
[
{
"keyword"
:
'蓝'
,
"keyword_type"
:
"stundentName"
},
{
"keyword"
:
'578281'
,
"keyword_type"
:
"studenNo"
},
{
"keyword"
:
'41990064679'
,
"keyword_type"
:
"phone"
}
]
#校区id
school_areas
=
[
2389
,
2398
,
3363
,
3015
,
3154
,
3352
,
2369
,
3095
,
3348
,
3333
,
3351
,
3359
,
3345
,
3365
,
3362
,
3339
,
3353
,
3334
,
2400
,
3360
,
3361
,
3373
,
3371
,
3366
,
3349
,
3372
,
3340
,
2427
,
3367
,
3335
,
3148
,
3374
,
3377
,
3369
,
3376
,
3378
,
3368
,
3336
,
3370
,
3357
,
3350
,
3001
,
3072
,
3049
,
3342
,
3337
,
2411
,
3344
,
2412
,
3100
,
3146
,
3052
,
3047
,
3157
,
3107
,
3108
,
3076
,
3147
,
3167
,
2413
,
2383
,
3064
,
3152
,
3063
,
3101
,
3130
,
3170
,
3074
,
3165
,
3044
,
3059
,
3038
,
3166
,
3168
,
2385
,
3171
,
2373
,
3137
,
3151
,
2417
,
3041
,
3036
,
3060
,
3125
,
3046
,
3109
,
3110
,
3142
,
3149
,
3037
,
3039
,
3104
,
2422
,
3158
,
2407
,
2386
,
3099
,
2410
,
3067
,
3329
,
2371
,
3330
,
3133
,
3071
,
3070
,
3053
,
3065
,
3150
,
3061
,
3126
,
3062
,
2423
,
2364
,
3043
,
2415
,
3131
,
2388
,
3096
,
2376
,
3042
,
3127
,
2402
,
2359
,
2365
,
2408
,
2425
,
3002
,
2391
,
3135
,
3136
,
3153
,
3139
,
3144
,
2419
,
3075
,
2416
,
2421
,
2363
,
2368
,
2403
,
2414
,
2392
,
3138
,
2406
,
3156
,
3155
,
3097
,
3098
,
3141
,
3069
,
2405
,
2399
,
2397
,
2360
,
3145
,
2420
,
2404
,
2374
,
2401
,
3054
,
3124
]
script/ji_yun_ying_pc/lanjiali_report/test_demo.py
0 → 100644
View file @
1667d579
import
allure
import
jsonpath
from
common.connect_db
import
OperationDb
from
script
import
public_asserts
from
script.ji_yun_ying_pc.lanjiali_report.data_config.report_config
import
keywords
,
school_areas
from
script.base_api.service_report
import
report_finance_student_expense_warning_post
from
script.base_api.service_user.employees
import
*
from
script.default_header
import
jyy_header
import
time
import
pytest
#查询学生费用预警
@allure.feature
(
"预警报表-学员费用预警查询"
)
class
Test_select_student_expense
:
@allure.story
(
"学生费用预警查询"
)
@allure.step
(
"学生费用预警查询-关键字筛选"
)
@pytest.mark.parametrize
(
"keyword"
,
keywords
)
def
test_student_exponse
(
self
,
keyword
):
keyword_value
=
keyword
.
get
(
"keyword"
)
#关键字查询类型
keyword_type
=
keyword
.
get
(
"keyword_type"
)
print
(
keyword_value
)
print
(
keyword_type
)
data
=
{
"pageNum"
:
1
,
"pageSize"
:
10
,
"studentStatuses"
:
[
1110
],
"year"
:
2021
,
"keyword"
:
keyword_value
,
"startTime"
:
""
,
"endTime"
:
""
,
"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"
:
sql
=
"select student_id from service_profile.student where student_prim_phone_no = "
+
keyword_value
sql_student_Id
=
OperationDb
()
.
query_sql
(
sql
)
print
(
sql_student_Id
)
student_id
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..studentId"
)
result
=
public_asserts
.
assert_res_field_equal_value
(
student_id
,
sql_student_Id
)
pytest
.
assume
(
result
)
print
(
res
)
script/public_asserts.py
View file @
1667d579
...
@@ -8,6 +8,7 @@ def public_assert(res_json: dict):
...
@@ -8,6 +8,7 @@ def public_assert(res_json: dict):
pytest
.
assume
(
msg
==
"成功"
)
pytest
.
assume
(
msg
==
"成功"
)
#判断列表包含某个字符
def
assert_res_field_contain_value
(
data_list
:
list
,
value
:
str
):
def
assert_res_field_contain_value
(
data_list
:
list
,
value
:
str
):
if
data_list
:
if
data_list
:
err_values
=
[
x
for
x
in
data_list
if
value
not
in
x
]
err_values
=
[
x
for
x
in
data_list
if
value
not
in
x
]
...
...
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