Commit 1667d579 authored by lanjiali's avatar lanjiali

关键字查询

parent db573bf4
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (GeekInterfaceTest)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.7 (Jkw_project)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
......
......@@ -3,5 +3,5 @@
<component name="ProjectPlainTextFileTypeManager">
<file url="file://$PROJECT_DIR$/script/base_api/api_operation_web/big_screen_temp.py" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (GeekInterfaceTest)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (Jkw_project)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
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
<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
This source diff could not be displayed because it is too large. You can view the blob instead.
<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
This diff is collapsed.
......@@ -3,12 +3,12 @@ import os
if __name__ == '__main__':
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",
"--host", "http://192.168.32.36",
"--host", "http://192.168.32.31",
"--account", "b",
"--db", "36"
"--db", "31"
]
x = 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("allure generate ./report/xml -o ./report/html --clean")
......@@ -9,6 +9,8 @@ def get_order_infos():
return omd.query_data(table_name, condition=condition, fields=fields)
login_data = [
{"type": "employee",
"identityType": 1,
......
#费用预警&收入报表参数配置文件
#学生关键字查询
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]
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)
......@@ -8,6 +8,7 @@ def public_assert(res_json: dict):
pytest.assume(msg == "成功")
#判断列表包含某个字符
def assert_res_field_contain_value(data_list: list, value: str):
if data_list:
err_values = [x for x in data_list if value not in x]
......
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