Commit f707cee4 authored by wxh's avatar wxh

极运营APP-我的线索第一期用例

parent 63c1f45b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (GeekInterfaceTest)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.7 (eniv)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="PyDocumentationSettings"> <component name="PyDocumentationSettings">
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectPlainTextFileTypeManager"> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (eniv)" project-jdk-type="Python SDK" />
<file url="file://$PROJECT_DIR$/script/base_api/api_operation_web/big_screen_temp.py" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (GeekInterfaceTest)" project-jdk-type="Python SDK" />
</project> </project>
\ No newline at end of file
Index: run.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>import pytest\nimport os\n\n\nif __name__ == '__main__':\n run_config = [\n \"-s\", \"./script/ji_yun_ying_app\", \"--alluredir\", \"./report/xml\", \"--host=http://172.10.62.94:3000\",\n ]\n pytest.main(run_config)\n # os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)\n # os.system(\"/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean\")\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- run.py (revision afc678929e714343bc935d0e182aeb8e4de75fff)
+++ run.py (date 1618196902142)
@@ -8,4 +8,4 @@
]
pytest.main(run_config)
# os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)
- # os.system("/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean")
+ os.system("/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean")
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Checkout_at_2021_4_12,_11_11_[Default_Changelist]1" date="1618197069375" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12,_11_11_[Default_Changelist]1/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2021/4/12, 11:11 [Default Changelist]" />
</changelist>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Checkout_at_2021_4_14,_18_41_[Default_Changelist]" date="1618396883746" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14,_18_41_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2021/4/14, 18:41 [Default Changelist]" />
</changelist>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Checkout_at_2021_4_14,_19_04_[Default_Changelist]" date="1618398257506" recycled="false" toDelete="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14,_19_04_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2021/4/14, 19:04 [Default Changelist]" />
</changelist>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Checkout_at_2021_4_14,_19_04_[Default_Changelist]1" date="1618398268286" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14,_19_04_[Default_Changelist]1/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2021/4/14, 19:04 [Default Changelist]" />
</changelist>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Checkout_at_2021_4_14,_19_07_[Default_Changelist]" date="1618398476037" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14,_19_07_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2021/4/14, 19:07 [Default Changelist]" />
</changelist>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<changelist name="Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]" date="1618316475949" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Update at 2021/4/13, 20:21 [Default Changelist]" />
</changelist>
\ No newline at end of file
...@@ -6,21 +6,46 @@ ...@@ -6,21 +6,46 @@
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" /> <item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" /> <item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path> </path>
</expand>
<select>
<path> <path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" /> <item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" /> <item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path> <item name="BRANCH:wangge" type="e8cecc67:BranchNodeDescriptor" />
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path> </path>
</expand> </select>
<select />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="修复return_json的bug"> <list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="修复return_json的bug">
<change beforePath="$PROJECT_DIR$/init_base_api.py" beforeDir="false" afterPath="$PROJECT_DIR$/init_base_api.py" afterDir="false" /> <changelist_data name="wangge" email="" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/conftest.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/data_config/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/data_config/data_myclue.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/workbench/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/workbench/conftest.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_app/workbench/test_myclue.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jk_interface_test.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jk_interface_test.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12,_11_11_[Default_Changelist]1/shelved.patch" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12__11_11__Default_Changelist_.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12__11_11__Default_Changelist_.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12__11_11__Default_Changelist_1.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12__11_13__Default_Changelist_.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_12__11_13__Default_Changelist_.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__16_27__Default_Changelist_.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__16_27__Default_Changelist_.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__18_13__Default_Changelist_.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__18_13__Default_Changelist_.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__18_41__Default_Changelist_.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__19_04__Default_Changelist_.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__19_04__Default_Changelist_1.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__19_07__Default_Changelist_.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__19_34__Default_Changelist_.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2021_4_14__19_34__Default_Changelist_.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13,_20_21_[Default_Changelist]/shelved.patch" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2021_4_13__20_21__Default_Changelist_.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/run.py" beforeDir="false" afterPath="$PROJECT_DIR$/run.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/conftest.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/conftest.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/defalut_account.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/defalut_account.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/public_asserts.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/public_asserts.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/url_to_method.py" beforeDir="false" afterPath="$PROJECT_DIR$/url_to_method.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" />
...@@ -37,7 +62,7 @@ ...@@ -37,7 +62,7 @@
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY"> <option name="RECENT_BRANCH_BY_REPOSITORY">
<map> <map>
<entry key="$PROJECT_DIR$" value="test_report" /> <entry key="$PROJECT_DIR$" value="master" />
</map> </map>
</option> </option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
...@@ -50,42 +75,46 @@ ...@@ -50,42 +75,46 @@
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../test2" />
<property name="run.code.analysis.last.selected.profile" value="aDefault" /> <property name="run.code.analysis.last.selected.profile" value="aDefault" />
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.github.ui.GithubSettingsConfigurable" /> <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PythonContentEntriesConfigurable" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="G:\jk_interface_test\script\ji_yun_ying_app(wangge)" />
<recent name="G:\jk_interface_test\script\ji_yun_ying_app" />
<recent name="$PROJECT_DIR$" /> <recent name="$PROJECT_DIR$" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="G:\jk_interface_test\script\ji_yun_ying_app(wangge)" />
<recent name="G:\jk_interface_test\script\ji_yun_ying_app(wangge)\workbench" />
<recent name="$PROJECT_DIR$/common" /> <recent name="$PROJECT_DIR$/common" />
<recent name="$PROJECT_DIR$/script/ji_yun_ying_pc/data_config" /> <recent name="$PROJECT_DIR$/script/ji_yun_ying_pc/data_config" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Python.run"> <component name="RunManager" selected="Python.run">
<configuration name="create_case" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="data_myclue" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" /> <module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_app/data_config" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/create_case.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_app/data_config/data_myclue.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="true" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" /> <option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" /> <option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="init_base_api" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="run" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" /> <module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -97,7 +126,8 @@ ...@@ -97,7 +126,8 @@
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/init_base_api.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/run.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -106,7 +136,7 @@ ...@@ -106,7 +136,7 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="init_new_base_api" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="test_myclue" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" /> <module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -114,11 +144,12 @@ ...@@ -114,11 +144,12 @@
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_app/workbench" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/init_new_base_api.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_app/workbench/test_myclue.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -127,7 +158,7 @@ ...@@ -127,7 +158,7 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="run" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="xmind_to_can_dao_new" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" /> <module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -135,11 +166,12 @@ ...@@ -135,11 +166,12 @@
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="WORKING_DIRECTORY" value="$USER_HOME$/Desktop/测试用例" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/run.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$USER_HOME$/Desktop/测试用例/xmind_to_can_dao_new.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -148,38 +180,37 @@ ...@@ -148,38 +180,37 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="url_to_method" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="pytest for test_banner_area.TestBannerArea.test_banner_area_enable" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" /> <module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/marketing" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/url_to_method.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="PARAMETERS" value="" /> <option name="_new_keywords" value="&quot;&quot;" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="_new_parameters" value="&quot;&quot;" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="MODULE_MODE" value="false" /> <option name="_new_target" value="&quot;test_banner_area.TestBannerArea.test_banner_area_enable&quot;" />
<option name="REDIRECT_INPUT" value="false" /> <option name="_new_targetType" value="&quot;PYTHON&quot;" />
<option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Python.url_to_method" />
<item itemvalue="Python.run" /> <item itemvalue="Python.run" />
<item itemvalue="Python.init_new_base_api" /> <item itemvalue="Python.test_myclue" />
<item itemvalue="Python.init_base_api" /> <item itemvalue="Python.data_myclue" />
<item itemvalue="Python.create_case" /> <item itemvalue="Python.data_myclue" />
<item itemvalue="Python.xmind_to_can_dao_new" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" BundledDictionaries="0" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" Dictionaries="0" CorrectionsLimit="5" DefaultDictionary="application-level" UseSingleDictionary="true" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="" /> <changelist id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="" />
...@@ -187,6 +218,14 @@ ...@@ -187,6 +218,14 @@
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1611302255574</updated> <updated>1611302255574</updated>
<workItem from="1618473570313" duration="24435000" />
<workItem from="1619094363660" duration="14537000" />
<workItem from="1619616616471" duration="226000" />
<workItem from="1619745973585" duration="12174000" />
<workItem from="1620295598774" duration="11878000" />
<workItem from="1620385351462" duration="7941000" />
<workItem from="1620640298185" duration="63237000" />
<workItem from="1621404464356" duration="45255000" />
</task> </task>
<task id="LOCAL-00001" summary="增加依赖文件"> <task id="LOCAL-00001" summary="增加依赖文件">
<created>1611309477574</created> <created>1611309477574</created>
...@@ -212,12 +251,27 @@ ...@@ -212,12 +251,27 @@
<option name="localTasksCounter" value="4" /> <option name="localTasksCounter" value="4" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="2" />
</component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES"> <option name="TAB_STATES">
<map> <map>
<entry key="MAIN"> <entry key="MAIN">
<value> <value>
<State /> <State>
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="wangge" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value> </value>
</entry> </entry>
</map> </map>
...@@ -230,4 +284,79 @@ ...@@ -230,4 +284,79 @@
<MESSAGE value="修复return_json的bug" /> <MESSAGE value="修复return_json的bug" />
<option name="LAST_COMMIT_MESSAGE" value="修复return_json的bug" /> <option name="LAST_COMMIT_MESSAGE" value="修复return_json的bug" />
</component> </component>
<component name="WindowStateProjectService">
<state x="93" y="93" width="1095" height="495" key="DiffContextDialog" timestamp="1618559523178">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="93" y="93" width="1095" height="495" key="DiffContextDialog/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1618559523178" />
<state x="420" y="95" key="FileChooserDialogImpl" timestamp="1620737704387">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="420" y="95" key="FileChooserDialogImpl/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1620737704387" />
<state width="1237" height="523" key="GridCell.Tab.0.bottom" timestamp="1621563037612">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="523" key="GridCell.Tab.0.bottom/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1621563037612" />
<state width="1237" height="523" key="GridCell.Tab.0.bottom/0.0.1280.680@0.0.1280.680" timestamp="1620893309387" />
<state width="1237" height="523" key="GridCell.Tab.0.center" timestamp="1621563037611">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="523" key="GridCell.Tab.0.center/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1621563037611" />
<state width="1237" height="523" key="GridCell.Tab.0.center/0.0.1280.680@0.0.1280.680" timestamp="1620893309387" />
<state width="1237" height="523" key="GridCell.Tab.0.left" timestamp="1621563037610">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="523" key="GridCell.Tab.0.left/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1621563037610" />
<state width="1237" height="523" key="GridCell.Tab.0.left/0.0.1280.680@0.0.1280.680" timestamp="1620893309387" />
<state width="1237" height="523" key="GridCell.Tab.0.right" timestamp="1621563037612">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="523" key="GridCell.Tab.0.right/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1621563037612" />
<state width="1237" height="523" key="GridCell.Tab.0.right/0.0.1280.680@0.0.1280.680" timestamp="1620893309387" />
<state width="1237" height="204" key="GridCell.Tab.1.bottom" timestamp="1620729489372">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="204" key="GridCell.Tab.1.bottom/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1620729489372" />
<state width="1237" height="204" key="GridCell.Tab.1.center" timestamp="1620729489372">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="204" key="GridCell.Tab.1.center/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1620729489372" />
<state width="1237" height="204" key="GridCell.Tab.1.left" timestamp="1620729489372">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="204" key="GridCell.Tab.1.left/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1620729489372" />
<state width="1237" height="204" key="GridCell.Tab.1.right" timestamp="1620729489372">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="1237" height="204" key="GridCell.Tab.1.right/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1620729489372" />
<state x="142" y="0" key="SettingsEditor" timestamp="1620651633570">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="142" y="0" key="SettingsEditor/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1620651633570" />
<state width="647" height="347" key="XDebugger.FullValuePopup" timestamp="1621418395300">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state width="647" height="347" key="XDebugger.FullValuePopup/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1621418395300" />
<state x="438" y="254" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1621568692706">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="438" y="254" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1621568692706" />
<state x="434" y="199" key="scopes" timestamp="1618477218150">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="434" y="199" key="scopes/0.0.1280.680/1920.0.1920.1040@0.0.1280.680" timestamp="1618477218150" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/jk_interface_test$pytest_in_test_myclue_py.coverage" NAME="pytest in test_myclue.py Coverage Results" MODIFIED="1618558317344" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_app(wangge)/workbench" />
<SUITE FILE_PATH="coverage/jk_interface_test$data_myclue.coverage" NAME="data_myclue Coverage Results" MODIFIED="1620650479038" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_app(wangge)/workbench/data_config" />
<SUITE FILE_PATH="coverage/jk_interface_test$run.coverage" NAME="run Coverage Results" MODIFIED="1621497848614" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/jk_interface_test$pytest_for_test_myclue_TestMyClue_test_data_source.coverage" NAME="pytest for test_myclue.TestMyClue.test_data_source Coverage Results" MODIFIED="1618558122624" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_app(wangge)/workbench" />
<SUITE FILE_PATH="coverage/jk_interface_test$pytest_for_test_banner_area_TestBannerArea_test_banner_area_add.coverage" NAME="pytest for test_banner_area.TestBannerArea.test_banner_area_add Coverage Results" MODIFIED="1618558397105" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_pc/marketing" />
<SUITE FILE_PATH="coverage/jk_interface_test$pytest_for_test_banner_area_TestBannerArea_test_banner_area_enable.coverage" NAME="pytest for test_banner_area.TestBannerArea.test_banner_area_enable Coverage Results" MODIFIED="1618558420225" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_pc/marketing" />
<SUITE FILE_PATH="coverage/jk_interface_test$url_to_method.coverage" NAME="url_to_method Coverage Results" MODIFIED="1618557269320" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/jk_interface_test$pytest_for_test_myclue_TestMyClue.coverage" NAME="pytest for test_myclue.TestMyClue Coverage Results" MODIFIED="1618558195787" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_app(wangge)/workbench" />
<SUITE FILE_PATH="coverage/jk_interface_test$test_myclue.coverage" NAME="test_myclue Coverage Results" MODIFIED="1621482156304" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_app/workbench" />
<SUITE FILE_PATH="coverage/jk_interface_test$pytest_for_test_receipt_detail_TestReceiptDetail.coverage" NAME="pytest for test_receipt_detail.TestReceiptDetail Coverage Results" MODIFIED="1618543231745" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script/ji_yun_ying_pc/statistical_report" />
<SUITE FILE_PATH="coverage/jk_interface_test$xmind_to_can_dao_new.coverage" NAME="xmind_to_can_dao_new Coverage Results" MODIFIED="1619616681291" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$USER_HOME$/Desktop/测试用例" />
</component>
</project> </project>
\ No newline at end of file
...@@ -3,12 +3,12 @@ import os ...@@ -3,12 +3,12 @@ import os
if __name__ == '__main__': if __name__ == '__main__':
run_config = [ run_config = [
"-s", "./script/ji_yun_ying_pc/statistical_report/test_receipt_detail.py", "-s", "./script/ji_yun_ying_app/workbench/test_myclue.py",
"--alluredir", "./report/xml", "--alluredir", "./report/xml",
"--host", "http://192.168.32.36", "--host", "http://192.168.32.31",
"--account", "b", "--account", "A",
"--db", "36" "--db", "36"
] ]
x = pytest.main(run_config) x = pytest.main(run_config)
# os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息) # os模块运行allure命令,来生成html格式的报告(根据刚刚生成的配置信息)
os.system("/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean") # os.system("/Users/huangqiang/WorkPlace/allure-2.13.8/bin/allure generate ./report/xml -o ./report/html --clean")
...@@ -7,6 +7,7 @@ from script.base_api.service_user.auth import auth_employee_post ...@@ -7,6 +7,7 @@ from script.base_api.service_user.auth import auth_employee_post
from script.defalut_account import accounts from script.defalut_account import accounts
from script.base_api.service_user.departments import departments_schools_get from script.base_api.service_user.departments import departments_schools_get
from script.base_api.service_user.wxMini import wxMini_auth_post from script.base_api.service_user.wxMini import wxMini_auth_post
from script.base_api.api_operation_app.employee import employee_login_post
def pytest_addoption(parser): def pytest_addoption(parser):
...@@ -60,6 +61,25 @@ def gos_login(pytestconfig): ...@@ -60,6 +61,25 @@ def gos_login(pytestconfig):
default_header.gos_header.setdefault("Authorization", "token not found") default_header.gos_header.setdefault("Authorization", "token not found")
@pytest.fixture(scope="session", autouse=True)
def jyy_app_login(pytestconfig):
account = accounts.get(pytestconfig.getoption('--account').upper())
jyy_app_account = account.get("jyy_app_account")
body_data = {"account": jyy_app_account.get("account"),
"password": jyy_app_account.get("password"),
"type": "employee",
"identityType": 1,
"ip": "0.0.0.0"
}
res_json = employee_login_post(body=body_data, header=default_header.jyy_app_header)
tokens = jsonpath.jsonpath(res_json, "$.data.token")
print("tokens", tokens)
if tokens:
default_header.jyy_app_header.setdefault("authorization", f"Bearer {tokens[0]}")
else:
default_header.jyy_app_header.setdefault("authorization", "token not found")
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def get_big_area_schools(): def get_big_area_schools():
res = departments_schools_get(headers=default_header.jyy_header) res = departments_schools_get(headers=default_header.jyy_header)
......
...@@ -9,7 +9,7 @@ accounts = { ...@@ -9,7 +9,7 @@ accounts = {
}, },
# 极运营app默认账号 # 极运营app默认账号
"jyy_app_account": { "jyy_app_account": {
"account": "15360956010", "account": "15244919753",
"password": "88888888" "password": "88888888"
}, },
# 家长默认账号 # 家长默认账号
......
from script.conftest import get_host, jyy_app_login
import time
import datetime
import random
import psycopg2
createSchoolAreaId = [2389, 2398, 3363, 3015, 3154, 3352, 2369, 3095, 3348, 3333, 3351, 3359, 3345, 3365, 3362, 3339,
3353, 3334, 2400, 3360, 3361, 3373, 3371, 3366, 3349, 3372, 3340, 2427, 3367, 3335, 3148, 3374,
3377, 3369, 3376, 3378, 3368, 3336, 3370, 3357, 3350, 3001, 3072, 3049, 3342, 3337, 2411, 3344,
2412, 3100, 3146, 3052, 3047, 3157, 3107, 3108, 3076, 3147, 3167, 2413, 2383, 3064, 3152, 3063,
3101, 3130, 3170, 3074, 3165, 3044, 3059, 3038, 3166, 3168, 2385, 3171, 2373, 3137, 3151, 2417,
3041, 3036, 3060, 3125, 3046, 3109, 3110, 3142, 3149, 3037, 3039, 3104, 2422, 3158, 2407, 2386,
3099, 2410, 3067, 3329, 2371, 3330, 3133, 3071, 3070, 3053, 3065, 3150, 3061, 3126, 3062, 2423,
2364, 3043, 2415, 3131, 2388, 3096, 2376, 3042, 3127, 2402, 2359, 2365, 2408, 2425, 3002, 2391,
3135, 3136, 3153, 3139, 3144, 2419, 3075, 2416, 2421, 2363, 2368, 2403, 2414, 2392, 3138, 2406,
3156, 3155, 3097, 3098, 3141, 3069, 2405, 2399, 2397, 2360, 3145, 2420, 2404, 2374, 2401, 3054,
3124]
followingStatus = ['OVERTIME', 'UNFOLLOWED', 'FOLLOWING']
def end_time():
today = datetime.date.today().strftime('%Y-%m-%d')
print(today)
return today
def start_time():
last_month = (datetime.datetime.today() + datetime.timedelta(days=-31)).strftime('%Y-%m-%d')
print(last_month)
return last_month
def generate_phone():
# 第二位数字
second = [3, 4, 5, 7, 8][random.randint(0, 4)]
# 第三位数字
third = {
3: random.randint(0, 9),
4: [5, 7, 9][random.randint(0, 2)],
5: [i for i in range(10) if i != 4][random.randint(0, 8)],
7: [i for i in range(10) if i not in [4, 9]][random.randint(0, 7)],
8: random.randint(0, 9),
}[second]
# 最后八位数字
suffix = random.randint(9999999, 100000000)
# 拼接手机号
return "1{}{}{}".format(second, third, suffix)
def generate_name():
# encoding: utf-8
first_name = ["王", "李", "张", "刘", "赵", "蒋", "孟", "陈", "徐", "杨", "沈", "马", "高", "殷", "上官", "钟", "常"]
second_name = ["伟", "华", "建国", "洋", "刚", "万里", "爱民", "牧", "陆", "路", "昕", "鑫", "兵", "硕", "志宏", "峰", "磊", "雷", "文",
"明浩", "光", "超", "军", "达", '新', '信']
name1 = random.sample(first_name, 1) + random.sample(second_name, 1)
name = ''.join(name1)
return name
def generate_intentionLevel():
Level = ['S', 'A', 'B', 'C']
intentionLevel = random.sample(Level, 1)[0]
return intentionLevel
def generate_sourceId():
ID = [111, 112, 113, 119, 101, 102, 103, 114, 115]
sourceId = random.sample(ID, 1)
return sourceId
def pg_data():
database = 'edu-admin'
user = 'dev'
password = 'mko0PL<.;?'
host = '192.168.32.31'
port = 5432
with psycopg2.connect(database=database, user=user,
password=password, host=host, port=port)as pg_conn:
with pg_conn.cursor() as cur:
cur.execute('SELECT * FROM "service_crm"."clue_basic_info" LIMIT 1')
results = cur.fetchall()
return results
lst = [{'id': 111, 'name': '网站'},
{'id': 112, 'name': '营销工具'},
{'id': 113, 'name': '公众号'},
{'id': 119, 'name': '网报小程序'},
{'id': 101, 'name': '自然口碑'},
{'id': 102, 'name': '营销活动'},
{'id': 103, 'name': '营销口碑'},
{'id': 114, 'name': '地推'},
{'id': 115, 'name': '广告'},
{'id': 116, 'name': '户外广告'}]
ids = [x.get("id") for x in lst]
\ No newline at end of file
import allure
import pytest
import jsonpath
from datetime import datetime
from script import public_asserts
from script.base_api import clue_queryAll_post, clue_addClue_post, clue_dict_studentSource_queryNoAuth_get
from script.default_header import jyy_app_header
from script.public_asserts import assert_res_field_order, assert_res_field_contain_value
from script.ji_yun_ying_app.data_config.data_myclue import end_time, start_time, \
generate_phone, generate_name, generate_intentionLevel, generate_sourceId, pg_data
@allure.epic('工作台')
@allure.feature('我的线索')
class TestMyClue:
# @allure.title('新增线索-填写必填项')
# @pytest.mark.run(order=1)
# @pytest.mark.parametrize('phone', [generate_phone()])
# @pytest.mark.parametrize('name', [generate_name()])
# @pytest.mark.parametrize('intentionLevel', [generate_intentionLevel()])
# @pytest.mark.parametrize('sourceId', [generate_sourceId()])
# def test_add_clue_Required(self, phone, name, intentionLevel):
# print(phone)
# print(name)
# print(intentionLevel)
# body = {"studentName": name,
# "collectPerson": "王星皓3",
# "otherRemark": "",
# "intentionLevel": intentionLevel,
# "sourceId": 111,
# "studentSex": "",
# "contactInfo": phone,
# "contactType": "PHONE",
# "secondContactInfo": "",
# "secondContactType": "PHONE",
# "citys": [
# "510000",
# "510100"
# ],
# "schoolProvinceId": "510000",
# "schoolProvinceName": "四川省",
# "schoolCityId": "510100",
# "schoolCityName": "成都市",
# "schoolId": "",
# "schoolName": "",
# "classRank": "",
# "gradeRank": "",
# "recentScore": "",
# "parentsHope": "",
# "studyHabit": "",
# "sourceIdFirstName": "线上营销",
# "sourceIdSecondName": "网站",
# "testPaperUrls": "",
# "belong": "PERSON",
# "createSchoolAreaId": 3015,
# "city": "510100"}
# res = clue_addClue_post(body=body, header=jyy_app_header)
# print(res)
# code = res['code']
# msg = res['msg']
# print(code)
# print(msg)
# assert code == 0
# assert msg == '成功'
@allure.title('新增线索-不填写必填项')
def test_add_clue_noRequired(self):
body = {"studentName": '',
"collectPerson": "王星皓3",
"otherRemark": "",
"intentionLevel": '',
"sourceId": 111,
"studentSex": "",
"contactInfo": '',
"contactType": "PHONE",
"secondContactInfo": "",
"secondContactType": "PHONE",
"citys": [
"510000",
"510100"
],
"schoolProvinceId": "510000",
"schoolProvinceName": "四川省",
"schoolCityId": "510100",
"schoolCityName": "成都市",
"schoolId": "",
"schoolName": "",
"classRank": "",
"gradeRank": "",
"recentScore": "",
"parentsHope": "",
"studyHabit": "",
"sourceIdFirstName": "线上营销",
"sourceIdSecondName": "网站",
"testPaperUrls": "",
"belong": "PERSON",
"createSchoolAreaId": 3015,
"city": "510100"}
res = clue_addClue_post(body=body, header=jyy_app_header)
print(res)
code = res['code']
msg = res['msg']
print(code)
print(msg)
assert code == 100110001
result = '第一联系方式不能为空' in msg
assert result == True
@allure.title('新增线索-第一联系方式重复')
@pytest.mark.parametrize('phone', pg_data())
@pytest.mark.parametrize('name', pg_data())
@pytest.mark.parametrize('intentionLevel', [generate_intentionLevel()])
def test_existent_clue(self, phone, name, intentionLevel):
print(intentionLevel)
print(name[1])
print(phone[4])
body = {"studentName": name[1],
"collectPerson": "王星皓3",
"otherRemark": "",
"intentionLevel": intentionLevel,
"sourceId": 111,
"studentSex": "",
"contactInfo": phone[4],
"contactType": "PHONE",
"secondContactInfo": "",
"secondContactType": "PHONE",
"citys": [
"510000",
"510100"
],
"schoolProvinceId": "510000",
"schoolProvinceName": "四川省",
"schoolCityId": "510100",
"schoolCityName": "成都市",
"schoolId": "",
"schoolName": "",
"classRank": "",
"gradeRank": "",
"recentScore": "",
"parentsHope": "",
"studyHabit": "",
"sourceIdFirstName": "线上营销",
"sourceIdSecondName": "网站",
"testPaperUrls": "",
"belong": "PERSON",
"createSchoolAreaId": 3015,
"city": "510100"}
res = clue_addClue_post(body=body, header=jyy_app_header)
print(res)
code = res['code']
msg = res['msg']
print(code)
print(msg)
assert code == 100210006
result = '线索已存在' in msg
assert result == True
@allure.title('新增线索-来源渠道验证')
def test_clue_source_channel(self):
print('来源渠道验证')
body = {}
res = clue_dict_studentSource_queryNoAuth_get(body=body, header=jyy_app_header)
print(res)
code = res['code']
msg = res['msg']
print(code)
print(msg)
assert code == 0
assert msg == '成功'
@allure.title('线索列表-默认线索数据来源')
@pytest.mark.run(order=2)
def test_data_source(self):
body = {
"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
msg = res['msg']
print(total)
print(code)
if total == 0:
assert code == 0
assert msg == '成功'
else:
createPerson = jsonpath.jsonpath(res, "$.data.list..createPerson")
print(createPerson)
result = assert_res_field_contain_value(createPerson, '王星皓3')
pytest.assume(result)
@allure.title('线索列表-录入时间降序')
def test_data_sort(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "create_time"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
createTime = jsonpath.jsonpath(res, "$.data.list..createTime")
print(createTime)
result = assert_res_field_order(createTime, 'desc')
pytest.assume(result)
@allure.title('线索列表-录入时间正序')
def test_data_sort2(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "asc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "create_time"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
createTime = jsonpath.jsonpath(res, "$.data.list..createTime")
print(createTime)
result = assert_res_field_order(createTime, 'asc')
pytest.assume(result)
@allure.title('线索列表-末次跟进时间正序')
def test_data_sort3(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "asc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "last_follow_time"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
lastFollowTime = jsonpath.jsonpath(res, "$.data.list..lastFollowTime")
print(lastFollowTime)
if None in lastFollowTime:
ID = jsonpath.jsonpath(res, "$.data.list..id")
result = assert_res_field_order(ID, 'desc')
pytest.assume(result)
else:
result = assert_res_field_order(lastFollowTime, 'asc')
pytest.assume(result)
@allure.title('线索列表-末次跟进时间降序')
def test_data_sort4(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "last_follow_time"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
lastFollowTime = jsonpath.jsonpath(res, "$.data.list..lastFollowTime")
print(lastFollowTime)
if None in lastFollowTime:
ID = jsonpath.jsonpath(res, "$.data.list..id")
result = assert_res_field_order(ID, 'desc')
pytest.assume(result)
else:
result = assert_res_field_order(lastFollowTime, 'asc')
pytest.assume(result)
@allure.title('线索列表-计划跟进时间降序')
def test_data_sort5(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "next_follow_time"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
nextFollowTime = jsonpath.jsonpath(res, "$.data.list..nextFollowTime")
print(nextFollowTime)
result = assert_res_field_order(nextFollowTime, 'desc')
pytest.assume(result)
@allure.title('线索列表-计划跟进时间降序')
def test_data_sort6(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "asc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "next_follow_time"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
nextFollowTime = jsonpath.jsonpath(res, "$.data.list..nextFollowTime")
print(nextFollowTime)
result = assert_res_field_order(nextFollowTime, 'asc')
pytest.assume(result)
@allure.title('线索列表-未跟进线索筛选')
def test_data_not_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"followingStatus": "UNFOLLOWED",
"followingStatusLabel": "未跟进"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
statusTranslate = jsonpath.jsonpath(res, "$.data.list..statusTranslate")
print(statusTranslate)
result = assert_res_field_contain_value(statusTranslate, '未跟进')
pytest.assume(result)
@allure.title('线索列表-跟进中线索筛选')
def test_data_in_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"followingStatus": "FOLLOWING",
"followingStatusLabel": "跟进中"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
statusTranslate = jsonpath.jsonpath(res, "$.data.list..statusTranslate")
print(statusTranslate)
result = assert_res_field_contain_value(statusTranslate, '跟进中')
pytest.assume(result)
@allure.title('线索列表-已逾期线索筛选')
def test_data_over_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"followingStatus": "OVERTIME",
"followingStatusLabel": "已逾期"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
statusTranslate = jsonpath.jsonpath(res, "$.data.list..statusTranslate")
print(statusTranslate)
result = assert_res_field_contain_value(statusTranslate, '已逾期')
pytest.assume(result)
@allure.title('线索列表-S意向等级')
def test_data_s_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"intentionLevel": "S",
"intentionLevelLabel": "S(高意向)"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
intentionLevel = jsonpath.jsonpath(res, "$.data.list..intentionLevel")
print(intentionLevel)
result = assert_res_field_contain_value(intentionLevel, 'S')
pytest.assume(result)
@allure.title('线索列表-A意向等级')
def test_data_a_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"intentionLevel": "A",
"intentionLevelLabel": "A(中等意向)"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
intentionLevel = jsonpath.jsonpath(res, "$.data.list..intentionLevel")
print(intentionLevel)
result = assert_res_field_contain_value(intentionLevel, 'A')
pytest.assume(result)
@allure.title('线索列表-B意向等级')
def test_data_b_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"intentionLevel": "B",
"intentionLevelLabel": "B(低意向)"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
intentionLevel = jsonpath.jsonpath(res, "$.data.list..intentionLevel")
print(intentionLevel)
result = assert_res_field_contain_value(intentionLevel, 'B')
pytest.assume(result)
@allure.title('线索列表-C意向等级')
def test_data_c_follow(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"intentionLevel": "C",
"intentionLevelLabel": "C(无意向)"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
intentionLevel = jsonpath.jsonpath(res, "$.data.list..intentionLevel")
print(intentionLevel)
result = assert_res_field_contain_value(intentionLevel, 'C')
pytest.assume(result)
@allure.title('线索列表-模糊查询')
def test_fuzzy_query(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"studentName": "4",
"status": "FOLLOWING",
"orderField": "id"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
studentName = jsonpath.jsonpath(res, "$.data.list..studentName")
print(studentName)
result = assert_res_field_contain_value(studentName, '4')
pytest.assume(result)
@allure.title('线索列表-电话号码查询')
def test_num_query(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"studentName": "15588880033",
"status": "FOLLOWING",
"orderField": "id"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
contactInfo = jsonpath.jsonpath(res, "$.data.list..contactInfo")
print(contactInfo)
result = assert_res_field_contain_value(contactInfo, '15588880033')
pytest.assume(result)
@allure.title('线索列表-多条件查询')
def test_multiple_query(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"studentName": "4",
"status": "FOLLOWING",
"orderField": "id",
"followingStatus": "OVERTIME",
"intentionLevel": "A",
"intentionLevelLabel": "A(中等意向)",
"followingStatusLabel": "已逾期"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
statusTranslate = jsonpath.jsonpath(res, "$.data.list..statusTranslate")
intentionLevel = jsonpath.jsonpath(res, "$.data.list..intentionLevel")
studentName = jsonpath.jsonpath(res, "$.data.list..studentName")
print(studentName)
print(statusTranslate)
print(intentionLevel)
result = assert_res_field_contain_value(studentName, '4')
result1 = assert_res_field_contain_value(statusTranslate, '已逾期')
result2 = assert_res_field_contain_value(intentionLevel, 'A')
pytest.assume(result)
pytest.assume(result1)
pytest.assume(result2)
@allure.title('线索列表-线索来源')
def test_clue_source(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"sourceId": "100"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
sourceName = jsonpath.jsonpath(res, "$.data.list..sourceName")
print(sourceName)
result = assert_res_field_contain_value(sourceName, '线上营销')
pytest.assume(result)
@allure.title('线索列表-年级')
def test_class_level(self):
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"sourceId": '',
"publicGrade": "三年级"}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
publicGrade = jsonpath.jsonpath(res, "$.data.list..publicGrade")
print(publicGrade)
result = assert_res_field_contain_value(publicGrade, '三年级')
pytest.assume(result)
@allure.title('线索列表-录入时间')
@pytest.mark.parametrize("s_time", [start_time()])
@pytest.mark.parametrize("e_time", [end_time()])
def test_input_time(self, s_time, e_time):
print(s_time)
print(e_time)
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"createTimeBeginDateStr": s_time,
"createTimeEndDateStr": e_time}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
createTimeStr = jsonpath.jsonpath(res, "$.data.list..createTimeStr")
print(createTimeStr)
ctime1 = max(createTimeStr)
ct1 = datetime.strptime(ctime1, '%Y-%m-%d %H:%M:%S')
ct3 = datetime.strftime(ct1, '%Y-%m-%d')
ctime2 = min(createTimeStr)
ct2 = datetime.strptime(ctime2, '%Y-%m-%d %H:%M:%S')
ct4 = datetime.strftime(ct2, '%Y-%m-%d')
print(ct3)
print(ct4)
assert s_time <= ct3 <= e_time
assert s_time <= ct4 <= e_time
@allure.title('线索列表-末次跟进时间时间')
@pytest.mark.parametrize("s_time", [start_time()])
@pytest.mark.parametrize("e_time", [end_time()])
def test_last_follow_time(self, s_time, e_time):
print(s_time)
print(e_time)
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"lastFollowTimeBeginDateStr": s_time,
"lastFollowTimeEndDateStr": e_time}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
lastFollowTimeStr = jsonpath.jsonpath(res, "$.data.list..lastFollowTimeStr")
print(lastFollowTimeStr)
ptime1 = max(lastFollowTimeStr)
ptime2 = min(lastFollowTimeStr)
print(ptime1)
print(ptime2)
assert s_time <= ptime1 <= e_time
assert s_time <= ptime2 <= e_time
@allure.title('线索列表-计划跟进时间')
@pytest.mark.parametrize("s_time", [start_time()])
@pytest.mark.parametrize("e_time", [end_time()])
def test_next_follow_time(self, s_time, e_time):
print(s_time)
print(e_time)
body = {"pageNum": 1,
"pageSize": 10,
"belong": "PERSON",
"orderType": "desc",
"createSchoolAreaId": 3015,
"status": "FOLLOWING",
"orderField": "id",
"nextFollowTimeBeginDateStr": s_time,
"nextFollowTimeEndDateStr": e_time}
res = clue_queryAll_post(body=body, header=jyy_app_header)
print(res)
total = res['data']['total']
code = res['code']
print(code)
print(total)
if total == 0:
assert code == 0
else:
nextFollowTimeStr = jsonpath.jsonpath(res, "$.data.list..nextFollowTimeStr")
print(nextFollowTimeStr)
ptime1 = max(nextFollowTimeStr)
ptime2 = min(nextFollowTimeStr)
print(ptime1)
print(ptime2)
assert s_time <= ptime1 <= e_time
assert s_time <= ptime2 <= e_time
import pytest import pytest
def public_assert(res_json: dict): def public_assert(res_json: object) -> object:
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) pytest.assume(code == 0)
pytest.assume(msg == "成功") pytest.assume(msg == "成功")
def assert_res_field_contain_value(data_list: list, value: str): def assert_res_field_contain_value(data_list: object, value: object) -> object:
if data_list: if data_list:
err_values = [x for x in data_list if value not in x] err_values = [x for x in data_list if value not in x]
if err_values: if err_values:
......
...@@ -30,4 +30,4 @@ def get_method(url, method): ...@@ -30,4 +30,4 @@ def get_method(url, method):
if __name__ == '__main__': if __name__ == '__main__':
get_method("/service-profile/app/transferred/22322/class/totalNum", "GET") get_method("/api-operation-app/employee/login", "POST")
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