Commit ad0adccc authored by 刘琴's avatar 刘琴

调试完失败接口(除了联系方式相同线索可以创建成功的bug)

parent 3027a676
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="81f1d077-2571-48ed-8060-59253e4c6a95" name="Default Changelist" comment="所有用例"> <list default="true" id="81f1d077-2571-48ed-8060-59253e4c6a95" name="Default Changelist" comment="all">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/app.js" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/attachments/d8c0b1852970f3bb.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/attachments/f56ead477b099e86.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/behaviors.csv" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/behaviors.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/categories.csv" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/categories.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/packages.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/suites.csv" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/suites.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/test-cases/8da18f53b22f29a8.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/data/timeline.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/export/influxDbData.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/export/mail.html" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/export/prometheusData.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/favicon.ico" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/history/categories-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/history/duration-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/history/history-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/history/history.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/history/retry-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/index.html" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/plugins/behaviors/index.js" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/plugins/packages/index.js" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/plugins/screen-diff/index.js" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/plugins/screen-diff/styles.css" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/styles.css" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/behaviors.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/categories-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/categories.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/duration-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/duration.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/environment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/executors.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/history-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/launch.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/retry-trend.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/severity.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/status-chart.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/suites.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/html/widgets/summary.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/3bbc99d1-d6f2-4c8e-9ab2-deebdb3362a9-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/6f91f050-8e67-45bf-8fb8-5a78ad088185-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/9dc3c0dd-e1c8-4136-a36d-f44d48adbdcd-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/a9a1e6e3-7184-4189-90a9-09cd5433d2da-container.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/b829c519-0e54-457e-8b3a-99a477749249-result.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/report/xml/e1165d3d-ae5a-4003-8256-7f8c0bf5918b-attachment.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/run.py" beforeDir="false" afterPath="$PROJECT_DIR$/run.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/base_api/service_crm/clue.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/base_api/service_crm/clue.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/db_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/db_config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/common_liuqin/helpler.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/common_liuqin/helpler.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/conftest.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/conftest.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/testcase_clue/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/test_case_clue/__init__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/testcase_clue/test_my_new_clue.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/test_case_clue/test_my_new_clue.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/public_asserts.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/public_asserts.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" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="liuqin_jyy" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1sVoxvyfMoLPmfflJsFMxPU9E1H" />
<component name="ProjectLevelVcsManager"> <component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" /> <ConfirmationsSetting value="2" id="Add" />
<ConfirmationsSetting value="2" id="新增" /> <ConfirmationsSetting value="2" id="新增" />
</component> </component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
</component>
<component name="RunManager" selected="Python.run">
<configuration name="conftest" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/conftest.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="helpler (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/common_liuqin" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/common_liuqin/helpler.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="myNewClue_handler" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/case_data_handler_liuqin" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/case_data_handler_liuqin/myNewClue_handler.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="run" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\liuqin\AppData\Local\Programs\Python\Python37\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/run.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="pytest in test_my_new_clue.py" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/test_case_clue" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/script/ji_yun_ying_pc/service_crm_liuqin/test_case_clue/test_my_new_clue.py&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
<list>
<item itemvalue="Python.myNewClue_handler" />
<item itemvalue="Python.run" />
<item itemvalue="Python.helpler (1)" />
<item itemvalue="Python.conftest" />
<item itemvalue="Python tests.pytest in test_my_new_clue.py" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.run" />
<item itemvalue="Python.myNewClue_handler" />
<item itemvalue="Python tests.pytest in test_my_new_clue.py" />
<item itemvalue="Python.conftest" />
<item itemvalue="Python.helpler (1)" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="81f1d077-2571-48ed-8060-59253e4c6a95" name="Default Changelist" comment="all" />
<created>1620967369435</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1620967369435</updated>
</task>
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" /> <option name="oldMeFiltersMigrated" value="true" />
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/script/base_api/service_user/token.py</url>
<line>1</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/common/connect_db.py</url>
<line>1</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project> </project>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{"msg": "成功", "code": 0, "data": {"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NDQ2MSIsInRlcm1pbmFsIjoicGMiLCJ1dWlkIjoiNThmZDlhYTNhODczNDEwYzhiNzg1MTY2NTE3NTM4ODEiLCJ0aW1lc3RhbXAiOjE2MjA3MjgxMjEwNjB9.pEMjgH3t1okdu976Zy5hIZcMg3slJlK1rXMl9QiB2h8"}}
\ No newline at end of file
{"msg": "成功", "code": 0, "data": {"list": [], "total": 0, "pageNum": 1, "pageSize": 10, "hasNextPage": false, "extend": null}}
\ No newline at end of file
"Epic","Feature","Story","FAILED","BROKEN","PASSED","SKIPPED","UNKNOWN"
"","","","0","0","1","0","0"
{
"uid" : "b1a8273437954620fa374b796ffaacdd",
"name" : "behaviors",
"children" : [ {
"name" : "test_query_transformed_clue_with_sourceId",
"uid" : "8da18f53b22f29a8",
"parentUid" : "b1a8273437954620fa374b796ffaacdd",
"status" : "passed",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ ]
} ]
}
\ No newline at end of file
{
"uid" : "4b4757e66a1912dae1a509f688f20b0f",
"name" : "categories",
"children" : [ ]
}
\ No newline at end of file
{
"uid" : "83edc06c07f9ae9e47eb6dd1b683e4e2",
"name" : "packages",
"children" : [ {
"name" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue.test_my_new_clue",
"children" : [ {
"name" : "test_query_transformed_clue_with_sourceId",
"uid" : "8da18f53b22f29a8",
"parentUid" : "d9d54a647abeeedbd1d42aa9d9ceaed9",
"status" : "passed",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ ]
} ],
"uid" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue.test_my_new_clue"
} ]
}
\ No newline at end of file
"Status","Start Time","Stop Time","Duration in ms","Parent Suite","Suite","Sub Suite","Test Class","Test Method","Name","Description"
"passed","Tue May 11 18:15:20 CST 2021","Tue May 11 18:15:21 CST 2021","319","script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue","test_my_new_clue","TestMyNewClue","","","test_query_transformed_clue_with_sourceId"," 我的线索-已转化列表,根据线索来源查询"
{
"uid" : "98d3104e051c652961429bf95fa0b5d6",
"name" : "suites",
"children" : [ {
"name" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue",
"children" : [ {
"name" : "test_my_new_clue",
"children" : [ {
"name" : "TestMyNewClue",
"children" : [ {
"name" : "test_query_transformed_clue_with_sourceId",
"uid" : "8da18f53b22f29a8",
"parentUid" : "97f0d23a1956e9cb746f58b6181f83fc",
"status" : "passed",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ ]
} ],
"uid" : "97f0d23a1956e9cb746f58b6181f83fc"
} ],
"uid" : "7b87c83f08f2dca532cbd87874c6aa14"
} ],
"uid" : "a7c50069b5b02033fb62a8464bd49de0"
} ]
}
\ No newline at end of file
{
"uid" : "8da18f53b22f29a8",
"name" : "test_query_transformed_clue_with_sourceId",
"fullName" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue.test_my_new_clue.TestMyNewClue#test_query_transformed_clue_with_sourceId",
"historyId" : "29b123130f257ec9ac66b13f7f16a00f",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"description" : " 我的线索-已转化列表,根据线索来源查询",
"descriptionHtml" : "<p>我的线索-已转化列表,根据线索来源查询</p>\n",
"status" : "passed",
"flaky" : false,
"newFailed" : false,
"beforeStages" : [ {
"name" : "get_host",
"time" : {
"start" : 1620728120671,
"stop" : 1620728120671,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"hasContent" : false,
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false
}, {
"name" : "pytestconfig",
"time" : {
"start" : 1620728120671,
"stop" : 1620728120671,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"hasContent" : false,
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false
}, {
"name" : "ji_yun_ying_login",
"time" : {
"start" : 1620728120671,
"stop" : 1620728120906,
"duration" : 235
},
"status" : "passed",
"steps" : [ {
"name" : "通用/基础/用户登录",
"time" : {
"start" : 1620728120671,
"stop" : 1620728120906,
"duration" : 235
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ {
"uid" : "d8c0b1852970f3bb",
"name" : "响应信息",
"source" : "d8c0b1852970f3bb.json",
"type" : "application/json",
"size" : 264
} ],
"parameters" : [ {
"name" : "params",
"value" : "None"
}, {
"name" : "body",
"value" : "{'type': 'employee', 'identityType': 1, 'ip': '0.0.0.0', 'account': '15360956010', 'password': '88888888', 'assistant': False}"
}, {
"name" : "header",
"value" : "{'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, */*'}"
}, {
"name" : "return_json",
"value" : "True"
}, {
"name" : "default_assert",
"value" : "False"
} ],
"hasContent" : true,
"stepsCount" : 0,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false
} ],
"attachments" : [ ],
"parameters" : [ ],
"hasContent" : true,
"stepsCount" : 1,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false
} ],
"testStage" : {
"description" : " 我的线索-已转化列表,根据线索来源查询",
"status" : "passed",
"steps" : [ {
"name" : "极运营/招生管理/线索/查询线索列表",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121217,
"duration" : 309
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ {
"uid" : "f56ead477b099e86",
"name" : "响应信息",
"source" : "f56ead477b099e86.json",
"type" : "application/json",
"size" : 130
} ],
"parameters" : [ {
"name" : "params",
"value" : "None"
}, {
"name" : "body",
"value" : "{'belong': 'PERSON', 'status': 'HASTRANSFORMED', 'pageNum': 1, 'pageSize': 10, 'sourceId': 104, 'orderType': 'desc', 'orderField': 'id', 'schoolAreas': [3015]}"
}, {
"name" : "header",
"value" : "{'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, */*', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NDQ2MSIsInRlcm1pbmFsIjoicGMiLCJ1dWlkIjoiNThmZDlhYTNhODczNDEwYzhiNzg1MTY2NTE3NTM4ODEiLCJ0aW1lc3RhbXAiOjE2MjA3MjgxMjEwNjB9.pEMjgH3t1okdu976Zy5hIZcMg3slJlK1rXMl9QiB2h8'}"
}, {
"name" : "return_json",
"value" : "True"
}, {
"name" : "default_assert",
"value" : "True"
} ],
"hasContent" : true,
"stepsCount" : 0,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false
} ],
"attachments" : [ ],
"parameters" : [ ],
"hasContent" : true,
"stepsCount" : 1,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false
},
"afterStages" : [ ],
"labels" : [ {
"name" : "parentSuite",
"value" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue"
}, {
"name" : "suite",
"value" : "test_my_new_clue"
}, {
"name" : "subSuite",
"value" : "TestMyNewClue"
}, {
"name" : "host",
"value" : "DESKTOP-R7Q00N2"
}, {
"name" : "thread",
"value" : "116324-MainThread"
}, {
"name" : "framework",
"value" : "pytest"
}, {
"name" : "language",
"value" : "cpython3"
}, {
"name" : "package",
"value" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue.test_my_new_clue"
}, {
"name" : "resultFormat",
"value" : "allure2"
} ],
"parameters" : [ ],
"links" : [ ],
"hidden" : false,
"retry" : false,
"extra" : {
"severity" : "normal",
"retries" : [ ],
"categories" : [ ],
"tags" : [ ]
},
"source" : "8da18f53b22f29a8.json",
"parameterValues" : [ ]
}
\ No newline at end of file
{
"uid" : "ab17fc5a4eb3bca4b216b548c7f9fcbc",
"name" : "timeline",
"children" : [ {
"name" : "DESKTOP-R7Q00N2",
"children" : [ {
"name" : "116324-MainThread",
"children" : [ {
"name" : "test_query_transformed_clue_with_sourceId",
"uid" : "8da18f53b22f29a8",
"parentUid" : "029e9f95ff79f4ebbb5fe5c0234241ca",
"status" : "passed",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ ]
} ],
"uid" : "029e9f95ff79f4ebbb5fe5c0234241ca"
} ],
"uid" : "d4ee51e34c862c92d44539866dcf14f6"
} ]
}
\ No newline at end of file
launch_status failed=0 1620728122000000000
launch_status broken=0 1620728122000000000
launch_status passed=1 1620728122000000000
launch_status skipped=0 1620728122000000000
launch_status unknown=0 1620728122000000000
launch_time duration=319 1620728122000000000
launch_time min_duration=319 1620728122000000000
launch_time max_duration=319 1620728122000000000
launch_time sum_duration=319 1620728122000000000
launch_retries retries=0 1620728122000000000
launch_retries run=1 1620728122000000000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Allure Report summary mail</title>
</head>
<body>
Mail body
</body>
</html>
launch_status_failed 0
launch_status_broken 0
launch_status_passed 1
launch_status_skipped 0
launch_status_unknown 0
launch_time_duration 319
launch_time_min_duration 319
launch_time_max_duration 319
launch_time_sum_duration 319
launch_retries_retries 0
launch_retries_run 1
module.exports = __webpack_public_path__ + "favicon.ico";
\ No newline at end of file
[ {
"data" : { }
} ]
\ No newline at end of file
[ {
"data" : {
"duration" : 319
}
} ]
\ No newline at end of file
[ {
"data" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
}
} ]
\ No newline at end of file
{
"29b123130f257ec9ac66b13f7f16a00f" : {
"statistic" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
},
"items" : [ {
"uid" : "8da18f53b22f29a8",
"status" : "passed",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
}
} ]
}
}
\ No newline at end of file
[ {
"data" : {
"run" : 1,
"retry" : 0
}
} ]
\ No newline at end of file
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<title>Allure Report</title>
<link rel="favicon" href="favicon.ico?v=2">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="plugins/screen-diff/styles.css">
</head>
<body>
<div id="alert"></div>
<div id="content">
<span class="spinner">
<span class="spinner__circle"></span>
</span>
</div>
<div id="popup"></div>
<script src="app.js"></script>
<script src="plugins/behaviors/index.js"></script>
<script src="plugins/packages/index.js"></script>
<script src="plugins/screen-diff/index.js"></script>
</body>
</html>
'use strict';
allure.api.addTranslation('en', {
tab: {
behaviors: {
name: 'Behaviors'
}
},
widget: {
behaviors: {
name: 'Features by stories',
showAll: 'show all'
}
}
});
allure.api.addTranslation('ru', {
tab: {
behaviors: {
name: 'Функциональность'
}
},
widget: {
behaviors: {
name: 'Функциональность',
showAll: 'показать все'
}
}
});
allure.api.addTranslation('zh', {
tab: {
behaviors: {
name: '功能'
}
},
widget: {
behaviors: {
name: '特性场景',
showAll: '显示所有'
}
}
});
allure.api.addTranslation('de', {
tab: {
behaviors: {
name: 'Verhalten'
}
},
widget: {
behaviors: {
name: 'Features nach Stories',
showAll: 'Zeige alle'
}
}
});
allure.api.addTranslation('nl', {
tab: {
behaviors: {
name: 'Functionaliteit'
}
},
widget: {
behaviors: {
name: 'Features en story’s',
showAll: 'Toon alle'
}
}
});
allure.api.addTranslation('he', {
tab: {
behaviors: {
name: 'התנהגויות'
}
},
widget: {
behaviors: {
name: 'תכונות לפי סיפורי משתמש',
showAll: 'הצג הכול'
}
}
});
allure.api.addTranslation('br', {
tab: {
behaviors: {
name: 'Comportamentos'
}
},
widget: {
behaviors: {
name: 'Funcionalidades por história',
showAll: 'Mostrar tudo'
}
}
});
allure.api.addTranslation('ja', {
tab: {
behaviors: {
name: '振る舞い'
}
},
widget: {
behaviors: {
name: 'ストーリー別の機能',
showAll: '全て表示'
}
}
});
allure.api.addTranslation('es', {
tab: {
behaviors: {
name: 'Funcionalidades'
}
},
widget: {
behaviors: {
name: 'Funcionalidades por Historias de Usuario',
showAll: 'mostrar todo'
}
}
});
allure.api.addTranslation('kr', {
tab: {
behaviors: {
name: '동작'
}
},
widget: {
behaviors: {
name: '스토리별 기능',
showAll: '전체 보기'
}
}
});
allure.api.addTranslation('fr', {
tab: {
behaviors: {
name: 'Comportements'
}
},
widget: {
behaviors: {
name: 'Thèmes par histoires',
showAll: 'Montrer tout'
}
}
});
allure.api.addTab('behaviors', {
title: 'tab.behaviors.name', icon: 'fa fa-list',
route: 'behaviors(/)(:testGroup)(/)(:testResult)(/)(:testResultTab)(/)',
onEnter: (function (testGroup, testResult, testResultTab) {
return new allure.components.TreeLayout({
testGroup: testGroup,
testResult: testResult,
testResultTab: testResultTab,
tabName: 'tab.behaviors.name',
baseUrl: 'behaviors',
url: 'data/behaviors.json',
csvUrl: 'data/behaviors.csv'
});
})
});
allure.api.addWidget('widgets', 'behaviors', allure.components.WidgetStatusView.extend({
rowTag: 'a',
title: 'widget.behaviors.name',
baseUrl: 'behaviors',
showLinks: true
}));
'use strict';
allure.api.addTranslation('en', {
tab: {
packages: {
name: 'Packages'
}
}
});
allure.api.addTranslation('ru', {
tab: {
packages: {
name: 'Пакеты'
}
}
});
allure.api.addTranslation('zh', {
tab: {
packages: {
name: '包'
}
}
});
allure.api.addTranslation('de', {
tab: {
packages: {
name: 'Pakete'
}
}
});
allure.api.addTranslation('nl', {
tab: {
packages: {
name: 'Packages'
}
}
});
allure.api.addTranslation('he', {
tab: {
packages: {
name: 'חבילות'
}
}
});
allure.api.addTranslation('br', {
tab: {
packages: {
name: 'Pacotes'
}
}
});
allure.api.addTranslation('ja', {
tab: {
packages: {
name: 'パッケージ'
}
}
});
allure.api.addTranslation('es', {
tab: {
packages: {
name: 'Paquetes'
}
}
});
allure.api.addTranslation('kr', {
tab: {
packages: {
name: '패키지'
}
}
});
allure.api.addTranslation('fr', {
tab: {
packages: {
name: 'Paquets'
}
}
});
allure.api.addTab('packages', {
title: 'tab.packages.name', icon: 'fa fa-align-left',
route: 'packages(/)(:testGroup)(/)(:testResult)(/)(:testResultTab)(/)',
onEnter: (function (testGroup, testResult, testResultTab) {
return new allure.components.TreeLayout({
testGroup: testGroup,
testResult: testResult,
testResultTab: testResultTab,
tabName: 'tab.packages.name',
baseUrl: 'packages',
url: 'data/packages.json'
});
})
});
(function () {
var settings = allure.getPluginSettings('screen-diff', { diffType: 'diff' });
function renderImage(src) {
return (
'<div class="screen-diff__container">' +
'<img class="screen-diff__image" src="' +
src +
'">' +
'</div>'
);
}
function findImage(data, name) {
if (data.testStage && data.testStage.attachments) {
var matchedImage = data.testStage.attachments.filter(function (attachment) {
return attachment.name === name;
})[0];
if (matchedImage) {
return 'data/attachments/' + matchedImage.source;
}
}
return null;
}
function renderDiffContent(type, diffImage, actualImage, expectedImage) {
if (type === 'diff') {
if (diffImage) {
return renderImage(diffImage);
}
}
if (type === 'overlay' && expectedImage) {
return (
'<div class="screen-diff__overlay screen-diff__container">' +
'<img class="screen-diff__image" src="' +
expectedImage +
'">' +
'<div class="screen-diff__image-over">' +
'<img class="screen-diff__image" src="' +
actualImage +
'">' +
'</div>' +
'</div>'
);
}
if (actualImage) {
return renderImage(actualImage);
}
return 'No diff data provided';
}
var TestResultView = Backbone.Marionette.View.extend({
regions: {
subView: '.screen-diff-view',
},
template: function () {
return '<div class="screen-diff-view"></div>';
},
onRender: function () {
var data = this.model.toJSON();
var testType = data.labels.filter(function (label) {
return label.name === 'testType';
})[0];
var diffImage = findImage(data, 'diff');
var actualImage = findImage(data, 'actual');
var expectedImage = findImage(data, 'expected');
if (!testType || testType.value !== 'screenshotDiff') {
return;
}
this.showChildView(
'subView',
new ScreenDiffView({
diffImage: diffImage,
actualImage: actualImage,
expectedImage: expectedImage,
}),
);
},
});
var ErrorView = Backbone.Marionette.View.extend({
templateContext: function () {
return this.options;
},
template: function (data) {
return '<pre class="screen-diff-error">' + data.error + '</pre>';
},
});
var AttachmentView = Backbone.Marionette.View.extend({
regions: {
subView: '.screen-diff-view',
},
template: function () {
return '<div class="screen-diff-view"></div>';
},
onRender: function () {
jQuery
.getJSON(this.options.sourceUrl)
.then(this.renderScreenDiffView.bind(this), this.renderErrorView.bind(this));
},
renderErrorView: function (error) {
console.log(error);
this.showChildView(
'subView',
new ErrorView({
error: error.statusText,
}),
);
},
renderScreenDiffView: function (data) {
this.showChildView(
'subView',
new ScreenDiffView({
diffImage: data.diff,
actualImage: data.actual,
expectedImage: data.expected,
}),
);
},
});
var ScreenDiffView = Backbone.Marionette.View.extend({
className: 'pane__section',
events: function () {
return {
['click [name="screen-diff-type-' + this.cid + '"]']: 'onDiffTypeChange',
'mousemove .screen-diff__overlay': 'onOverlayMove',
};
},
initialize: function (options) {
this.diffImage = options.diffImage;
this.actualImage = options.actualImage;
this.expectedImage = options.expectedImage;
this.radioName = 'screen-diff-type-' + this.cid;
},
templateContext: function () {
return {
diffType: settings.get('diffType'),
diffImage: this.diffImage,
actualImage: this.actualImage,
expectedImage: this.expectedImage,
radioName: this.radioName,
};
},
template: function (data) {
if (!data.diffImage && !data.actualImage && !data.expectedImage) {
return '';
}
return (
'<h3 class="pane__section-title">Screen Diff</h3>' +
'<div class="screen-diff__content">' +
'<div class="screen-diff__switchers">' +
'<label><input type="radio" name="' +
data.radioName +
'" value="diff"> Show diff</label>' +
'<label><input type="radio" name="' +
data.radioName +
'" value="overlay"> Show overlay</label>' +
'</div>' +
renderDiffContent(
data.diffType,
data.diffImage,
data.actualImage,
data.expectedImage,
) +
'</div>'
);
},
adjustImageSize: function (event) {
var overImage = this.$(event.target);
overImage.width(overImage.width());
},
onRender: function () {
const diffType = settings.get('diffType');
this.$('[name="' + this.radioName + '"][value="' + diffType + '"]').prop(
'checked',
true,
);
if (diffType === 'overlay') {
this.$('.screen-diff__image-over img').on('load', this.adjustImageSize.bind(this));
}
},
onOverlayMove: function (event) {
var pageX = event.pageX;
var containerScroll = this.$('.screen-diff__container').scrollLeft();
var elementX = event.currentTarget.getBoundingClientRect().left;
var delta = pageX - elementX + containerScroll;
this.$('.screen-diff__image-over').width(delta);
},
onDiffTypeChange: function (event) {
settings.save('diffType', event.target.value);
this.render();
},
});
allure.api.addTestResultBlock(TestResultView, { position: 'before' });
allure.api.addAttachmentViewer('application/vnd.allure.image.diff', {
View: AttachmentView,
icon: 'fa fa-exchange',
});
})();
.screen-diff__switchers {
margin-bottom: 1em;
}
.screen-diff__switchers label + label {
margin-left: 1em;
}
.screen-diff__overlay {
position: relative;
cursor: col-resize;
}
.screen-diff__container {
overflow-x: auto;
}
.screen-diff__image-over {
top: 0;
left: 0;
bottom: 0;
background: #fff;
position: absolute;
overflow: hidden;
box-shadow: 2px 0 1px -1px #aaa;
}
.screen-diff-error {
color: #fd5a3e;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"total" : 1,
"items" : [ ]
}
\ No newline at end of file
[ {
"data" : { }
} ]
\ No newline at end of file
{
"total" : 0,
"items" : [ ]
}
\ No newline at end of file
[ {
"data" : {
"duration" : 319
}
} ]
\ No newline at end of file
[ {
"uid" : "8da18f53b22f29a8",
"name" : "test_query_transformed_clue_with_sourceId",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"status" : "passed",
"severity" : "normal"
} ]
\ No newline at end of file
[ ]
\ No newline at end of file
[ ]
\ No newline at end of file
[ {
"data" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
}
} ]
\ No newline at end of file
[ ]
\ No newline at end of file
[ {
"data" : {
"run" : 1,
"retry" : 0
}
} ]
\ No newline at end of file
[ {
"uid" : "8da18f53b22f29a8",
"name" : "test_query_transformed_clue_with_sourceId",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"status" : "passed",
"severity" : "normal"
} ]
\ No newline at end of file
[ {
"uid" : "8da18f53b22f29a8",
"name" : "test_query_transformed_clue_with_sourceId",
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319
},
"status" : "passed",
"severity" : "normal"
} ]
\ No newline at end of file
{
"total" : 1,
"items" : [ {
"uid" : "a7c50069b5b02033fb62a8464bd49de0",
"name" : "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue",
"statistic" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
}
} ]
}
\ No newline at end of file
{
"reportName" : "Allure Report",
"testRuns" : [ ],
"statistic" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
},
"time" : {
"start" : 1620728120908,
"stop" : 1620728121227,
"duration" : 319,
"minDuration" : 319,
"maxDuration" : 319,
"sumDuration" : 319
}
}
\ No newline at end of file
{"uuid": "1b3cf5c5-33bb-4c8a-943a-6aa663ac263e", "children": ["4ca5ad2e-f03a-4dea-822f-d3c9a57790df", "4ca5ad2e-f03a-4dea-822f-d3c9a57790df"], "befores": [{"name": "get_host", "status": "passed", "start": 1620728120671, "stop": 1620728120671}], "start": 1620728120671, "stop": 1620728121229}
\ No newline at end of file
{"uuid": "aae98c58-4922-428f-8f85-301e7b042256", "children": ["4ca5ad2e-f03a-4dea-822f-d3c9a57790df"], "befores": [{"name": "pytestconfig", "status": "passed", "start": 1620728120671, "stop": 1620728120671}], "start": 1620728120671, "stop": 1620728121230}
\ No newline at end of file
{"msg": "成功", "code": 0, "data": {"list": [], "total": 0, "pageNum": 1, "pageSize": 10, "hasNextPage": false, "extend": null}}
\ No newline at end of file
{"uuid": "b2001d52-3f13-4d46-910d-83c642a8cfd0", "children": ["4ca5ad2e-f03a-4dea-822f-d3c9a57790df", "4ca5ad2e-f03a-4dea-822f-d3c9a57790df"], "befores": [{"name": "ji_yun_ying_login", "status": "passed", "steps": [{"name": "通用/基础/用户登录", "status": "passed", "attachments": [{"name": "响应信息", "source": "e1165d3d-ae5a-4003-8256-7f8c0bf5918b-attachment.json", "type": "application/json"}], "parameters": [{"name": "params", "value": "None"}, {"name": "body", "value": "{'type': 'employee', 'identityType': 1, 'ip': '0.0.0.0', 'account': '15360956010', 'password': '88888888', 'assistant': False}"}, {"name": "header", "value": "{'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, */*'}"}, {"name": "return_json", "value": "True"}, {"name": "default_assert", "value": "False"}], "start": 1620728120671, "stop": 1620728120906}], "start": 1620728120671, "stop": 1620728120906}], "start": 1620728120671, "stop": 1620728121228}
\ No newline at end of file
{"name": "test_query_transformed_clue_with_sourceId", "status": "passed", "description": " 我的线索-已转化列表,根据线索来源查询", "steps": [{"name": "极运营/招生管理/线索/查询线索列表", "status": "passed", "attachments": [{"name": "响应信息", "source": "9dc3c0dd-e1c8-4136-a36d-f44d48adbdcd-attachment.json", "type": "application/json"}], "parameters": [{"name": "params", "value": "None"}, {"name": "body", "value": "{'belong': 'PERSON', 'status': 'HASTRANSFORMED', 'pageNum': 1, 'pageSize': 10, 'sourceId': 104, 'orderType': 'desc', 'orderField': 'id', 'schoolAreas': [3015]}"}, {"name": "header", "value": "{'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, */*', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NDQ2MSIsInRlcm1pbmFsIjoicGMiLCJ1dWlkIjoiNThmZDlhYTNhODczNDEwYzhiNzg1MTY2NTE3NTM4ODEiLCJ0aW1lc3RhbXAiOjE2MjA3MjgxMjEwNjB9.pEMjgH3t1okdu976Zy5hIZcMg3slJlK1rXMl9QiB2h8'}"}, {"name": "return_json", "value": "True"}, {"name": "default_assert", "value": "True"}], "start": 1620728120908, "stop": 1620728121217}], "start": 1620728120908, "stop": 1620728121227, "uuid": "4ca5ad2e-f03a-4dea-822f-d3c9a57790df", "historyId": "29b123130f257ec9ac66b13f7f16a00f", "testCaseId": "26039b6863ac563d3fcdfa4d638853ec", "fullName": "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue.test_my_new_clue.TestMyNewClue#test_query_transformed_clue_with_sourceId", "labels": [{"name": "parentSuite", "value": "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue"}, {"name": "suite", "value": "test_my_new_clue"}, {"name": "subSuite", "value": "TestMyNewClue"}, {"name": "host", "value": "DESKTOP-R7Q00N2"}, {"name": "thread", "value": "116324-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "script.ji_yun_ying_pc.service_crm_liuqin.testcase_clue.test_my_new_clue"}]}
\ No newline at end of file
{"msg": "成功", "code": 0, "data": {"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NDQ2MSIsInRlcm1pbmFsIjoicGMiLCJ1dWlkIjoiNThmZDlhYTNhODczNDEwYzhiNzg1MTY2NTE3NTM4ODEiLCJ0aW1lc3RhbXAiOjE2MjA3MjgxMjEwNjB9.pEMjgH3t1okdu976Zy5hIZcMg3slJlK1rXMl9QiB2h8"}}
\ No newline at end of file
...@@ -3,7 +3,7 @@ import os ...@@ -3,7 +3,7 @@ import os
if __name__ == '__main__': if __name__ == '__main__':
run_config = [ run_config = [
"-s", r"script\ji_yun_ying_pc\service_crm_liuqin\testcase_clue\test_my_new_clue.py::TestMyNewClue::test_query_transformed_clue_with_sourceId", "-s", r"script\ji_yun_ying_pc\service_crm_liuqin\test_case_clue\test_my_new_clue.py::TestMyNewClue",
"--clean-alluredir", "--clean-alluredir",
"--alluredir", "./report/xml", "--alluredir", "./report/xml",
"--host", "http://192.168.32.31", "--host", "http://192.168.32.31",
......
...@@ -20,8 +20,6 @@ def clue_manualInputEdit_post(params=None, body=None, header=None, return_json=T ...@@ -20,8 +20,6 @@ def clue_manualInputEdit_post(params=None, body=None, header=None, return_json=T
name = "极运营/招生管理/线索/编辑线索" name = "极运营/招生管理/线索/编辑线索"
url = f"/service-crm/clue/manualInputEdit" url = f"/service-crm/clue/manualInputEdit"
res = RunMethod.run_request("POST", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs) res = RunMethod.run_request("POST", url, params=params, body=body, header=header, return_json=return_json, name=name, **kwargs)
if return_json and default_assert:
public_assert(res)
return res return res
......
...@@ -3,7 +3,7 @@ db_configs = { ...@@ -3,7 +3,7 @@ db_configs = {
'database': 'postgres', 'database': 'postgres',
"user": 'dev', "user": 'dev',
"password": 'mko0PL<.;?', "password": 'mko0PL<.;?',
"host": '192.168.32.36', "host": '192.168.32.31',
"port": 5432 "port": 5432
}, },
"yf1": { "yf1": {
......
...@@ -11,6 +11,13 @@ def get_mobile(): ...@@ -11,6 +11,13 @@ def get_mobile():
mobile += str(num) mobile += str(num)
return mobile return mobile
def get_tel():
"""获取座机号"""
tel = '028-'
for i in range(8):
num = random.randint(0,8)
tel += str(num)
return tel
def get_time(): def get_time():
# 获取当前时间 # 获取当前时间
......
import time
import pytest import pytest
from jsonpath import jsonpath from jsonpath import jsonpath
...@@ -12,7 +14,9 @@ def add_my_clue(): ...@@ -12,7 +14,9 @@ def add_my_clue():
json_data = Add_My_New_Clue().add_clue_data json_data = Add_My_New_Clue().add_clue_data
studentName = json_data['studentName'] studentName = json_data['studentName']
contactInfo=json_data['contactInfo'] contactInfo=json_data['contactInfo']
res = clue_manualInputAdd_post(body=json_data,header=jyy_header) time.sleep(3)
res = clue_manualInputAdd_post(body=json_data,header=jyy_header,default_assert=False)
yield {'studentName':studentName,'contactInfo':contactInfo} yield {'studentName':studentName,'contactInfo':contactInfo}
......
...@@ -10,7 +10,7 @@ from script.default_header import jyy_header ...@@ -10,7 +10,7 @@ from script.default_header import jyy_header
from script.ji_yun_ying_pc.service_crm_liuqin.case_data_handler_liuqin.myNewClue_handler import Add_My_New_Clue, \ from script.ji_yun_ying_pc.service_crm_liuqin.case_data_handler_liuqin.myNewClue_handler import Add_My_New_Clue, \
Add_My_New_All_Clue Add_My_New_All_Clue
from script.ji_yun_ying_pc.service_crm_liuqin.common_liuqin.helpler import get_time, get_mobile, get_today, \ from script.ji_yun_ying_pc.service_crm_liuqin.common_liuqin.helpler import get_time, get_mobile, get_today, \
day_transform_time day_transform_time, get_tel
class TestMyNewClue(): class TestMyNewClue():
...@@ -60,26 +60,39 @@ class TestMyNewClue(): ...@@ -60,26 +60,39 @@ class TestMyNewClue():
def test_add_new_clue_success_with_wechat(self): def test_add_new_clue_success_with_wechat(self):
# 必填项-微信联系方式,新增线索成功 # 必填项-微信联系方式,新增线索成功
json_data = Add_My_New_Clue(contactType="WECHAT").add_clue_data json_data = Add_My_New_Clue(contactType="WECHAT").add_clue_data
clue_name = json_data['studentName'] clue_name = json_data['studentName']
clue_contactInfo = json_data['contactInfo'] clue_contactInfo = json_data['contactInfo']
clue_contactType = json_data['contactType'] clue_contactType = json_data['contactType']
res = clue_manualInputAdd_post(body=json_data, header=jyy_header) print('原始微信号',clue_contactInfo)
while True:
db_data = OperationDb().query_sql('SELECT contact_info FROM service_crm.clue_basic_info;')
if clue_contactInfo in db_data:
json_data['contactInfo'] = get_mobile()
print('重新生成的微信号',json_data['contactInfo'])
else:
break
time.sleep(3)
res = clue_manualInputAdd_post(body=json_data, header=jyy_header,default_assert=False)
print('最后添加线索用的微信号', clue_contactInfo)
if res['code']==0:
query_phone = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": clue_contactInfo, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res_query_data = clue_queryAll_post(body=query_phone, header=jyy_header,default_assert=False)
res_contactInfo = jsonpath(res_query_data, '$..contactInfo')[0]
# TODO:查询列表,没有返回contactType字段,不能用这个字段断言!!!
# res_contactType=jsonpath(res_query_data,'$..contactType')[0]
with assume: assert res_query_data['code'] == 0
with assume: assert res_query_data['msg'] == '成功'
with assume: assert res_contactInfo == clue_contactInfo
else:
return '前置条件执行失败'
query_phone = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": clue_contactInfo, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res_query_data = clue_queryAll_post(body=query_phone, header=jyy_header)
res_contactInfo = jsonpath(res_query_data, '$..contactInfo')[0]
# TODO:查询列表,没有返回contactType字段,不能用这个字段断言!!!
# res_contactType=jsonpath(res_query_data,'$..contactType')[0]
with assume: assert res['code'] == 0
with assume: assert res['msg'] == '成功'
with assume: assert res_contactInfo == clue_contactInfo
def test_add_new_clue_success_with_tel(self): def test_add_new_clue_success_with_tel(self):
# 必填项-座机联系方式,新增线索成功 # 必填项-座机联系方式,新增线索成功
json_data = Add_My_New_Clue(contactType="TEL", contactInfo="028-85568842").add_clue_data json_data = Add_My_New_Clue(contactType="TEL", contactInfo=get_tel()).add_clue_data
clue_name = json_data['studentName'] clue_name = json_data['studentName']
clue_contactInfo = json_data['contactInfo'] clue_contactInfo = json_data['contactInfo']
res = clue_manualInputAdd_post(body=json_data, header=jyy_header) res = clue_manualInputAdd_post(body=json_data, header=jyy_header)
...@@ -87,11 +100,10 @@ class TestMyNewClue(): ...@@ -87,11 +100,10 @@ class TestMyNewClue():
query_phone = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, query_phone = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": clue_contactInfo, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "studentName": clue_contactInfo, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res_query_data = clue_queryAll_post(body=query_phone, header=jyy_header) res_query_data = clue_queryAll_post(body=query_phone, header=jyy_header)
print('查询后的值:', res_query_data) # print('查询后的值:', res_query_data)
res_contactInfo = jsonpath(res_query_data, '$..contactInfo')[0] res_contactInfo = jsonpath(res_query_data, '$..contactInfo')[0]
# TODO:查询列表,没有返回contactType字段,不能用这个字段断言!!! # TODO:查询列表,没有返回contactType字段,不能用这个字段断言!!!
# res_contactType=jsonpath(res_query_data,'$..contactType')[0] # res_contactType=jsonpath(res_query_data,'$..contactType')[0]
with assume: assert res['code'] == 0 with assume: assert res['code'] == 0
with assume: assert res['msg'] == '成功' with assume: assert res['msg'] == '成功'
with assume: assert res_contactInfo == clue_contactInfo with assume: assert res_contactInfo == clue_contactInfo
...@@ -104,14 +116,14 @@ class TestMyNewClue(): ...@@ -104,14 +116,14 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
edit_data.pop('statusTranslate') edit_data.pop('statusTranslate')
edit_data['id'] = first_clue_id edit_data['id'] = first_clue_id
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
res_contactInfo = jsonpath(res, '$..contactInfo')[0] res_contactInfo = jsonpath(res, '$..contactInfo')[0]
res_studentName = jsonpath(res, '$..studentName')[0] res_studentName = jsonpath(res, '$..studentName')[0]
...@@ -131,11 +143,11 @@ class TestMyNewClue(): ...@@ -131,11 +143,11 @@ class TestMyNewClue():
def test_add_clue_no_permission_failure(self): def test_add_clue_no_permission_failure(self):
# 在没有权限的校区,新增线索失败 # 在没有权限的校区,新增线索失败
token = jyy_header['Authorization'].replace('Bearer ', '') token = jyy_header['Authorization'].replace('Bearer ', '')
print('去掉Bearer 的token', token) # print('去掉Bearer 的token', token)
params_data = {'token': token} params_data = {'token': token}
res_info = employees_info_get(params=params_data, header=jyy_header) res_info = employees_info_get(params=params_data, header=jyy_header)
permission_school = res_info['data']['schoolAreaId'] permission_school = res_info['data']['schoolAreaId']
print('有权限的校区---》', permission_school) # print('有权限的校区---》', permission_school)
json_data = Add_My_New_Clue().add_clue_data json_data = Add_My_New_Clue().add_clue_data
json_data['createSchoolAreaId'] = [3345] # 测试小蓝鲸学校 json_data['createSchoolAreaId'] = [3345] # 测试小蓝鲸学校
...@@ -150,20 +162,24 @@ class TestMyNewClue(): ...@@ -150,20 +162,24 @@ class TestMyNewClue():
def test_add_new_clue_failure_with_repeat_name_and_phone(self): def test_add_new_clue_failure_with_repeat_name_and_phone(self):
# 姓名和第一联系方式同时重复创建失败 # 姓名和第一联系方式同时重复创建失败
first_json_data = Add_My_New_Clue().add_clue_data first_json_data = Add_My_New_Clue().add_clue_data
clue_name = first_json_data['studentName'] clue_name = first_json_data['studentName']
clue_contactType = first_json_data['contactType'] clue_contactType = first_json_data['contactType']
clue_contactInfo = first_json_data['contactInfo'] clue_contactInfo = first_json_data['contactInfo']
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header)
time.sleep(3) time.sleep(3)
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header,default_assert=False)
second_json_data = Add_My_New_Clue(studentName=clue_name, contactType=clue_contactType, time.sleep(3)
contactInfo=clue_contactInfo).add_clue_data if first_res['code'] == 0:
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False) second_json_data = Add_My_New_Clue(studentName=clue_name, contactType=clue_contactType,
print('重复创建线索后的返回值:', res) contactInfo=clue_contactInfo).add_clue_data
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False)
with assume: assert res['code'] == 100210006 # print('重复创建线索后的返回值:', res)
with assume: assert res['msg'] == '该学生已存在,无法新建学员,请确认具体情况。'
with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '线索已存在'
else:
return '前置条件执行失败,重复新增接口为执行'
def test_add_new_clue_failure_with_repeat_only_phone(self): def test_add_new_clue_failure_with_repeat_only_phone(self):
# 判重校验正确,不管联系方式类型(手机、座机、微信)只判断联系号码 # 判重校验正确,不管联系方式类型(手机、座机、微信)只判断联系号码
...@@ -171,23 +187,24 @@ class TestMyNewClue(): ...@@ -171,23 +187,24 @@ class TestMyNewClue():
clue_name = first_json_data['studentName'] clue_name = first_json_data['studentName']
clue_contactType = first_json_data['contactType'] clue_contactType = first_json_data['contactType']
clue_contactInfo = first_json_data['contactInfo'] clue_contactInfo = first_json_data['contactInfo']
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header)
time.sleep(3) time.sleep(3)
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header,default_assert=False)
second_json_data = Add_My_New_Clue(studentName=clue_name, contactType="WECHAT", if first_res['code'] == 0:
contactInfo=clue_contactInfo).add_clue_data second_json_data = Add_My_New_Clue(studentName=clue_name, contactType="WECHAT",
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False) contactInfo=clue_contactInfo).add_clue_data
print('重复创建线索后的返回值:', res) time.sleep(3)
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False)
with assume: assert res['code'] == 100210006 # print('重复创建线索后的返回值:', res)
with assume: assert res['msg'] == '该学生已存在,无法新建学员,请确认具体情况。' with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '线索已存在'
else:
return '前置条件执行失败,新接口未执行'
def test_add_new_clue_failure_with_same_phone(self): def test_add_new_clue_failure_with_same_phone(self):
# 线索本身第一联系方式与第二联方式一样 # 线索本身第一联系方式与第二联方式一样
pho = get_mobile() pho = get_mobile()
first_json_data = Add_My_New_All_Clue(contactInfo=pho, contactType="WECHAT", secondContactType="TEL", first_json_data = Add_My_New_All_Clue(contactInfo=pho, contactType="WECHAT", secondContactType="TEL",
secondContactInfo=pho).add_clue_data secondContactInfo=pho).add_clue_data
res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header, default_assert=False) res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header, default_assert=False)
with assume: assert res['code'] == 100210006 with assume: assert res['code'] == 100210006
...@@ -201,12 +218,12 @@ class TestMyNewClue(): ...@@ -201,12 +218,12 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 查询数据库,获取已存在的电话和姓名 # 查询数据库,获取已存在的电话和姓名
query_pg_clue = OperationDb().query_sql( query_pg_clue = OperationDb().query_sql(
'select student_name, contact_info from service_crm.clue_basic_info ORDER BY id desc LIMIT 2;')[1] 'select student_name, contact_info from service_crm.clue_basic_info ORDER BY id desc LIMIT 2;')[1]
print('这是查询库的线索', query_pg_clue) # print('这是查询库的线索', query_pg_clue)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
...@@ -216,10 +233,10 @@ class TestMyNewClue(): ...@@ -216,10 +233,10 @@ class TestMyNewClue():
edit_data['cityName'] = "四川省-成都市" edit_data['cityName'] = "四川省-成都市"
edit_data['id'] = first_clue_id edit_data['id'] = first_clue_id
edit_data['belong'] = "PERSON" edit_data['belong'] = "PERSON"
print('编辑传入的edit_data:', edit_data) # print('编辑传入的edit_data:', edit_data)
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
with assume: assert res['code'] == 100210006 with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '已存在姓名和联系方式相同的线索,不允许修改' with assume: assert res['msg'] == '已存在姓名和联系方式相同的线索,不允许修改'
...@@ -232,13 +249,13 @@ class TestMyNewClue(): ...@@ -232,13 +249,13 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 查询数据库,获取已存在的电话和姓名 # 查询数据库,获取已存在的电话和姓名
query_pg_clue = OperationDb().query_sql( query_pg_clue = OperationDb().query_sql(
"select student_name, second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE second_contact_info is not NULL and second_contact_info != '' LIMIT 1;")[ "select student_name, second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE second_contact_info is not NULL and second_contact_info != '' LIMIT 1;")[
0] 0]
print('这是查询库的线索', query_pg_clue) # print('这是查询库的线索', query_pg_clue)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
...@@ -249,10 +266,10 @@ class TestMyNewClue(): ...@@ -249,10 +266,10 @@ class TestMyNewClue():
edit_data['cityName'] = "四川省-成都市" edit_data['cityName'] = "四川省-成都市"
edit_data['id'] = first_clue_id edit_data['id'] = first_clue_id
edit_data['belong'] = "PERSON" edit_data['belong'] = "PERSON"
print('编辑传入的edit_data:', edit_data) # print('编辑传入的edit_data:', edit_data)
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
with assume: assert res['code'] == 100210006 with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '已存在姓名和联系方式相同的线索,不允许修改' with assume: assert res['msg'] == '已存在姓名和联系方式相同的线索,不允许修改'
...@@ -267,19 +284,22 @@ class TestMyNewClue(): ...@@ -267,19 +284,22 @@ class TestMyNewClue():
clue_contactInfo = first_json_data['contactInfo'] clue_contactInfo = first_json_data['contactInfo']
clue_secondContactType = first_json_data['secondContactType'] clue_secondContactType = first_json_data['secondContactType']
clue_secondContactInfo = first_json_data['secondContactInfo'] clue_secondContactInfo = first_json_data['secondContactInfo']
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header)
time.sleep(3) time.sleep(3)
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header,default_assert=False)
second_json_data = Add_My_New_All_Clue(studentName=clue_name, contactType=clue_contactType, if first_res['code'] == 0:
contactInfo=clue_contactInfo, second_json_data = Add_My_New_All_Clue(studentName=clue_name, contactType=clue_contactType,
secondContactType=clue_secondContactType, contactInfo=clue_contactInfo,
secondContactInfo=clue_secondContactInfo secondContactType=clue_secondContactType,
).add_clue_data secondContactInfo=clue_secondContactInfo
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False) ).add_clue_data
print('重复创建线索后的返回值:', res) time.sleep(3)
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False)
with assume: assert res['code'] == 100210006 # print('重复创建线索后的返回值:', res)
with assume: assert res['msg'] == '该学生已存在,无法新建学员,请确认具体情况。'
with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '线索已存在'
else:
return '前置条件执行失败,新增接口未执行'
@pytest.mark.usefixtures @pytest.mark.usefixtures
def test_edit_new_clue_failure_with_repeat_name_and_first_second_phone(self, query_all_following_clues): def test_edit_new_clue_failure_with_repeat_name_and_first_second_phone(self, query_all_following_clues):
...@@ -289,13 +309,13 @@ class TestMyNewClue(): ...@@ -289,13 +309,13 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 查询数据库,获取已存在的电话和姓名 # 查询数据库,获取已存在的电话和姓名
query_pg_clue = OperationDb().query_sql( query_pg_clue = OperationDb().query_sql(
"select student_name,contact_type,contact_info,second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE second_contact_info is not NULL and second_contact_info != '' LIMIT 1;")[ "select student_name,contact_type,contact_info,second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE second_contact_info is not NULL and second_contact_info != '' LIMIT 1;")[
0] 0]
print('这是查询库的线索', query_pg_clue) # print('这是查询库的线索', query_pg_clue)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
...@@ -308,10 +328,10 @@ class TestMyNewClue(): ...@@ -308,10 +328,10 @@ class TestMyNewClue():
edit_data['cityName'] = "四川省-成都市" edit_data['cityName'] = "四川省-成都市"
edit_data['id'] = first_clue_id edit_data['id'] = first_clue_id
edit_data['belong'] = "PERSON" edit_data['belong'] = "PERSON"
print('编辑传入的edit_data:', edit_data) # print('编辑传入的edit_data:', edit_data)
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
with assume: assert res['code'] == 100210006 with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '已存在姓名和联系方式相同的线索,不允许修改' with assume: assert res['msg'] == '已存在姓名和联系方式相同的线索,不允许修改'
...@@ -322,16 +342,21 @@ class TestMyNewClue(): ...@@ -322,16 +342,21 @@ class TestMyNewClue():
clue_name = first_json_data['studentName'] clue_name = first_json_data['studentName']
clue_contactType = first_json_data['contactType'] clue_contactType = first_json_data['contactType']
clue_contactInfo = first_json_data['contactInfo'] clue_contactInfo = first_json_data['contactInfo']
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header)
time.sleep(3) time.sleep(3)
first_res = clue_manualInputAdd_post(body=first_json_data, header=jyy_header,default_assert=False)
second_json_data = Add_My_New_Clue(studentName=clue_name, contactType=clue_contactType, if first_res['code'] == 0:
contactInfo=clue_contactInfo, createSchoolAreaId=2383).add_clue_data second_json_data = Add_My_New_Clue(studentName=clue_name, contactType=clue_contactType,
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False) contactInfo=clue_contactInfo, createSchoolAreaId=2383).add_clue_data
print('重复创建线索后的返回值:', res) time.sleep(3)
res = clue_manualInputAdd_post(body=second_json_data, header=jyy_header, default_assert=False)
# print('重复创建线索后的返回值:', res)
with assume: assert res['code'] == 100210006 with assume: assert res['code'] == 100210006
with assume: assert res['msg'] == '该学生已存在,无法新建学员,请确认具体情况。' with assume: assert res['msg'] == '线索已存在'
else:
return '前置条件失败,重复新增接口不执行!'
@pytest.mark.usefixtures @pytest.mark.usefixtures
def test_edit_my_new_clue(self, query_all_following_clues): def test_edit_my_new_clue(self, query_all_following_clues):
...@@ -341,8 +366,7 @@ class TestMyNewClue(): ...@@ -341,8 +366,7 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
edit_data.pop('statusTranslate') edit_data.pop('statusTranslate')
...@@ -351,10 +375,10 @@ class TestMyNewClue(): ...@@ -351,10 +375,10 @@ class TestMyNewClue():
edit_data['cityName'] = "四川省-成都市" edit_data['cityName'] = "四川省-成都市"
edit_data['id'] = first_clue_id edit_data['id'] = first_clue_id
edit_data['belong'] = "PERSON" edit_data['belong'] = "PERSON"
print('编辑传入的edit_data:', edit_data) # print('编辑传入的edit_data:', edit_data)
time.sleep(1)
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
res_contactInfo = jsonpath(res, '$..contactInfo')[0] res_contactInfo = jsonpath(res, '$..contactInfo')[0]
res_studentName = jsonpath(res, '$..studentName')[0] res_studentName = jsonpath(res, '$..studentName')[0]
with assume: assert res['code'] == 0 with assume: assert res['code'] == 0
...@@ -370,7 +394,7 @@ class TestMyNewClue(): ...@@ -370,7 +394,7 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
...@@ -380,12 +404,11 @@ class TestMyNewClue(): ...@@ -380,12 +404,11 @@ class TestMyNewClue():
edit_data['cityName'] = "四川省-成都市" edit_data['cityName'] = "四川省-成都市"
edit_data['id'] = first_clue_id edit_data['id'] = first_clue_id
edit_data['belong'] = "PERSON" edit_data['belong'] = "PERSON"
edit_data[ edit_data['testPaperUrls'] = "https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/63a0757824c856b31312f9d8a0c60c52.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/4556a3e12fdc1b4e5beb33e4743e7c48.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/14dc4d32bec5f1ab41c657dea8fd225d.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/727cd885cac14da50184628bbd86738b.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/5275ba540e26e3606cd53c4cd618cdb9.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/3f9d98159775a1bf9aca2c7a0bf25a27.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/e3243c2c422c5a8c88b17c015e9657ba.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/b716298e7276bbc3a9401379ab1251b2.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/499abd25a5ae9b28cab28f26c17d08e7.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/a473f799b65cd31bed4937a79615902e.jpeg"
'testPaperUrls'] = "https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/63a0757824c856b31312f9d8a0c60c52.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/4556a3e12fdc1b4e5beb33e4743e7c48.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/14dc4d32bec5f1ab41c657dea8fd225d.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/727cd885cac14da50184628bbd86738b.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/5275ba540e26e3606cd53c4cd618cdb9.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/3f9d98159775a1bf9aca2c7a0bf25a27.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/e3243c2c422c5a8c88b17c015e9657ba.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/b716298e7276bbc3a9401379ab1251b2.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/499abd25a5ae9b28cab28f26c17d08e7.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/a473f799b65cd31bed4937a79615902e.jpeg" # print('编辑传入的edit_data:', edit_data)
print('编辑传入的edit_data:', edit_data)
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
res_contactInfo = jsonpath(res, '$..contactInfo')[0] res_contactInfo = jsonpath(res, '$..contactInfo')[0]
res_studentName = jsonpath(res, '$..studentName')[0] res_studentName = jsonpath(res, '$..studentName')[0]
res_testPaperUrls = jsonpath(res, '$..testPaperUrls')[0] res_testPaperUrls = jsonpath(res, '$..testPaperUrls')[0]
...@@ -403,7 +426,7 @@ class TestMyNewClue(): ...@@ -403,7 +426,7 @@ class TestMyNewClue():
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res_clue = clue_query_id_get(params=params_data, header=jyy_header) res_clue = clue_query_id_get(params=params_data, header=jyy_header)
edit_data = res_clue['data'] edit_data = res_clue['data']
print(edit_data) # print(edit_data)
# 用第一条线索的返回值,作为编辑线索的data # 用第一条线索的返回值,作为编辑线索的data
edit_data.pop('status') edit_data.pop('status')
...@@ -415,11 +438,11 @@ class TestMyNewClue(): ...@@ -415,11 +438,11 @@ class TestMyNewClue():
edit_data['belong'] = "PERSON" edit_data['belong'] = "PERSON"
edit_data[ edit_data[
'testPaperUrls'] = "https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/63a0757824c856b31312f9d8a0c60c52.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/63a0757824c856b31312f9d8a0c60c52.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/4556a3e12fdc1b4e5beb33e4743e7c48.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/14dc4d32bec5f1ab41c657dea8fd225d.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/727cd885cac14da50184628bbd86738b.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/5275ba540e26e3606cd53c4cd618cdb9.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/3f9d98159775a1bf9aca2c7a0bf25a27.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/e3243c2c422c5a8c88b17c015e9657ba.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/b716298e7276bbc3a9401379ab1251b2.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/499abd25a5ae9b28cab28f26c17d08e7.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/a473f799b65cd31bed4937a79615902e.jpeg" 'testPaperUrls'] = "https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/63a0757824c856b31312f9d8a0c60c52.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/63a0757824c856b31312f9d8a0c60c52.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/4556a3e12fdc1b4e5beb33e4743e7c48.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/14dc4d32bec5f1ab41c657dea8fd225d.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/727cd885cac14da50184628bbd86738b.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/5275ba540e26e3606cd53c4cd618cdb9.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/3f9d98159775a1bf9aca2c7a0bf25a27.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/e3243c2c422c5a8c88b17c015e9657ba.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/b716298e7276bbc3a9401379ab1251b2.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/499abd25a5ae9b28cab28f26c17d08e7.jpeg,https://profile-1257124244.cos.ap-chengdu.myqcloud.com/img/a473f799b65cd31bed4937a79615902e.jpeg"
print('编辑传入的edit_data:', edit_data) # print('编辑传入的edit_data:', edit_data)
res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False) res = clue_manualInputEdit_post(body=edit_data, header=jyy_header, default_assert=False)
print('编辑线索后的返回值', res) # print('编辑线索后的返回值', res)
with assume: assert res['code'] == 100210006 with assume: assert res['code'] == 100110003
def test_edit_my_new_clue_with_wrong_file(self): def test_edit_my_new_clue_with_wrong_file(self):
"""新增线索,上传非图片文件格式""" """新增线索,上传非图片文件格式"""
...@@ -427,7 +450,7 @@ class TestMyNewClue(): ...@@ -427,7 +450,7 @@ class TestMyNewClue():
json_data = Add_My_New_Clue().add_clue_data json_data = Add_My_New_Clue().add_clue_data
with open(r'E:\interface\jk_interface_test\requirements.txt', mode='r', encoding='utf8') as f: with open(r'E:\interface\jk_interface_test\requirements.txt', mode='r', encoding='utf8') as f:
json_data['testPaperUrls'] = f.read() json_data['testPaperUrls'] = f.read()
print('传入的data值----》》》', json_data) # print('传入的data值----》》》', json_data)
res = clue_manualInputAdd_post(body=json_data, header=jyy_header, default_assert=False) res = clue_manualInputAdd_post(body=json_data, header=jyy_header, default_assert=False)
# TODO:上传非图片格式的文件,实际新建成功了,后端未限制格式!!! # TODO:上传非图片格式的文件,实际新建成功了,后端未限制格式!!!
with assume: assert res['code'] == 100210003 # 实际运行,code==0,这条用例失败 with assume: assert res['code'] == 100210003 # 实际运行,code==0,这条用例失败
...@@ -436,11 +459,10 @@ class TestMyNewClue(): ...@@ -436,11 +459,10 @@ class TestMyNewClue():
""" """
查询所有【我的新线索-跟进中】线索 查询所有【我的新线索-跟进中】线索
""" """
# query_data={"belong":"PERSON","status":"FOLLOWING","pageNum":1,"pageSize":10,"orderType":"desc","orderField":"id","schoolAreas":[3015]} query_data={"belong":"PERSON","status":"FOLLOWING","pageNum":1,"pageSize":10,"orderType":"desc","orderField":"id","schoolAreas":[3015]}
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, # query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"inChargeEmployeeId": 8223, "orderType": "desc", "orderField": "id", "distribution": 0} # "inChargeEmployeeId": 8223, "orderType": "desc", "orderField": "id", "distribution": 0}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
with assume: assert res['code'] == 0 with assume: assert res['code'] == 0
with assume: assert res['msg'] == "成功" with assume: assert res['msg'] == "成功"
...@@ -452,7 +474,7 @@ class TestMyNewClue(): ...@@ -452,7 +474,7 @@ class TestMyNewClue():
first_clue_id = query_all_following_clues['id'] first_clue_id = query_all_following_clues['id']
params_data = {'clueId': first_clue_id} params_data = {'clueId': first_clue_id}
res = clue_query_id_get(params=params_data, header=jyy_header) res = clue_query_id_get(params=params_data, header=jyy_header)
res_clueId = jsonpath(res, '$..clueId') res_clueId = jsonpath(res, '$..clueId')[0]
with assume: assert res['code'] == 0 with assume: assert res['code'] == 0
with assume: assert res['msg'] == "成功" with assume: assert res['msg'] == "成功"
...@@ -476,22 +498,30 @@ class TestMyNewClue(): ...@@ -476,22 +498,30 @@ class TestMyNewClue():
inChargeEmployeeId=8223,createSchoolAreaId=3015 inChargeEmployeeId=8223,createSchoolAreaId=3015
""" """
json_data = Add_My_New_Clue().add_clue_data json_data = Add_My_New_Clue().add_clue_data
clue_contactInfo = json_data['contactInfo']
clue_inChargeEmployeeId = json_data['inChargeEmployeeId'] clue_inChargeEmployeeId = json_data['inChargeEmployeeId']
clue_createSchoolAreaId = json_data['createSchoolAreaId'] clue_createSchoolAreaId = json_data['createSchoolAreaId']
add_res = clue_manualInputAdd_post(body=json_data, header=jyy_header) while True:
db_data = OperationDb().query_sql('SELECT contact_info FROM service_crm.clue_basic_info;')
if clue_contactInfo in db_data:
clue_contactInfo = get_mobile()
else:
break
time.sleep(3)
add_res = clue_manualInputAdd_post(body=json_data, header=jyy_header,default_assert=False)
query_data = OperationDb().query_sql( query_data = OperationDb().query_sql(
"select student_name,contact_type,contact_info,second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE clue_id = (SELECT id FROM service_crm.clue WHERE create_school_area_id ={} and in_charge_employee_id = {} and status = 'FOLLOWING' LIMIT 1);".format( "select student_name,contact_type,contact_info,second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE clue_id = (SELECT id FROM service_crm.clue WHERE create_school_area_id ={} and in_charge_employee_id = {} and status = 'FOLLOWING' LIMIT 1);".format(
clue_createSchoolAreaId, clue_inChargeEmployeeId))[0] clue_createSchoolAreaId, clue_inChargeEmployeeId))[0]
print('查询数据库的线索---》》》', query_data) # print('查询数据库的线索---》》》', query_data)
studentName = query_data[0] studentName = query_data[0]
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": studentName, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "studentName": studentName, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header,default_assert=False)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_studentName = jsonpath(res, '$..studentName') res_studentName = jsonpath(res, '$..studentName')
print('这是返回后的姓名列表--->>>>>', res_studentName) # print('这是返回后的姓名列表--->>>>>', res_studentName)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -512,20 +542,27 @@ class TestMyNewClue(): ...@@ -512,20 +542,27 @@ class TestMyNewClue():
clue_contactInfo = json_data['contactInfo'] clue_contactInfo = json_data['contactInfo']
clue_inChargeEmployeeId = json_data['inChargeEmployeeId'] clue_inChargeEmployeeId = json_data['inChargeEmployeeId']
clue_createSchoolAreaId = json_data['createSchoolAreaId'] clue_createSchoolAreaId = json_data['createSchoolAreaId']
add_res = clue_manualInputAdd_post(body=json_data, header=jyy_header) while True:
db_data = OperationDb().query_sql('SELECT contact_info FROM service_crm.clue_basic_info;')
if clue_contactInfo in db_data:
clue_contactInfo = get_mobile()
else:
break
time.sleep(3)
add_res = clue_manualInputAdd_post(body=json_data, header=jyy_header,default_assert=False)
query_data = OperationDb().query_sql( query_data = OperationDb().query_sql(
"select student_name,contact_type,contact_info,second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE clue_id = (SELECT id FROM service_crm.clue WHERE create_school_area_id ={} and in_charge_employee_id = {} and status = 'FOLLOWING' LIMIT 1);".format( "select student_name,contact_type,contact_info,second_contact_type,second_contact_info from service_crm.clue_basic_info WHERE clue_id = (SELECT id FROM service_crm.clue WHERE create_school_area_id ={} and in_charge_employee_id = {} and status = 'FOLLOWING' LIMIT 1);".format(
clue_createSchoolAreaId, clue_inChargeEmployeeId))[0] clue_createSchoolAreaId, clue_inChargeEmployeeId))[0]
print('查询数据库的线索---》》》', query_data) # print('查询数据库的线索---》》》', query_data)
studentName = query_data[0] studentName = query_data[0]
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": clue_contactInfo, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "studentName": clue_contactInfo, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header,default_assert=False)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_contactInfo = jsonpath(res, '$..contactInfo') res_contactInfo = jsonpath(res, '$..contactInfo')
print('这是返回后的姓名列表--->>>>>', res_contactInfo) # print('这是返回后的姓名列表--->>>>>', res_contactInfo)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -547,9 +584,9 @@ class TestMyNewClue(): ...@@ -547,9 +584,9 @@ class TestMyNewClue():
"intentionLevel": intentionLevel, "orderType": "desc", "orderField": "id", "intentionLevel": intentionLevel, "orderType": "desc", "orderField": "id",
"schoolAreas": [3015]} "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_intentionLevel = jsonpath(res, '$..intentionLevel') res_intentionLevel = jsonpath(res, '$..intentionLevel')
print('这是返回后的姓名列表--->>>>>', res_intentionLevel) # print('这是返回后的姓名列表--->>>>>', res_intentionLevel)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -570,9 +607,9 @@ class TestMyNewClue(): ...@@ -570,9 +607,9 @@ class TestMyNewClue():
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, "sourceId": sourceId, query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, "sourceId": sourceId,
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_sourceId = jsonpath(res, '$..sourceId') res_sourceId = jsonpath(res, '$..sourceId')
print('这是返回后的姓名列表--->>>>>', res_sourceId) # print('这是返回后的姓名列表--->>>>>', res_sourceId)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -593,9 +630,9 @@ class TestMyNewClue(): ...@@ -593,9 +630,9 @@ class TestMyNewClue():
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"publicGrade": publicGrade, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "publicGrade": publicGrade, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_publicGrade = jsonpath(res, '$..sourceId') res_publicGrade = jsonpath(res, '$..publicGrade')
print('这是返回后的姓名列表--->>>>>', res_publicGrade) # print('这是返回后的姓名列表--->>>>>', res_publicGrade)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -617,9 +654,9 @@ class TestMyNewClue(): ...@@ -617,9 +654,9 @@ class TestMyNewClue():
"followingStatus": followingStatus, "orderType": "desc", "orderField": "id", "followingStatus": followingStatus, "orderType": "desc", "orderField": "id",
"schoolAreas": [3015]} "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_followingStatus = jsonpath(res, '$..sourceId') res_followingStatus = jsonpath(res, '$..status')
print('这是返回后的姓名列表--->>>>>', res_followingStatus) # print('这是返回后的姓名列表--->>>>>', res_followingStatus)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -641,9 +678,9 @@ class TestMyNewClue(): ...@@ -641,9 +678,9 @@ class TestMyNewClue():
"fieldBeginDateStr": create_time, "fieldEndDateStr": create_time, "orderType": "desc", "fieldBeginDateStr": create_time, "fieldEndDateStr": create_time, "orderType": "desc",
"orderField": "id", "schoolAreas": [3015]} "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_createTimeStr = jsonpath(res, '$..createTimeStr') res_createTimeStr = jsonpath(res, '$..createTimeStr')
print('这是返回后的录入时间列表--->>>>>', res_createTimeStr) # print('这是返回后的录入时间列表--->>>>>', res_createTimeStr)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -666,9 +703,9 @@ class TestMyNewClue(): ...@@ -666,9 +703,9 @@ class TestMyNewClue():
"field": "next_follow_time", "fieldBeginDateStr": create_time, "fieldEndDateStr": create_time, "field": "next_follow_time", "fieldBeginDateStr": create_time, "fieldEndDateStr": create_time,
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_nextFollowTimeStr = jsonpath(res, '$..nextFollowTimeStr') res_nextFollowTimeStr = jsonpath(res, '$..nextFollowTimeStr')
print('这是返回后的计划跟进时间列表--->>>>>', res_nextFollowTimeStr) # print('这是返回后的计划跟进时间列表--->>>>>', res_nextFollowTimeStr)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -690,9 +727,9 @@ class TestMyNewClue(): ...@@ -690,9 +727,9 @@ class TestMyNewClue():
"field": "last_follow_time", "fieldBeginDateStr": create_time, "fieldEndDateStr": create_time, "field": "last_follow_time", "fieldBeginDateStr": create_time, "fieldEndDateStr": create_time,
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
res_lastFollowTimeStr = jsonpath(res, '$..lastFollowTimeStr') res_lastFollowTimeStr = jsonpath(res, '$..lastFollowTimeStr')
print('这是返回后的末次跟进列表--->>>>>', res_lastFollowTimeStr) # print('这是返回后的末次跟进列表--->>>>>', res_lastFollowTimeStr)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -715,7 +752,7 @@ class TestMyNewClue(): ...@@ -715,7 +752,7 @@ class TestMyNewClue():
"followingStatus": "UNFOLLOWED", "field": "last_follow_time", "fieldBeginDateStr": "2021-05-10", "followingStatus": "UNFOLLOWED", "field": "last_follow_time", "fieldBeginDateStr": "2021-05-10",
"fieldEndDateStr": "2021-05-10", "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "fieldEndDateStr": "2021-05-10", "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -738,12 +775,12 @@ class TestMyNewClue(): ...@@ -738,12 +775,12 @@ class TestMyNewClue():
根据学生姓名+ 意向级别查询 根据学生姓名+ 意向级别查询
""" """
intentionLevel_list = ["S", "A", "B", "C"] intentionLevel_list = ["S", "A", "B", "C"]
intentionLevel = random.sample(intentionLevel_list, 1) intentionLevel = random.sample(intentionLevel_list, 1)[0]
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": "lq1620645970", "intentionLevel": intentionLevel, "orderType": "desc", "studentName": "lq1620645970", "intentionLevel": intentionLevel, "orderType": "desc",
"orderField": "id", "schoolAreas": [3015]} "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -758,17 +795,17 @@ class TestMyNewClue(): ...@@ -758,17 +795,17 @@ class TestMyNewClue():
def test_query_following_clue_with_name_and_intentionLevel_and_sourceId(self): def test_query_following_clue_with_name_and_intentionLevel_and_sourceId(self):
""" """
根据学生姓名 + 意向级别+线索来源 根据学生姓名 + 意向级别+ 线索来源
""" """
intentionLevel_list = ["S", "A", "B", "C"] intentionLevel_list = ["S", "A", "B", "C"]
sourceId_list = [100, 101, 102, 103, 104] sourceId_list = [100, 101, 102, 103, 104]
intentionLevel = random.sample(intentionLevel_list, 1) intentionLevel = random.sample(intentionLevel_list, 1)[0]
sourceId = random.sample(sourceId_list, 1) sourceId = random.sample(sourceId_list, 1)[0]
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10, query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"studentName": "lq1620645970", "intentionLevel": intentionLevel, "sourceId": sourceId, "studentName": "lq1620645970", "intentionLevel": intentionLevel, "sourceId": sourceId,
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -793,7 +830,7 @@ class TestMyNewClue(): ...@@ -793,7 +830,7 @@ class TestMyNewClue():
"publicGrade": publicGrade, "field": "create_time", "fieldBeginDateStr": create_time, "publicGrade": publicGrade, "field": "create_time", "fieldBeginDateStr": create_time,
"fieldEndDateStr": create_time, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "fieldEndDateStr": create_time, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -818,7 +855,7 @@ class TestMyNewClue(): ...@@ -818,7 +855,7 @@ class TestMyNewClue():
"followingStatus": followingStatus, "field": "next_follow_time", "fieldBeginDateStr": create_time, "followingStatus": followingStatus, "field": "next_follow_time", "fieldBeginDateStr": create_time,
"fieldEndDateStr": create_time, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "fieldEndDateStr": create_time, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
...@@ -843,7 +880,7 @@ class TestMyNewClue(): ...@@ -843,7 +880,7 @@ class TestMyNewClue():
"followingStatus": followingStatus, "field": "create_time", "fieldBeginDateStr": create_time, "followingStatus": followingStatus, "field": "create_time", "fieldBeginDateStr": create_time,
"fieldEndDateStr": create_time, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "fieldEndDateStr": create_time, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -864,7 +901,7 @@ class TestMyNewClue(): ...@@ -864,7 +901,7 @@ class TestMyNewClue():
"orderField": "id", "schoolAreas": [3015]} "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_status = jsonpath(res, '$..status') res_status = jsonpath(res, '$..status')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -882,7 +919,7 @@ class TestMyNewClue(): ...@@ -882,7 +919,7 @@ class TestMyNewClue():
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_studentName = jsonpath(res, '$..studentName') res_studentName = jsonpath(res, '$..studentName')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -900,7 +937,7 @@ class TestMyNewClue(): ...@@ -900,7 +937,7 @@ class TestMyNewClue():
"studentName": "19457952447", "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "studentName": "19457952447", "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_contactInfo = jsonpath(res, '$..contactInfo') res_contactInfo = jsonpath(res, '$..contactInfo')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -919,7 +956,7 @@ class TestMyNewClue(): ...@@ -919,7 +956,7 @@ class TestMyNewClue():
"sourceId": sourceId, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "sourceId": sourceId, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_sourceId = jsonpath(res, '$..sourceId') res_sourceId = jsonpath(res, '$..sourceId')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -939,7 +976,7 @@ class TestMyNewClue(): ...@@ -939,7 +976,7 @@ class TestMyNewClue():
"schoolAreas": [3015]} "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_lastFollowTimeStr = jsonpath(res, '$..lastFollowTimeStr') res_lastFollowTimeStr = jsonpath(res, '$..lastFollowTimeStr')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -960,7 +997,7 @@ class TestMyNewClue(): ...@@ -960,7 +997,7 @@ class TestMyNewClue():
"schoolAreas": [3015]} "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_statusChangeTimeStr = jsonpath(res, '$..statusChangeTimeStr') res_statusChangeTimeStr = jsonpath(res, '$..statusChangeTimeStr')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -980,7 +1017,7 @@ class TestMyNewClue(): ...@@ -980,7 +1017,7 @@ class TestMyNewClue():
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_createTimeStr = jsonpath(res, '$..createTimeStr') res_createTimeStr = jsonpath(res, '$..createTimeStr')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -1000,7 +1037,7 @@ class TestMyNewClue(): ...@@ -1000,7 +1037,7 @@ class TestMyNewClue():
"publicGrade": publicGrade, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "publicGrade": publicGrade, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
res_publicGrade = jsonpath(res, '$..publicGrade') res_publicGrade = jsonpath(res, '$..publicGrade')
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -1013,19 +1050,16 @@ class TestMyNewClue(): ...@@ -1013,19 +1050,16 @@ class TestMyNewClue():
def test_query_transformed_clue_with_all_condition(self): def test_query_transformed_clue_with_all_condition(self):
""" """
根据学生姓名&amp;电话号码 + 线索来源 + 末次跟进时间/转化时间/录入时间+ 年级 根据学生姓名 + 线索来源 + 末次跟进时间/转化时间/录入时间+ 年级
""" """
status_change_time = get_today() status_change_time = get_today()
sourceId_list = [100, 101, 102, 103, 104] sourceId_list = [100, 101, 102, 103, 104]
sourceId = random.sample(sourceId_list, 1)[0] sourceId = random.sample(sourceId_list, 1)[0]
publicGrade_list = ['零年级', '一年级', '二年级', '三年级', '四年级', '五年级', '六年级', '七年级', '八年级', '九年级', '高一', '高二', '高三'] publicGrade_list = ['零年级','一年级','二年级','三年级','四年级','五年级','六年级','七年级','八年级','九年级','高一','高二','高三']
publicGrade = random.sample(publicGrade_list, 1)[0] publicGrade = random.sample(publicGrade_list, 1)[0]
query_data = {"belong": "PERSON", "status": "UNTRANSFORMED", "pageNum": 1, "pageSize": 10, "studentName": "lq", query_data = {"belong":"PERSON","status":"HASTRANSFORMED","pageNum":1,"pageSize":10,"studentName":"lq","sourceId":sourceId,"publicGrade":publicGrade,"field":"status_change_time","fieldBeginDateStr":status_change_time,"fieldEndDateStr":status_change_time,"orderType":"desc","orderField":"id","schoolAreas":[3015]}
"sourceId": sourceId, "publicGrade": publicGrade, "field": "status_change_time",
"fieldBeginDateStr": status_change_time, "fieldEndDateStr": status_change_time,
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -1049,7 +1083,7 @@ class TestMyNewClue(): ...@@ -1049,7 +1083,7 @@ class TestMyNewClue():
query_data = {"belong": "PERSON", "status": "HASTRANSFORMED", "pageNum": 1, "pageSize": 10, "studentName": "lq", query_data = {"belong": "PERSON", "status": "HASTRANSFORMED", "pageNum": 1, "pageSize": 10, "studentName": "lq",
"sourceId": sourceId, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "sourceId": sourceId, "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -1073,7 +1107,7 @@ class TestMyNewClue(): ...@@ -1073,7 +1107,7 @@ class TestMyNewClue():
"fieldEndDateStr": last_follow_time, "orderType": "desc", "orderField": "id", "fieldEndDateStr": last_follow_time, "orderType": "desc", "orderField": "id",
"schoolAreas": [3015]} "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -1101,7 +1135,7 @@ class TestMyNewClue(): ...@@ -1101,7 +1135,7 @@ class TestMyNewClue():
"fieldBeginDateStr": last_follow_time, "fieldEndDateStr": last_follow_time, "orderType": "desc", "fieldBeginDateStr": last_follow_time, "fieldEndDateStr": last_follow_time, "orderType": "desc",
"orderField": "id", "schoolAreas": [3015]} "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: with assume:
assert res['code'] == 0 assert res['code'] == 0
with assume: with assume:
...@@ -1122,6 +1156,6 @@ class TestMyNewClue(): ...@@ -1122,6 +1156,6 @@ class TestMyNewClue():
query_data = {"belong": "PERSON", "status": "HASTRANSFORMED", "pageNum": 1, "pageSize": 10, query_data = {"belong": "PERSON", "status": "HASTRANSFORMED", "pageNum": 1, "pageSize": 10,
"studentName": "ssssssssssss", "orderType": "desc", "orderField": "id", "schoolAreas": [3015]} "studentName": "ssssssssssss", "orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res = clue_queryAll_post(body=query_data, header=jyy_header) res = clue_queryAll_post(body=query_data, header=jyy_header)
print('这是返回后的所有线索--->>>>>', res) # print('这是返回后的所有线索--->>>>>', res)
with assume: assert res['code'] == 0 with assume: assert res['code'] == 0
with assume: assert res['msg'] == "成功" with assume: assert res['msg'] == "成功"
import pytest import pytest
import allure
from pytest_assume.plugin import assume
@allure.step("公共断言")
def public_assert(res_json: dict): def public_assert(res_json: dict):
code = res_json.get("code", -100) code = res_json.get("code", -100)
msg = res_json.get("msg", "获取失败") msg = res_json.get("msg", "获取失败")
pytest.assume(code == 0) with assume:
pytest.assume(msg == "成功") assert code == 0, f"code:{code}"
assert msg == "成功", f"msg{msg}"
def assert_res_field_contain_value(data_list: list, value: str): def assert_res_field_contain_value(data_list: list, value: str):
......
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