Commit 94b0d37a authored by qianyanyan's avatar qianyanyan

copy gt

parent 44ef3d5a
znfz_autotest
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 " project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/znfz_autotest.iml" filepath="$PROJECT_DIR$/.idea/znfz_autotest.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c46002cb-eb9f-460f-aaf0-13a229cc306b" name="默认的" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/znfz_test1$conn_database.coverage" NAME="conn_database Coverage Results" MODIFIED="1591167231664" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/baseuse" />
<SUITE FILE_PATH="coverage/znfz_test1$py_test_for_test_login_test_login2.coverage" NAME="py.test for test_login.test_login2 Coverage Results" MODIFIED="1590980284414" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test_cases" />
<SUITE FILE_PATH="coverage/znfz_test1$browser_engine.coverage" NAME="browser_engine Coverage Results" MODIFIED="1590980316052" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/baseuse" />
<SUITE FILE_PATH="coverage/znfz_test1$check_zcjd.coverage" NAME="check_zcjd Coverage Results" MODIFIED="1591067732344" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/baseuse" />
<SUITE FILE_PATH="coverage/znfz_test1$logger.coverage" NAME="logger Coverage Results" MODIFIED="1590914186990" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/baseuse" />
<SUITE FILE_PATH="coverage/znfz_test1$py_test_for_test_login_test_login.coverage" NAME="py.test for test_login.test_login Coverage Results" MODIFIED="1591005074309" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test_cases" />
<SUITE FILE_PATH="coverage/znfz_test1$py_test_in_test_main_py.coverage" NAME="py.test in test_main.py Coverage Results" MODIFIED="1590914193088" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test_cases" />
<SUITE FILE_PATH="coverage/znfz_test1$readConfig.coverage" NAME="readConfig Coverage Results" MODIFIED="1590733890623" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/framework" />
<SUITE FILE_PATH="coverage/znfz_test1$browser_engine__1_.coverage" NAME="browser_engine (1) Coverage Results" MODIFIED="1590891001278" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/baseuse" />
<SUITE FILE_PATH="coverage/znfz_test1$py_test_in_test_login_py.coverage" NAME="py.test in test_login.py Coverage Results" MODIFIED="1591769926658" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test_cases" />
<SUITE FILE_PATH="coverage/znfz_test1$check_gsjd.coverage" NAME="check_gsjd Coverage Results" MODIFIED="1591087200269" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/baseuse" />
<SUITE FILE_PATH="coverage/znfz_test1$py_test_for_test_login_test_login1.coverage" NAME="py.test for test_login.test_login1 Coverage Results" MODIFIED="1590892783620" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test_cases" />
</component>
<component name="FavoritesManager">
<favorites_list name="znfz_test1" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="pytest.ini" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/test_cases/pytest.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="browser_engine.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/engine/browser_engine.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="171">
<caret line="11" column="43" lean-forward="true" selection-start-line="11" selection-start-column="43" selection-end-line="11" selection-end-column="43" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="test_login.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/tests/test_cases/test_login.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-790">
<caret line="59" column="49" lean-forward="true" selection-start-line="59" selection-start-column="49" selection-end-line="59" selection-end-column="49" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>open_browser</find>
<find>caseid</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/test_cases/browser_engine.py" />
<option value="$PROJECT_DIR$/framework/readConfig.py" />
<option value="$PROJECT_DIR$/framework/browser_engine.py" />
<option value="$PROJECT_DIR$/test_cases/py.ini" />
<option value="$PROJECT_DIR$/baseuse/logger.py" />
<option value="$PROJECT_DIR$/baseuse/check_zcjd.py" />
<option value="$PROJECT_DIR$/baseuse/read_config.py" />
<option value="$PROJECT_DIR$/baseuse/end_database.py" />
<option value="$PROJECT_DIR$/config/config.ini" />
<option value="$PROJECT_DIR$/baseuse/conn_database.py" />
<option value="$PROJECT_DIR$/baseuse/browser_engine.py" />
<option value="$PROJECT_DIR$/test_cases/pytest.ini" />
<option value="$PROJECT_DIR$/baseuse/check_gsjd.py" />
<option value="$PROJECT_DIR$/test_cases/test_gsjd.py" />
<option value="$PROJECT_DIR$/test_cases/test_login.py" />
<option value="$PROJECT_DIR$/test_cases/test_main.py" />
<option value="$PROJECT_DIR$/basepage/browser_engine.py" />
<option value="$PROJECT_DIR$/engine/browser_engine.py" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds" extendedState="7">
<option name="x" value="1341" />
<option name="y" value="96" />
<option name="width" value="1380" />
<option name="height" value="735" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="basepage" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="config" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="driver" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="engine" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="logs" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="tests" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="znfz_autotest-develop_gt" type="462c0819:PsiDirectoryNode" />
<item name="tests" type="462c0819:PsiDirectoryNode" />
<item name="test_cases" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="外部库" type="cb654da1:ExternalLibrariesNode" />
</path>
<path>
<item name="znfz_autotest" type="b2602c69:ProjectViewProjectNode" />
<item name="外部库" type="cb654da1:ExternalLibrariesNode" />
<item name="&lt; Python 3.6 &gt;" type="70bed36:NamedLibraryElementNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="sshConsole" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Python tests.py.test in test_login.py">
<configuration default="true" type="DjangoTestsConfigurationType" factoryName="Django tests">
<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="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="TARGET" value="" />
<option name="SETTINGS_FILE" value="" />
<option name="CUSTOM_SETTINGS" value="false" />
<option name="USE_OPTIONS" value="false" />
<option name="OPTIONS" value="" />
</configuration>
<configuration default="true" type="PyBehaveRunConfigurationType" factoryName="Behave">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="ADDITIONAL_ARGS" value="" />
</configuration>
<configuration default="true" type="PyLettuceRunConfigurationType" factoryName="Lettuce">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="ADDITIONAL_ARGS" value="" />
</configuration>
<configuration name="check_gsjd" type="PythonConfigurationType" factoryName="Python" temporary="true">
<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$/baseuse" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/baseuse/check_gsjd.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
</configuration>
<configuration name="check_zcjd" type="PythonConfigurationType" factoryName="Python" temporary="true">
<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$/baseuse" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/baseuse/check_zcjd.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
</configuration>
<configuration name="conn_database" type="PythonConfigurationType" factoryName="Python" temporary="true">
<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$/baseuse" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/baseuse/conn_database.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
</configuration>
<configuration default="true" type="Tox" factoryName="Tox">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<module name="znfz_test1" />
</configuration>
<configuration default="true" type="tests" factoryName="Twisted Trial">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
</configuration>
<configuration default="true" type="tests" factoryName="Unittests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
</configuration>
<configuration default="true" type="tests" factoryName="Doctests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="FOLDER_NAME" value="" />
<option name="TEST_TYPE" value="TEST_SCRIPT" />
<option name="PATTERN" value="" />
<option name="USE_PATTERN" value="false" />
</configuration>
<configuration default="true" type="tests" factoryName="Nosetests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="_new_regexPattern" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
</configuration>
<configuration name="py.test for test_login.test_login" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/test_cases" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_login.test_login&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
</configuration>
<configuration name="py.test in test_login.py" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/test_cases" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="znfz_test1" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/test_cases/test_login.py&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
</configuration>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="Python tests.py.test in test_login.py" />
<item index="1" class="java.lang.String" itemvalue="Python tests.py.test for test_login.test_login" />
<item index="2" class="java.lang.String" itemvalue="Python.check_gsjd" />
<item index="3" class="java.lang.String" itemvalue="Python.check_zcjd" />
<item index="4" class="java.lang.String" itemvalue="Python.conn_database" />
</list>
<recent_temporary>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="Python tests.py.test in test_login.py" />
<item index="1" class="java.lang.String" itemvalue="Python.conn_database" />
<item index="2" class="java.lang.String" itemvalue="Python.check_gsjd" />
<item index="3" class="java.lang.String" itemvalue="Python.check_zcjd" />
<item index="4" class="java.lang.String" itemvalue="Python tests.py.test for test_login.test_login" />
</list>
</recent_temporary>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="c46002cb-eb9f-460f-aaf0-13a229cc306b" name="默认的" comment="" />
<created>1590649671986</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1590649671986</updated>
</task>
<servers />
</component>
<component name="TestHistory">
<history-entry file="py_test_for_test_login_test_login - 2020.06.01 at 10h 35m 20s.xml">
<configuration name="py.test for test_login.test_login" configurationId="tests" />
</history-entry>
<history-entry file="py_test_for_test_login_test_login - 2020.06.01 at 10h 39m 18s.xml">
<configuration name="py.test for test_login.test_login" configurationId="tests" />
</history-entry>
<history-entry file="py_test_for_test_login_test_login - 2020.06.01 at 17h 52m 04s.xml">
<configuration name="py.test for test_login.test_login" configurationId="tests" />
</history-entry>
<history-entry file="py_test_for_test_login_test_login2 - 2020.06.01 at 10h 58m 05s.xml">
<configuration name="py.test for test_login.test_login2" configurationId="tests" />
</history-entry>
<history-entry file="py_test_in_test_login_py - 2020.06.01 at 10h 55m 53s.xml">
<configuration name="py.test in test_login.py" configurationId="tests" />
</history-entry>
<history-entry file="py_test_in_test_login_py - 2020.06.01 at 18h 41m 36s.xml">
<configuration name="py.test in test_login.py" configurationId="tests" />
</history-entry>
<history-entry file="py_test_in_test_login_py - 2020.06.01 at 18h 47m 13s.xml">
<configuration name="py.test in test_login.py" configurationId="tests" />
</history-entry>
<history-entry file="py_test_in_test_login_py - 2020.06.02 at 10h 11m 47s.xml">
<configuration name="py.test in test_login.py" configurationId="tests" />
</history-entry>
<history-entry file="py_test_in_test_login_py - 2020.06.10 at 14h 15m 14s.xml">
<configuration name="py.test in test_login.py" configurationId="tests" />
</history-entry>
<history-entry file="py_test_in_test_login_py - 2020.06.10 at 14h 19m 46s.xml">
<configuration name="py.test in test_login.py" configurationId="tests" />
</history-entry>
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="1358" y="-8" width="1936" height="1056" extended-state="7" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32843137" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="调试" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.21343446" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="运行" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35947713" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19669509" sideWeight="0.4914842" order="0" side_tool="false" content_ui="combo" />
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24962178" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24962178" sideWeight="0.50851583" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="找到" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="2" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/test_cases/test_login.py" />
<entry file="file://$PROJECT_DIR$/basepage/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/basepage/read_config.py" />
<entry file="file://$PROJECT_DIR$/basepage/check_gsjd.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="342">
<caret line="22" column="0" lean-forward="true" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/check_zcjd.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="18" column="13" lean-forward="false" selection-start-line="18" selection-start-column="8" selection-end-line="19" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/logger.py" />
<entry file="file://$PROJECT_DIR$/config/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="15" column="9" lean-forward="true" selection-start-line="15" selection-start-column="9" selection-end-line="15" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test_cases/pytest.ini" />
<entry file="file://$PROJECT_DIR$/basepage/conn_database.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="456">
<caret line="25" column="0" lean-forward="true" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test_cases/test_login.py" />
<entry file="file://$PROJECT_DIR$/config/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="52" lean-forward="false" selection-start-line="0" selection-start-column="52" selection-end-line="0" selection-end-column="52" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/framework/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/framework/readConfig.py" />
<entry file="file://$PROJECT_DIR$/test_cases/test_login.py" />
<entry file="file://$PROJECT_DIR$/framework/readConfig.py" />
<entry file="file://$PROJECT_DIR$/config/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="52" lean-forward="false" selection-start-line="0" selection-start-column="52" selection-end-line="0" selection-end-column="52" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/framework/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/test_cases/test_login.py" />
<entry file="file://$PROJECT_DIR$/framework/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/config/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="171">
<caret line="9" column="9" lean-forward="false" selection-start-line="9" selection-start-column="9" selection-end-line="9" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/config.py" />
<entry file="file://$PROJECT_DIR$/test_cases/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/../test01/module.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/framework/readConfig.py" />
<entry file="file://$PROJECT_DIR$/framework/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/framework/read_Config.py" />
<entry file="file://$PROJECT_DIR$/framework/__init__.py" />
<entry file="file://$PROJECT_DIR$/test_cases/py.ini" />
<entry file="file://$PROJECT_DIR$/baseuse/end_database.py" />
<entry file="file://$PROJECT_DIR$/basepage/logger.py" />
<entry file="file://$PROJECT_DIR$/basepage/read_config.py" />
<entry file="file://$PROJECT_DIR$/basepage/check_papers.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test_cases/pytest.ini" />
<entry file="file://$PROJECT_DIR$/test_cases/test_gsjd.py" />
<entry file="file://$PROJECT_DIR$/test_cases/test_login.py" />
<entry file="file://$PROJECT_DIR$/.pytest_cache/README.md" />
<entry file="file://$PROJECT_DIR$/test_cases/test_main.py" />
<entry file="file://$PROJECT_DIR$/.pytest_cache/CACHEDIR.TAG" />
<entry file="file://$PROJECT_DIR$/basepage/browser_engine.py" />
<entry file="file://$PROJECT_DIR$/tests/test_cases/report.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-5543">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/logs/20200813.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="456">
<caret line="24" column="0" lean-forward="true" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/check_gsjd.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="19">
<caret line="17" column="25" lean-forward="false" selection-start-line="17" selection-start-column="25" selection-end-line="17" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/check_transaction_processing.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/check_zcjd.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="18" column="13" lean-forward="false" selection-start-line="18" selection-start-column="8" selection-end-line="19" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/conn_database.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="266">
<caret line="15" column="12" lean-forward="true" selection-start-line="15" selection-start-column="12" selection-end-line="15" selection-end-column="12" />
<folding>
<marker date="1597212332000" expanded="true" signature="180:254" ph="select jsond... znfz_wsst_nlp" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/check_results.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/basepage/check_base_facts.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/test_cases/pytest.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/engine/browser_engine.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="171">
<caret line="11" column="43" lean-forward="true" selection-start-line="11" selection-start-column="43" selection-end-line="11" selection-end-column="43" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/test_cases/test_login.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-790">
<caret line="59" column="49" lean-forward="true" selection-start-line="59" selection-start-column="49" selection-end-line="59" selection-end-column="49" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.6 " jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PackageRequirementsSettings">
<option name="requirementsPath" value="" />
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="py.test" />
<option name="PROJECT_TEST_RUNNER" value="py.test" />
</component>
</module>
\ No newline at end of file
from .browser_engine import BrowserEngine
import os
def get_engine(file, url):
def inner(f):
def wapper(*args, **kwargs):
try:
if file:
log_name = os.path.split(file)[-1].split(".")[0]
engine = BrowserEngine(log_name, url)
else:
engine = BrowserEngine(url=url)
ret = f(engine, *args, **kwargs)
if engine.driver: engine.driver.quit()
if engine: del engine
return ret
except Exception as e:
print(e)
return wapper
return inner
import sys
import time
from basepage.browser_engine import BrowserEngine
from basepage.logger import Logger
from basepage.read_config import ReadConfig
class CheckGsjd(BrowserEngine):
__log_name = 'check_gsjd'
def __init__(self, log_name=__log_name):
super().__init__(log_name)
self._driver = self.login_znfz()
# 选择审查起诉
def choose_gsjd(self):
# tags = driver.find_element_by_xpath('/html/body/div[1]/div/section/aside/div/ul/li[3]/a/span')
tags = self._driver.find_element_by_xpath('/html/body/div[1]/div/section/aside/div/ul/li[3]')
# print(tags.text)
self.logger.info("tags.text:%s" % tags.text)
tags.click()
time.sleep(10)
return self._driver
# 选择审查起诉案件
# def choose_gsjd_case(self):
# caseId = self.get_caseId('caseId')
# self.logger.info("the caseId : %s" % caseId)
# # driver.find_element_by_xpath('/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[1]/form/div[1]/div[3]/input').send_keys(caseId)
# self._driver.find_element_by_xpath('//*[@id="ajmc"]').send_keys(caseId)
# # 点击按钮
# self._driver.find_element_by_xpath(
# '/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[1]/form/div[2]/div/button[2]').click()
# time.sleep(5)
# # 点击办理
# tags = self._driver.find_element_by_xpath(
# '/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[2]/div[2]/div/div/div/div/div/div[2]/table/tbody/tr/td[7]/p/a')
# # print(tags.text)
# self.logger.info("tags.text:%s" % tags.text)
# tags.click()
# driver.find_element_by_tag_name(tags.text).click()
# if __name__ == '__main__':
# test = CheckGsjd()
# driver = test.choose_gsjd()
# test.choose_gsjd_case(driver)
# '''
# conf = ReadConfig()
# caseId = conf.get_caseId('caseId')
# logger.info("the caseId : %s" % caseId)
# # driver.find_element_by_xpath('/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[1]/form/div[1]/div[3]/input').send_keys(caseId)
# driver.find_element_by_xpath('//*[@id="ajmc"]').send_keys(caseId)
# # 点击按钮
# driver.find_element_by_xpath(
# '/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[1]/form/div[2]/div/button[2]').click()
# # 点击办理
# #tags = driver.find_element_by_xpath('/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[2]/div[2]/div/div/div/div/div/div[2]/table/tbody/tr/td[7]/p/a')
# time.sleep(5)
# tags = driver.find_element_by_xpath('/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div[2]/div[2]/div/div/div/div/div/div[2]/table/tbody/tr/td[3]/p/span')
# print(tags.text)
# tags.click()
# #links = driver.find_element_by_tag_name("办理")
# #print(links.text)
# #tags.click()
# #print (tags.text)
# #tags.click()
# '''
import sys
import time
from basepage.browser_engine import BrowserEngine
from basepage.logger import Logger
logger = Logger(logger="check_zcjd").getlog()
class CheckZcjd:
#选择审查逮捕
def choose_zcjd(self):
browser = BrowserEngine()
driver = browser.login_znfz()
tags = driver.find_element_by_xpath('/html/body/div[1]/div/section/aside/div/ul/li[2]/a/span')
#print(tags.text)
logger.info("tags.text;%s" % tags.text)
tags.click()
time.sleep(10)
if __name__ == '__main__':
test = CheckZcjd()
test.choose_zcjd()
\ No newline at end of file
import psycopg2
import json
conn = psycopg2.connect(database = 'cmrobot',user = 'cmrobot', password = 'cmrobot',host = '192.168.2.31',port = '5432')
curs = conn.cursor()
sql = "select jsondata from znfz_wsst_nlp where bmsah = '瓯检起诉受[2020]33030401160号'"
curs.execute(sql)
data = curs.fetchall()
print("python原始数据:",data)
print(type(data))
curs.close()
conn.close()
# this is config file, only store browser type and server URL
[browserType]
#browserName = Firefox
browserName = Chrome
#browserName = IE
[testUrl]
#URL = https://www.baidu.com
;URL = http://192.168.2.31/cm
URL = http://2u8997d500.zicp.vip:46630/cm
JBAQ_URL = http://2u8997d500.zicp.vip:46630/cm/currencydeal/{bmsah}/case?bmsah={bmsah}
SCJL_URL = http://2u8997d500.zicp.vip:46630/cm/currencydeal/{bmsah}/conclusion?bmsah={bmsah}&stage=GS&tysah=33030420200123700&ysay={ysay}
BD_URL = http://www.baidu.com
;JBAQ_URL = http://192.168.2.31/cm/currencydeal/{bmsah}/case?bmsah={bmsah}
[userInfo]
username=周朝阳
password=qazwsxedc
[dataBase]
ip=192.168.2.31
port=5432
user=cmrobot
pasword=cmrobot
database=cmrobot
#起诉案件
[gsjdCase]
#考虑循环
# 盗窃罪
caseId_dqz=瓯检起诉受[2020]33030400557号
# 故意伤害罪
caseId_gyshz=瓯检起诉受[2020]33030400881号
caseName=陈小秋诈骗案
from engine.browser_engine import BrowserEngine
from engine.read_config import ReadConfig
from engine.logger import Logger
import os,time
def get_engine(file, url):
def inner(f):
def wapper(*args, **kwargs):
try:
start_time = time.time()
log_name = os.path.split(file)[-1].split(".")[0]
image_path = os.path.join(os.path.dirname(os.path.dirname(file)), "images")
image_path = os.path.join(image_path, log_name)
image_path += '.png'
engine = BrowserEngine(image_path, log_name, url.upper())
ret = f(engine, *args, **kwargs)
end_time = time.time()
engine.logger.info(f'执行时间:{end_time-start_time}s')
if engine: del engine
return ret
except Exception as e:
print(e)
return wapper
return inner
# -*- coding:utf-8 -*-
from selenium import webdriver
from engine.read_config import ReadConfig
import time, os, re
class BrowserEngine(ReadConfig):
__log_name = "browser_engine"
def __init__(self, image_path, log_name=__log_name, url='URL'):
super().__init__(log_name)
# self.__logger = super().get_logger()
self._log_name = log_name
self._browser = ''
self.url = url
self._driver_path = r"D:\mywork\autotest\znfz_autotest-develop_gt\driver\chromedriver.exe"
self.image_path = image_path
self.driver = webdriver.Chrome(self._driver_path)
self.open_browser()
self.login_znfz()
self.format_url()
self.driver.xpath = self.driver.find_elements_by_xpath
def open_browser(self):
browser = self.get_browserType('browserName')
url = self.get_testUrl('URL')
self.logger.info("browserName: %s" % browser)
# driver = webdriver.Chrome(r"C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe")
self.driver.get(url)
self.logger.info("Open url: %s" % url)
time.sleep(1)
self.driver.maximize_window()
self.logger.info("Maximize the current window.")
self.driver.implicitly_wait(10)
self.logger.info("Set implicitly wait 10 seconds.")
return self.driver
def login_znfz(self):
if self.url == 'LOGIN':
return
username = self.get_userInfo('username')
password = self.get_userInfo('password')
self.logger.info("username: %s" % username)
# logger.info(string.Formatter("username: %s, password: %s, open url: %s", username, password, url))
# logger.info("password :%s" % password)
# logger.info("Open url: %s" % url)
tags = self.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[1]/div/div/span/span/span')
self.logger.info("tags.text:%s" % tags.text)
# print(tags.text)
tags.click()
time.sleep(1)
self.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/span[1]').click()
tags2 = self.driver.find_element_by_xpath(
'//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/ul/li[3]/span[2]/span')
self.logger.info("tags2.text:%s" % tags2.text)
# print(tags2.text)
tags2.click()
time.sleep(1)
self.driver.find_element_by_xpath('//*[@id="username"]').send_keys(username)
self.driver.find_element_by_xpath('//*[@id="password"]').send_keys(password)
self.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[4]/div/div/span/button').click()
return self.driver
def format_url(self):
url = self.get_testUrl(self.url)
if '{' in url:
self.daoqiezui_url = url.format(bmsah=self.get_caseId('caseId_dqz'),ysay='盗窃罪')
self.guyishanghaizui_url = url.format(bmsah=self.get_caseId('caseId_gyshz'),ysay='故意伤害罪')
self.DQZ = self.daoqiezui_url
self.GYSHZ = self.guyishanghaizui_url
def get_page(self,url):
self.logger.info("the testUrl : %s" % url)
self.driver.get(url)
# def load_image(self):
# print(self.image_path)
# image_dir, image_name = os.path.split(self.image_path)
# image_list = os.listdir(image_dir)
# if image_name in image_list:
# image_name_list = list(filter(lambda x: re.findall(image_name + r'-\d{1,}\.png', x), image_list))
# image_name_index_list = list(map(lambda x: int(x.split('-|.')[-2]) if '-' in x else 0, image_name_list))
# next_image_name_index = max(image_name_index_list) + 1 if image_name_index_list else 1
# next_image_name = os.path.join(image_dir, image_name.replace('.png', f'-{next_image_name_index}.png'))
# else:
# next_image_name = self.image_path
# print(next_image_name)
# self.driver.get_screenshot_as_file(next_image_name)
def __del__(self):
try:
self.driver.quit()
except:
pass
'''
if __name__ == '__main__':
cls = BrowserEngine()
test = cls.open_browser()
time.sleep(3)
test.quit()
'''
import os.path
import logging
import time
class Logger(object):
def __init__(self, log_name, *args, **kwargs):
super().__init__(*args, **kwargs)
self.log_name = log_name
self.logger = logging.getLogger(log_name)
self.logger.handlers = []
self.init_logger()
def init_logger(self):
self.logger.setLevel(logging.DEBUG)
rq = time.strftime('%Y%m%d', time.localtime(time.time()))
log_path = os.path.dirname(os.path.abspath('..')) + '/logs/'
log_name = log_path + rq + '.log'
fh = logging.FileHandler(log_name)
fh.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter(f'[%(asctime)s] - [%(levelname)7s] - [%(name){max(len(self.log_name),15)}s] - [%(filename)20s] - [%(lineno)4s] - %(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
self.logger.addHandler(fh)
self.logger.addHandler(ch)
def get_logger(self):
return self.logger
import os
import configparser
from engine.logger import Logger
'''
proDir = os.path.split(os.path.realpath(__file__))[0]
print(proDir)
configPath = os.path.join(proDir, "config.ini")
print(configPath)
'''
# logger = logging.getLogger('read_config')
class ReadConfig(Logger):
__log_name = 'read_config'
def __init__(self, log_name=__log_name):
super().__init__(log_name)
self._configPath = ''
self.join_config_path()
self.cf = configparser.ConfigParser()
self.cf.read(self._configPath, encoding="utf-8-sig")
def join_config_path(self):
# proDir = os.path.dirname(os.path.abspath('.'))
self._configPath = os.path.dirname(os.path.abspath('..')) + r'\config\config.ini'
self.logger.info("the configPath: %s" % self._configPath)
def get_browserType(self, param):
value = self.cf.get("browserType", param)
self.logger.info("the browserType : %s" % value)
return value
def get_testUrl(self, param):
value = self.cf.get("testUrl", param)
# self.logger.info("the testUrl : %s" % value)
return value
def get_userInfo(self, param):
value = self.cf.get("userInfo", param)
self.logger.info("the userInfo : %s" % value)
return value
def get_caseId(self, param):
value = self.cf.get("gsjdCase", param)
self.logger.info("the gsjdCase : %s" % value)
return value
'''
if __name__ == '__main__':
test = ReadConfig()
browser = test.get_browserType('browserName')
username = test.get_userInfo('username')
password = test.get_userInfo('password')
print(browser,username,password)
'''
2020-06-10 15:22:08,642 - read_config - INFO - the configPath: D:\mywork\autotest\znfz_autotest\config\config.ini
2020-06-10 15:22:08,664 - read_config - INFO - the userInfo : 周朝阳
2020-06-10 15:22:08,664 - read_config - INFO - the userInfo : qazwsxedc
2020-06-10 15:22:08,664 - read_config - INFO - the testUrl : http://192.168.2.31/cm
2020-06-10 15:22:08,665 - browser_engine - INFO - username: 周朝阳
2020-06-10 15:22:08,666 - read_config - INFO - the browserType : Chrome
2020-06-10 15:22:08,666 - read_config - INFO - the testUrl : http://192.168.2.31/cm
2020-06-10 15:22:08,667 - browser_engine - INFO - browserName: Chrome
2020-06-10 15:22:44,094 - browser_engine - INFO - Open url: http://192.168.2.31/cm
2020-06-10 15:22:51,233 - browser_engine - INFO - Maximize the current window.
2020-06-10 15:22:51,235 - browser_engine - INFO - Set implicitly wait 10 seconds.
2020-06-10 15:22:51,280 - browser_engine - INFO - tags.text:请选择所属部门
2020-06-10 15:22:52,624 - browser_engine - INFO - tags2.text:瓯海区院
2020-06-10 15:23:01,896 - check_gsjd - INFO - tags.text:审查起诉
2020-06-10 15:23:12,050 - read_config - INFO - the gsjdCase : 33030401160
2020-06-10 15:23:12,050 - check_gsjd - INFO - the caseId : 33030401160
2020-06-10 15:23:17,670 - check_gsjd - INFO - tags.text:办理
[2020-08-13 09:14:52,755] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:14:52,795] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:14:52,801] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:15,618] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:15,626] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:15,635] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,791] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,801] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,808] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,815] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,823] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,829] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,837] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,844] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,856] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,862] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,867] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,874] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,880] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,886] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,892] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,898] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,905] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,911] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,917] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,923] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,929] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,935] - [ INFO] - [ test_jbaq] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,942] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,948] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,954] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,961] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,970] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,977] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,984] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,990] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:27,996] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,002] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,008] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,013] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,020] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,027] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,035] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,042] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,047] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,053] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 09:16:28,058] - [ INFO] - [ test_scjl] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:09:06,521] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:09:06,534] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:09:06,544] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:13:13,804] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:13:17,740] - [ INFO] - [ test_login] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-08-13 17:13:17,741] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-08-13 17:13:31,663] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-08-13 17:13:34,814] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-08-13 17:13:34,819] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
[2020-08-13 17:13:34,826] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:13:40,203] - [ INFO] - [ test_login] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-08-13 17:13:40,203] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-08-13 17:13:57,181] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-08-13 17:14:00,332] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-08-13 17:14:00,336] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
[2020-08-13 17:14:00,341] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-13 17:14:04,155] - [ INFO] - [ test_login] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-08-13 17:14:04,156] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-08-13 17:15:18,050] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-08-13 17:15:21,208] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-08-13 17:15:21,212] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
[2020-08-17 09:39:03,496] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-17 09:39:09,772] - [ INFO] - [ test_login] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-08-17 09:39:09,772] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-08-17 09:39:25,267] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-08-17 09:39:28,414] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-08-17 09:39:28,418] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
[2020-08-17 09:39:28,425] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-17 09:39:33,982] - [ INFO] - [ test_login] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-08-17 09:39:33,982] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-08-17 09:39:46,854] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-08-17 09:39:49,995] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-08-17 09:39:49,998] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
[2020-08-17 09:39:50,002] - [ INFO] - [ test_login] - [ read_config.py] - [ 29] - the configPath: D:\mywork\autotest\znfz_autotest-develop_gt\config\config.ini
[2020-08-17 09:39:53,696] - [ INFO] - [ test_login] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-08-17 09:39:53,697] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-08-17 09:40:06,421] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-08-17 09:40:09,573] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-08-17 09:40:09,577] - [ INFO] - [ test_login] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}
h1 {
font-size: 24px;
color: black;
}
h2 {
font-size: 16px;
color: black;
}
p {
color: black;
}
a {
color: #999;
}
table {
border-collapse: collapse;
}
/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #E6E6E6;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}
/******************************
* TEST RESULT COLORS
******************************/
span.passed, .passed .col-result {
color: green;
}
span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result {
color: orange;
}
span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result {
color: red;
}
/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%
}
#results-table th, #results-table td {
padding: 5px;
border: 1px solid #E6E6E6;
text-align: left
}
#results-table th {
font-weight: bold
}
/*------------------
* 2. Extra
*------------------*/
.log:only-child {
height: inherit
}
.log {
background-color: #e6e6e6;
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
height: 230px;
overflow-y: scroll;
padding: 5px;
white-space: pre-wrap
}
div.image {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px
}
div.image img {
width: 320px
}
div.video {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px
}
div.video video {
overflow: hidden;
width: 320px;
height: 240px;
}
.collapsed {
display: none;
}
.expander::after {
content: " (show details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
.collapser::after {
content: " (hide details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}
.sort-icon {
font-size: 0px;
float: left;
margin-right: 5px;
margin-top: 5px;
/*triangle*/
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.inactive .sort-icon {
/*finish triangle*/
border-top: 8px solid #E6E6E6;
}
.asc.active .sort-icon {
/*finish triangle*/
border-bottom: 8px solid #999;
}
.desc.active .sort-icon {
/*finish triangle*/
border-top: 8px solid #999;
}
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}
h1 {
font-size: 24px;
color: black;
}
h2 {
font-size: 16px;
color: black;
}
p {
color: black;
}
a {
color: #999;
}
table {
border-collapse: collapse;
}
/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #E6E6E6;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}
/******************************
* TEST RESULT COLORS
******************************/
span.passed, .passed .col-result {
color: green;
}
span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result {
color: orange;
}
span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result {
color: red;
}
/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%
}
#results-table th, #results-table td {
padding: 5px;
border: 1px solid #E6E6E6;
text-align: left
}
#results-table th {
font-weight: bold
}
/*------------------
* 2. Extra
*------------------*/
.log:only-child {
height: inherit
}
.log {
background-color: #e6e6e6;
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
height: 230px;
overflow-y: scroll;
padding: 5px;
white-space: pre-wrap
}
div.image {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px
}
div.image img {
width: 320px
}
div.video {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px
}
div.video video {
overflow: hidden;
width: 320px;
height: 240px;
}
.collapsed {
display: none;
}
.expander::after {
content: " (show details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
.collapser::after {
content: " (hide details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}
.sort-icon {
font-size: 0px;
float: left;
margin-right: 5px;
margin-top: 5px;
/*triangle*/
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.inactive .sort-icon {
/*finish triangle*/
border-top: 8px solid #E6E6E6;
}
.asc.active .sort-icon {
/*finish triangle*/
border-bottom: 8px solid #999;
}
.desc.active .sort-icon {
/*finish triangle*/
border-top: 8px solid #999;
}
from selenium import webdriver
import pytest
# driver = None
# @pytest.mark.hookwrapper
# def pytest_runtest_makereport(item):
# """
# Extends the PyTest Plugin to take and embed screenshot in html report, whenever test fails.
# :param item:
# """
# pytest_html = item.config.pluginmanager.getplugin('html')
# outcome = yield
# report = outcome.get_result()
# extra = getattr(report, 'extra', [])
#
# if report.when == 'call' or report.when == "setup":
# xfail = hasattr(report, 'wasxfail')
# if (report.skipped and xfail) or (report.failed and not xfail):
# file_name = report.nodeid.replace("::", "_")+".png"
# _capture_screenshot(file_name)
# if file_name:
# html = '<div><img src="%s" alt="screenshot" style="width:304px;height:228px;" ' \
# 'οnclick="window.open(this.src)" align="right"/></div>' % file_name
# extra.append(pytest_html.extras.html(html))
# report.extra = extra
#
#
# def _capture_screenshot(name):
# driver.get_screenshot_as_file(name)
#
#
# @pytest.fixture(scope='session', autouse=True)
# def browser():
# global driver
# if driver is None:
# driver = webdriver.Firefox()
# return driver
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}
h1 {
font-size: 24px;
color: black;
}
h2 {
font-size: 16px;
color: black;
}
p {
color: black;
}
a {
color: #999;
}
table {
border-collapse: collapse;
}
/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #E6E6E6;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}
/******************************
* TEST RESULT COLORS
******************************/
span.passed, .passed .col-result {
color: green;
}
span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result {
color: orange;
}
span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result {
color: red;
}
/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%
}
#results-table th, #results-table td {
padding: 5px;
border: 1px solid #E6E6E6;
text-align: left
}
#results-table th {
font-weight: bold
}
/*------------------
* 2. Extra
*------------------*/
.log:only-child {
height: inherit
}
.log {
background-color: #e6e6e6;
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
height: 230px;
overflow-y: scroll;
padding: 5px;
white-space: pre-wrap
}
div.image {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px
}
div.image img {
width: 320px
}
div.video {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px
}
div.video video {
overflow: hidden;
width: 320px;
height: 240px;
}
.collapsed {
display: none;
}
.expander::after {
content: " (show details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
.collapser::after {
content: " (hide details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}
.sort-icon {
font-size: 0px;
float: left;
margin-right: 5px;
margin-top: 5px;
/*triangle*/
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.inactive .sort-icon {
/*finish triangle*/
border-top: 8px solid #E6E6E6;
}
.asc.active .sort-icon {
/*finish triangle*/
border-bottom: 8px solid #999;
}
.desc.active .sort-icon {
/*finish triangle*/
border-top: 8px solid #999;
}
[pytest]
;log_format = %(asctime)s %(levelname)s %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
markers= login
select
addxyr
delxyr
nullxyr
gsjd
reset
basicmatter1
basicmatter
lxfz
lxfz1
demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test Report</title>
<link href="assets/style.css" rel="stylesheet" type="text/css"/></head>
<body onLoad="init()">
<script>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
function toArray(iter) {
if (iter === null) {
return null;
}
return Array.prototype.slice.call(iter);
}
function find(selector, elem) {
if (!elem) {
elem = document;
}
return elem.querySelector(selector);
}
function find_all(selector, elem) {
if (!elem) {
elem = document;
}
return toArray(elem.querySelectorAll(selector));
}
function sort_column(elem) {
toggle_sort_states(elem);
var colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
var key;
if (elem.classList.contains('numeric')) {
key = key_num;
} else if (elem.classList.contains('result')) {
key = key_result;
} else {
key = key_alpha;
}
sort_table(elem, key(colIndex));
}
function show_all_extras() {
find_all('.col-result').forEach(show_extras);
}
function hide_all_extras() {
find_all('.col-result').forEach(hide_extras);
}
function show_extras(colresult_elem) {
var extras = colresult_elem.parentNode.nextElementSibling;
var expandcollapse = colresult_elem.firstElementChild;
extras.classList.remove("collapsed");
expandcollapse.classList.remove("expander");
expandcollapse.classList.add("collapser");
}
function hide_extras(colresult_elem) {
var extras = colresult_elem.parentNode.nextElementSibling;
var expandcollapse = colresult_elem.firstElementChild;
extras.classList.add("collapsed");
expandcollapse.classList.remove("collapser");
expandcollapse.classList.add("expander");
}
function show_filters() {
var filter_items = document.getElementsByClassName('filter');
for (var i = 0; i < filter_items.length; i++)
filter_items[i].hidden = false;
}
function add_collapse() {
// Add links for show/hide all
var resulttable = find('table#results-table');
var showhideall = document.createElement("p");
showhideall.innerHTML = '<a href="javascript:show_all_extras()">Show all details</a> / ' +
'<a href="javascript:hide_all_extras()">Hide all details</a>';
resulttable.parentElement.insertBefore(showhideall, resulttable);
// Add show/hide link to each result
find_all('.col-result').forEach(function(elem) {
var collapsed = get_query_parameter('collapsed') || 'Passed';
var extras = elem.parentNode.nextElementSibling;
var expandcollapse = document.createElement("span");
if (extras.classList.contains("collapsed")) {
expandcollapse.classList.add("expander")
} else if (collapsed.includes(elem.innerHTML)) {
extras.classList.add("collapsed");
expandcollapse.classList.add("expander");
} else {
expandcollapse.classList.add("collapser");
}
elem.appendChild(expandcollapse);
elem.addEventListener("click", function(event) {
if (event.currentTarget.parentNode.nextElementSibling.classList.contains("collapsed")) {
show_extras(event.currentTarget);
} else {
hide_extras(event.currentTarget);
}
});
})
}
function get_query_parameter(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function init () {
reset_sort_headers();
add_collapse();
show_filters();
sort_column(find('.initial-sort'));
find_all('.sortable').forEach(function(elem) {
elem.addEventListener("click",
function(event) {
sort_column(elem);
}, false)
});
};
function sort_table(clicked, key_func) {
var rows = find_all('.results-table-row');
var reversed = !clicked.classList.contains('asc');
var sorted_rows = sort(rows, key_func, reversed);
/* Whole table is removed here because browsers acts much slower
* when appending existing elements.
*/
var thead = document.getElementById("results-table-head");
document.getElementById('results-table').remove();
var parent = document.createElement("table");
parent.id = "results-table";
parent.appendChild(thead);
sorted_rows.forEach(function(elem) {
parent.appendChild(elem);
});
document.getElementsByTagName("BODY")[0].appendChild(parent);
}
function sort(items, key_func, reversed) {
var sort_array = items.map(function(item, i) {
return [key_func(item), i];
});
sort_array.sort(function(a, b) {
var key_a = a[0];
var key_b = b[0];
if (key_a == key_b) return 0;
if (reversed) {
return (key_a < key_b ? 1 : -1);
} else {
return (key_a > key_b ? 1 : -1);
}
});
return sort_array.map(function(item) {
var index = item[1];
return items[index];
});
}
function key_alpha(col_index) {
return function(elem) {
return elem.childNodes[1].childNodes[col_index].firstChild.data.toLowerCase();
};
}
function key_num(col_index) {
return function(elem) {
return parseFloat(elem.childNodes[1].childNodes[col_index].firstChild.data);
};
}
function key_result(col_index) {
return function(elem) {
var strings = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed',
'Skipped', 'Passed'];
return strings.indexOf(elem.childNodes[1].childNodes[col_index].firstChild.data);
};
}
function reset_sort_headers() {
find_all('.sort-icon').forEach(function(elem) {
elem.parentNode.removeChild(elem);
});
find_all('.sortable').forEach(function(elem) {
var icon = document.createElement("div");
icon.className = "sort-icon";
icon.textContent = "vvv";
elem.insertBefore(icon, elem.firstChild);
elem.classList.remove("desc", "active");
elem.classList.add("asc", "inactive");
});
}
function toggle_sort_states(elem) {
//if active, toggle between asc and desc
if (elem.classList.contains('active')) {
elem.classList.toggle('asc');
elem.classList.toggle('desc');
}
//if inactive, reset all other functions and add ascending active
if (elem.classList.contains('inactive')) {
reset_sort_headers();
elem.classList.remove('inactive');
elem.classList.add('active');
}
}
function is_all_rows_hidden(value) {
return value.hidden == false;
}
function filter_table(elem) {
var outcome_att = "data-test-result";
var outcome = elem.getAttribute(outcome_att);
class_outcome = outcome + " results-table-row";
var outcome_rows = document.getElementsByClassName(class_outcome);
for(var i = 0; i < outcome_rows.length; i++){
outcome_rows[i].hidden = !elem.checked;
}
var rows = find_all('.results-table-row').filter(is_all_rows_hidden);
var all_rows_hidden = rows.length == 0 ? true : false;
var not_found_message = document.getElementById("not-found-message");
not_found_message.hidden = !all_rows_hidden;
}
</script>
<h1>report.html</h1>
<p>Report generated on 21-Jul-2020 at 14:33:47 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v2.1.1</p>
<h2>Environment</h2>
<table id="environment">
<tr>
<td>Packages</td>
<td>{"pluggy": "0.13.1", "py": "1.8.1", "pytest": "5.4.3"}</td></tr>
<tr>
<td>Platform</td>
<td>Windows-10-10.0.18362-SP0</td></tr>
<tr>
<td>Plugins</td>
<td>{"forked": "1.1.3", "html": "2.1.1", "metadata": "1.9.0", "rerunfailures": "9.0"}</td></tr>
<tr>
<td>Python</td>
<td>3.6.8</td></tr></table>
<h2>Summary</h2>
<p>1 tests ran in 32.80 seconds. </p>
<p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="passed">1 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="failed">0 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span>, <input checked="true" class="filter" data-test-result="rerun" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="rerun">0 rerun</span>
<h2>Results</h2>
<table id="results-table">
<thead id="results-table-head">
<tr>
<th class="sortable result initial-sort" col="result">Result</th>
<th class="sortable" col="name">Test</th>
<th class="sortable numeric" col="duration">Duration</th>
<th>Links</th></tr>
<tr hidden="true" id="not-found-message">
<th colspan="4">No results found. Try to check the filters</th></tr></thead>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">test_gsjd.py::test_reset</td>
<td class="col-duration">32.63</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stderr call------------------------------ <br/>[2020-07-21 14:33:14,508] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 29] - the configPath: C:\Users\80980\znfz_autotest\config\config.ini
[2020-07-21 14:33:17,733] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 33] - the browserType : Chrome
[2020-07-21 14:33:17,733] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 28] - browserName: Chrome
[2020-07-21 14:33:28,583] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 33] - Open url: http://2u8997d500.zicp.vip:46630/cm
[2020-07-21 14:33:31,705] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 36] - Maximize the current window.
[2020-07-21 14:33:31,709] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 38] - Set implicitly wait 10 seconds.
[2020-07-21 14:33:31,709] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 43] - the userInfo : 周朝阳
[2020-07-21 14:33:31,709] - [ INFO] - [ test_gsjd] - [ read_config.py] - [ 43] - the userInfo : qazwsxedc
[2020-07-21 14:33:31,709] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 47] - username: 周朝阳
[2020-07-21 14:33:31,741] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 52] - tags.text:请选择所属部门
[2020-07-21 14:33:32,997] - [ INFO] - [ test_gsjd] - [ browser_engine.py] - [ 61] - tags2.text:瓯海区院
[2020-07-21 14:33:44,925] - [ INFO] - [ test_gsjd] - [ __init__.py] - [ 23] - 执行时间:30.417637825012207s
<br/> -------------------------------Captured log call-------------------------------- <br/>INFO  test_gsjd:read_config.py:29 the configPath: C:\Users\80980\znfz_autotest\config\config.ini
INFO  test_gsjd:read_config.py:33 the browserType : Chrome
INFO  test_gsjd:browser_engine.py:28 browserName: Chrome
INFO  test_gsjd:browser_engine.py:33 Open url: http://2u8997d500.zicp.vip:46630/cm
INFO  test_gsjd:browser_engine.py:36 Maximize the current window.
INFO  test_gsjd:browser_engine.py:38 Set implicitly wait 10 seconds.
INFO  test_gsjd:read_config.py:43 the userInfo : 周朝阳
INFO  test_gsjd:read_config.py:43 the userInfo : qazwsxedc
INFO  test_gsjd:browser_engine.py:47 username: 周朝阳
INFO  test_gsjd:browser_engine.py:52 tags.text:请选择所属部门
INFO  test_gsjd:browser_engine.py:61 tags2.text:瓯海区院
INFO  test_gsjd:__init__.py:23 执行时间:30.417637825012207s<br/></div></td></tr></tbody></table></body></html>
\ No newline at end of file
from engine import get_engine
import pytest,time
@pytest.mark.select
@get_engine(__file__,'URL')
def test_full_select(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
case_id = engine.get_caseId('caseId')
input = engine.driver.xpath("//input[@id='ajmc']")[0]
if input:
input.send_keys(case_id)
else:
engine.logger.error(f'{i}---input元素获取错误')
return
time.sleep(0.5)
select = engine.driver.xpath("//button[@type='submit']")[0]
if select:
select.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
anjian_list = engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr")
assert len(anjian_list) == 1 and anjian_list[0].get_attribute('data-row-key') == case_id
@pytest.mark.select
@get_engine(__file__,'URL')
def test_sub_select(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
case_id = engine.get_caseId('caseId')[11:-2]
input = engine.driver.xpath("//input[@id='ajmc']")[0]
if input:
input.send_keys(case_id)
else:
engine.logger.error(f'{i}---input元素获取错误')
return
time.sleep(0.5)
select = engine.driver.xpath("//button[@type='submit']")[0]
if select:
select.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
anjian_list = engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr")
assert len(anjian_list) == 1 and case_id in anjian_list[0].get_attribute('data-row-key')
@pytest.mark.select
@get_engine(__file__,'URL')
def test_null_select(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
case_id = engine.get_caseId('caseId')[11:-2]
anjian_list = [anjian.get_attribute('data-row-key') for anjian in engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr")]
select = engine.driver.xpath("//button[@type='submit']")[0]
if select:
select.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
new_anjian_list = [anjian.get_attribute('data-row-key') for anjian in engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr")]
assert new_anjian_list == anjian_list
@pytest.mark.select
@get_engine(__file__,'URL')
def test_fullname_select(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
case_name = engine.get_caseId('caseName')
input = engine.driver.xpath("//input[@id='ajmc']")[0]
if input:
input.send_keys(case_name)
else:
engine.logger.error(f'{i}---input元素获取错误')
return
time.sleep(0.5)
select = engine.driver.xpath("//button[@type='submit']")[0]
if select:
select.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
anjian_name = engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr/td/p/span[@class='bg___2A-Dw']")[0].text
assert anjian_name == case_name
@pytest.mark.select
@get_engine(__file__,'URL')
def test_subname_select(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
case_name = engine.get_caseId('caseName')[:3]
input = engine.driver.xpath("//input[@id='ajmc']")[0]
if input:
input.send_keys(case_name)
else:
engine.logger.error(f'{i}---input元素获取错误')
return
time.sleep(0.5)
select = engine.driver.xpath("//button[@type='submit']")[0]
if select:
select.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
anjian_name = engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr/td/p/span[@class='bg___2A-Dw']")[0].text
assert case_name in anjian_name
@pytest.mark.select
@get_engine(__file__,'URL')
def test_errname_select(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
# case_name = engine.get_caseId('caseName')[:3]
input = engine.driver.xpath("//input[@id='ajmc']")[0]
if input:
input.send_keys('aaa')
else:
engine.logger.error(f'{i}---input元素获取错误')
return
time.sleep(0.5)
select = engine.driver.xpath("//button[@type='submit']")[0]
if select:
select.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
anjian_name = engine.driver.xpath("//tbody[@class='ant-table-tbody']/tr")
assert anjian_name ==[]
@pytest.mark.reset
@get_engine(__file__,'URL')
def test_reset(engine):
for i in ['审查逮捕','审查起诉']:
scdb = engine.driver.xpath(f"//span[text()='{i}']/..")[0]
if scdb:
scdb.click()
else:
engine.logger.error(f'{i}元素获取错误')
return
# 办理阶段
select_button1 = engine.driver.xpath("//div[@id='zt']")[0]
if select_button1:
select_button1.click()
else:
engine.logger.error(f'{i}---办理阶段-元素获取错误')
return
time.sleep(0.5)
subselect_button1 = engine.driver.xpath("//li[text()='未结']")[0]
if subselect_button1:
subselect_button1.click()
else:
engine.logger.error(f'{i}---办理阶段-元素获取错误')
return
time.sleep(0.5)
# 移动案由
select_button2 = engine.driver.xpath("//div[@id='ysay']")[0]
if select_button2:
select_button2.click()
else:
engine.logger.error(f'{i}---移送案由-元素获取错误')
return
time.sleep(0.5)
subselect_button2 = engine.driver.xpath("//li[text()='盗窃罪']")[0]
if subselect_button2:
subselect_button2.click()
else:
engine.logger.error(f'{i}---移送案由-元素获取错误')
return
time.sleep(0.5)
reset = engine.driver.xpath("//button[@type='submit']")[0]
if reset:
reset.click()
else:
engine.logger.error(f'{i}---select元素获取错误')
return
time.sleep(1)
engine.driver.xpath("//span[text()='重 置']/..")[0].click()
time.sleep(0.5)
select_button1 = engine.driver.xpath("//div[@id='zt']//div[@class='ant-select-selection-selected-value']")[0].text
select_button2 = engine.driver.xpath("//div[@id='ysay']//div[@class='ant-select-selection-selected-value']")[0].text
assert select_button1 == '全部'
assert select_button2 == '全部'
'''
基本案情-基本情况
'''
import pytest,time
from engine import get_engine
@pytest.mark.addxyr
@get_engine(__file__,'JBAQ_URL')
def test_addxyr(engine):
# engine.init()
# basic_url = engine.get_testUrl('JBAQ_URL')
# case_id = engine.get_caseId('caseId')
# url = basic_url.format(bmsah=case_id)
# engine.driver.get(url)
engine.get_page(engine.DQZ)
xyr_add = engine.driver.xpath("//div[@class='plus___1ckgY']")
if not xyr_add:
engine.logger.info('没有基本信息!!查看具体情况')
exit(-1)
return
xyr_add = xyr_add[0]
xyr_list = engine.driver.xpath("//div[contains(@class,'item___2HoCU')]")
# 添加犯罪嫌疑人
xyr_add.click()
engine.logger.info('点击添加嫌疑人')
time.sleep(1)
new_xyr_list = engine.driver.xpath("//div[contains(@class,'item___2HoCU')]")
xyr_name = engine.driver.xpath("//div[@title='犯罪嫌疑人姓名']/following-sibling::div[1]//input")[0].get_attribute('value')
assert len(new_xyr_list) - len(xyr_list) == 1 and xyr_name == '','嫌疑人数+1'
# 再加一个
xyr_add.click()
engine.logger.info('点击添加嫌疑人')
time.sleep(1)
new_xyr_list = engine.driver.xpath("//div[contains(@class,'item___2HoCU')]")
xyr_name = engine.driver.xpath("//div[@title='犯罪嫌疑人姓名']/following-sibling::div[1]//input")[0].get_attribute('value')
assert len(new_xyr_list) - len(xyr_list) == 2 and xyr_name == '','嫌疑人数+2'
@pytest.mark.delxyr
@get_engine(__file__,'JBAQ_URL')
def test_addxyr(engine):
engine.get_page(engine.DQZ)
xyr_list = engine.driver.xpath("//div[contains(@class,'item___2HoCU')]")
xyr_last = xyr_list[-1]
# 删除犯罪嫌疑人
xyr_last.click()
engine.logger.info('点击最后一个嫌疑人')
xyr_del = engine.driver.xpath("//div[@class='item___2HoCU active___2SHXM']/a[contains(@class,'delete___3-b3m')]")[0]
xyr_del.click()
engine.logger.info('点击X')
time.sleep(0.5)
# 点击否
xyr_del_false = engine.driver.xpath("//div[@class='ant-popover-buttons']/button[@class='ant-btn ant-btn-sm']")[0]
xyr_del_false.click()
engine.logger.info('点击否')
time.sleep(0.5)
new_xyr_list = engine.driver.xpath("//div[contains(@class,'item___2HoCU')]")
assert len(xyr_list) == len(new_xyr_list),'嫌疑人数不变'
xyr_last.click()
xyr_del.click()
engine.logger.info('点击X')
time.sleep(0.5)
# 点击是
xyr_del_true = engine.driver.xpath("//div[@class='ant-popover-buttons']/button[@class='ant-btn ant-btn-primary ant-btn-sm']")[0]
xyr_del_true.click()
engine.logger.info('点击是')
time.sleep(1)
new_xyr_list = engine.driver.xpath("//div[contains(@class,'item___2HoCU')]")
assert len(xyr_list) - len(new_xyr_list) == 1,'嫌疑人数-1'
@pytest.mark.nullxyr
@get_engine(__file__,'JBAQ_URL')
def test_null_xyr(engine):
engine.get_page(engine.DQZ)
# js = '''document.querySelector("#起诉意见书_犯罪嫌疑人_0_犯罪嫌疑人姓名").value = "";'''
# engine.driver.execute_script(js)
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_犯罪嫌疑人姓名']")[0].clear()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__,'JBAQ_URL')
def test_nullbirth(engine):
engine.get_page(engine.DQZ)
time.sleep(0.5)
# js = '''document.querySelector("//div[@title='出生日期']/following-sibling::div[1]//input").value = "";'''
# engine.driver.execute_script(js)
engine.driver.xpath("//div[@title='出生日期']/following-sibling::div[1]//input")[0].clear()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(3.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_nullID(engine):
engine.get_page(engine.DQZ)
time.sleep(0.5)
# js = '''document.querySelector("#起诉意见书_犯罪嫌疑人_0_身份证号码").value="";'''
# engine.driver.execute_script(js)
# js = '''document.querySelector("//input[@id='起诉意见书_犯罪嫌疑人_0_身份证号码']").value = "";'''
# # engine.driver.execute_script(js)
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_身份证号码']")[0].clear()
time.sleep(2.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
assert len(message) == 1
# @pytest.mark.basicmatter # todo
# @get_engine(__file__, 'JBAQ_URL')
# def test_nulledu(engine):
# engine.driver.xpath("//div[@id='起诉意见书_犯罪嫌疑人_0_文化程度']")[0].clear()
# time.sleep(0.5)
# save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
# save_button.click()
# time.sleep(0.5)
# message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
# assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_notnulledu(engine):
engine.get_page(engine.DQZ)
engine.driver.xpath("//div[@id='起诉意见书_犯罪嫌疑人_0_文化程度']")[0].click()
engine.driver.xpath("//li[@data='小学']")[0].click()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_nullDomicile(engine):
engine.get_page(engine.DQZ)
# js = '''document.querySelector("//input[@id='起诉意见书_犯罪嫌疑人_0_户籍所在地']").value = "";'''
# engine.driver.execute_script(js)
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_户籍所在地']")[0].clear()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_notnullDomicile(engine):
engine.get_page(engine.DQZ)
input = engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_户籍所在地']")[0]
input.clear()
input.send_keys('123')
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_nulladdr(engine):
engine.get_page(engine.DQZ)
# js = '''document.querySelector("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']").value = "";'''
# engine.driver.execute_script(js)
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']")[0].clear()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_notnulladdr(engine):
engine.get_page(engine.DQZ)
input = engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']")[0]
input.clear()
input.send_keys('123')
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
# @pytest.mark.nullSpecifPerson # todo
# @get_engine(__file__, 'JBAQ_URL')
# def test_null_xyr(engine):
# # engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']")[0].clear().send_keys('123')
# time.sleep(0.5)
# save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
# save_button.click()
# time.sleep(0.5)
# message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
# assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_notnullSpecifPerson(engine):
engine.get_page(engine.DQZ)
engine.driver.xpath("//div[@id='起诉意见书_犯罪嫌疑人_0_特定人员']")[0].click()
engine.driver.xpath("//li[@data='聋哑人']")[0].click()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
# @pytest.mark.nullSpecialID # todo
# @get_engine(__file__, 'JBAQ_URL')
# def test_null_xyr(engine):
# # engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_特殊身份']")[0].clear().send_keys('123')
# time.sleep(0.5)
# save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
# save_button.click()
# time.sleep(0.5)
# message = engine.driver.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
# assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_notnullSpecialID(engine):
engine.get_page(engine.DQZ)
engine.driver.xpath("//div[@id='起诉意见书_犯罪嫌疑人_0_特殊身份']")[0].click()
engine.driver.xpath("//li[@data='国家工作人员']")[0].click()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_nullFilingTime(engine):
engine.get_page(engine.DQZ)
# js = '''document.querySelector("//div[@title='立案时间']/following-sibling::div[1]//input").value = "";'''
# engine.driver.execute_script(js)
engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear()
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_IncorrectFormatFilingTime(engine): # 立案时间为空
engine.get_page(engine.DQZ)
input =engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0]
input.clear()
input.send_keys('5月5日')
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[text()='日期格式不正确!']")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_correctFormatFilingTime(engine): # 立案时间格式于标准不一致
engine.get_page(engine.DQZ)
input = engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0]
input.clear()
input.send_keys('2020年05月05日')
time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_nullmeasure(engine): # 强制措施为空
engine.get_page(engine.DQZ)
# js = '''document.querySelector("#起诉意见书_犯罪嫌疑人_0_当前强制措施情况_案情摘要").value="";'''
# engine.driver.execute_script(js)
input = engine.driver.xpath("//textarea[@id='起诉意见书_犯罪嫌疑人_0_当前强制措施情况_案情摘要']")[0]
input.click()
input.clear()
time.sleep(3.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
# @pytest.mark.basicmatter
# @get_engine(__file__, 'JBAQ_URL')
# def test_fzjlRetract(engine): # 犯罪经历收起
# pass
# engine.driver.xpath("//div[text()='犯罪经历']/following-sibling::div[1]//a[@class='toggleTrigger___2NjVY']")[0].click()
# time.sleep(0.5)
# save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
# save_button.click()
# time.sleep(0.5)
# message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
# assert len(message) == 1
import pytest
import time
import sys
# sys.path.append('../..')
from engine import get_engine
project_name = "TestLogin"
# logger = Logger(project_name).get_logger()
'''
def setup_function():
print('setup_function:每个用例开始前都会执行')
def teardown_function():
print('teardown_function:每个用例结束后都会执行')
'''
@pytest.mark.login
@get_engine(__file__, 'LOGIN')
def test_login(engine):
username = engine.get_userInfo('username')
password = engine.get_userInfo('password')
url = engine.get_testUrl('URL')
print(username, password, url)
engine.logger.info("username: %s" % username)
engine.logger.info("password :%s" % password)
engine.logger.info("Open url: %s" % url)
tags = engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[1]/div/div/span/span/span')
# print(tags.text)
engine.logger.info("tags.text:%s" % tags.text)
tags.click()
time.sleep(1)
engine.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/span[1]').click()
tags2 = engine.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/ul/li[3]/span[2]/span')
# print(tags2.text)
engine.logger.info("tags2.text:%s" % tags2.text)
tags2.click()
time.sleep(1)
engine.driver.find_element_by_xpath('//*[@id="username"]').send_keys(username)
engine.driver.find_element_by_xpath('//*[@id="password"]').send_keys(password)
engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[4]/div/div/span/button').click()
time.sleep(2)
# engine.driver.quit()
@pytest.mark.login
@get_engine(__file__, 'LOGIN')
def test_login_pwerr(engine):
username = engine.get_userInfo('username')
password = engine.get_userInfo('password')
url = engine.get_testUrl('URL')
# print(username, password, url)
engine.logger.info("username: %s" % username)
engine.logger.info("password :%s" % password)
engine.logger.info("Open url: %s" % url)
# driver = engine.driver
tags = engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[1]/div/div/span/span/span')
# print(tags.text)
engine.logger.info("tags.text:%s" % tags.text)
tags.click()
time.sleep(1)
engine.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/span[1]').click()
tags2 = engine.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/ul/li[3]/span[2]/span')
# print(tags2.text)
engine.logger.info("tags2.text:%s" % tags2.text)
tags2.click()
time.sleep(1)
# 不输入密码
time1 = time.time()
form_explain_list = engine.driver.xpath('//div[@class="ant-row ant-form-item ant-form-item-with-help"]//div[@class="ant-form-explain"]')
alert_message_list = engine.driver.xpath('//div[@class="main___2iu6s"]//span[@class="ant-alert-message"]')
assert form_explain_list ==[]
assert alert_message_list ==[]
engine.load_image()
engine.driver.xpath('//*[@id="username"]')[0].send_keys(username)
# engine.driver.find_element_by_xpath('//*[@id="password"]').send_keys('123')
engine.driver.xpath('//*[@id="root"]/div/div/div[2]/form/div[4]/div/div/span/button')[0].click()
form_explain = engine.driver.xpath('//div[@class="ant-form-explain"]')[0].text
assert form_explain.strip() == '请输入密码!'
engine.logger.info('test_login_password_err:' + '不输入密码,返回正确的错误信息,text:' + form_explain)
# 输入错误的密码
engine.driver.find_element_by_xpath('//*[@id="password"]').send_keys('test_gt_pw')
engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[4]/div/div/span/button').click()
alert_message = engine.driver.xpath('//div[@class="main___2iu6s"]//span[@class="ant-alert-message"]')[0].text
assert alert_message.strip() == '账户或密码错误'
engine.logger.info('test_login_password_err:' + '输入错误密码,返回正确的错误信息,text:' + alert_message)
@pytest.mark.login
@get_engine(__file__, 'LOGIN')
def test_login_usererr(engine):
username = engine.get_userInfo('username')
password = engine.get_userInfo('password')
url = engine.get_testUrl('URL')
# print(username, password, url)
engine.logger.info("username: %s" % username)
engine.logger.info("password :%s" % password)
engine.logger.info("Open url: %s" % url)
# driver = engine.driver
tags = engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[1]/div/div/span/span/span')
# print(tags.text)
engine.logger.info("tags.text:%s" % tags.text)
tags.click()
time.sleep(1)
engine.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/span[1]').click()
tags2 = engine.driver.find_element_by_xpath('//*[@id="rc-tree-select-list_1"]/ul/li/ul/li[3]/ul/li[3]/span[2]/span')
# print(tags2.text)
engine.logger.info("tags2.text:%s" % tags2.text)
tags2.click()
time.sleep(1)
# 不输入密码
assert engine.driver.xpath('//div[@class="ant-form-explain"]') == []
assert engine.driver.xpath('//div[@class="main___2iu6s"]//span[@class="ant-alert-message"]') == []
# engine.driver.find_element_by_xpath('//*[@id="username"]').send_keys(username)
engine.driver.find_element_by_xpath('//*[@id="password"]').send_keys(password)
engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[4]/div/div/span/button').click()
form_explain = engine.driver.xpath('//div[@class="ant-form-explain"]')[0].text
assert form_explain.strip() == '请输入账户名!'
engine.logger.info('test_login_password_err:' + '不输入账户,返回正确的错误信息,text:' + form_explain)
# 输入错误的密码
engine.driver.find_element_by_xpath('//*[@id="username"]').send_keys('test_gt_user')
engine.driver.find_element_by_xpath('//*[@id="root"]/div/div/div[2]/form/div[4]/div/div/span/button').click()
alert_message = engine.driver.xpath('//div[@class="main___2iu6s"]//span[@class="ant-alert-message"]')[0].text
assert alert_message.strip() == '账户或密码错误'
engine.logger.info('test_login_password_err:' + '输入错误账户,返回正确的错误信息,text:' + alert_message)
# if __name__ == '__main__':
# pytest.main(["-m=login", "--html=report.html"])
'''
审查结论
'''
import pytest,time
from engine import get_engine
# 盗窃罪部分
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_lxjg_button(engine): # 量刑结果按钮
engine.get_page(engine.DQZ)
lx_div_list = engine.driver.xpath("//div[contains(@class,'ant-modal-wrap')]/div")
assert len(lx_div_list) == 0
time.sleep(0.5)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
lx_div_list = engine.driver.xpath("//div[contains(@class,'ant-modal-wrap')]/div")
assert len(lx_div_list) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_zafs_rhdq(engine): # 作案方式-入户盗窃
engine.get_page(engine.DQZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//span[text()='入户盗窃']/..//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_zafs_xdxq(engine): # 作案方式-携带凶器
engine.get_page(engine.DQZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//span[text()='携带凶器盗窃']/..//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_zafs_pq(engine): # 作案方式-扒窃
engine.get_page(engine.DQZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//span[text()='扒窃']/..//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_fzje(engine): # 犯罪金额
engine.get_page(engine.DQZ)
time.sleep(0.5)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[contains(text(),'犯罪数额')]/following-sibling::div[1]//input")
if not input:
return
input = input[0]
input.clear()
time.sleep(1)
input.send_keys('3000')
time.sleep(1)
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_ajxx(engine): # 案件信息按钮
engine.get_page(engine.DQZ)
time.sleep(0.5)
engine.driver.xpath("//div[text()='案件信息']")[0].click()
time.sleep(0.5)
bmsah = engine.driver.xpath("//div[@class='ant-modal-body']//th[text()='部门受案号:']/following-sibling::td[1]")[0].text
assert '瓯检起诉受' in bmsah
# 故意伤害罪部分 todo 切换iframe
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_ajxx(engine): # 量刑结果按钮
engine.get_page(engine.GYSHZ)
time.sleep(0.5)
engine.driver.xpath("//input[contains(@id,'量刑结果')]")[0].clear()
time.sleep(0.5)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
time.sleep(0.5)
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_qws(engine): # 轻微伤
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='轻微伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_qwsrs(engine): # 轻微伤人数
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='轻微伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
num_input = engine.driver.xpath("//div[text()='轻微伤']/following-sibling::div[1]//input")[0]
num_input.clear()
num_input.send_keys(3)
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_qs(engine): # 轻伤
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='轻伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_qsrs(engine): # 轻伤人数
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='轻伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
num_input = engine.driver.xpath("//div[text()='轻伤']/following-sibling::div[1]//input")[0]
num_input.clear()
num_input.send_keys(3)
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_qsjc(engine): # 轻伤几处
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='轻伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
# 轻伤几处按钮
input2 = engine.driver.xpath("//div[text()='轻伤几处']//input")[0]
assert input2.is_selected()
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_qsjcz(engine): # 轻伤几处值
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='轻伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
# 轻伤几处值按钮
num_input = engine.driver.xpath("//div[text()='轻伤几处']/following-sibling::div[1]//input")[0]
num_input.clear()
num_input.send_keys(3)
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_zsrs(engine): # 重伤人数
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='重伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
num_input = engine.driver.xpath("//div[text()='重伤']/following-sibling::div[1]//input")[0]
num_input.clear()
num_input.send_keys(3)
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_zs(engine): # 重伤
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='重伤']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
time.sleep(0.5)
input2 = engine.driver.xpath("//div[text()='轻伤']//input")
if not input2:
return
input2 = input2[0]
if not input2.is_selected():
input2.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_crsd(engine): # 残忍手段6级以上
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='残忍手段致六级及以上残疾']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.lxfz # 量刑辅助
@get_engine(__file__, 'SCJL_URL')
def test_yrsw(engine): # 一人死亡
engine.get_page(engine.GYSHZ)
engine.driver.xpath("//button[@class='ant-btn ant-btn-circle ant-btn-sm']")[0].click()
time.sleep(0.5)
iframe = engine.driver.find_element_by_tag_name('iframe')
engine.driver.switch_to.frame(iframe)
input = engine.driver.xpath("//div[text()='一人死亡']//input")
if not input:
return
input = input[0]
if not input.is_selected():
input.click()
engine.driver.xpath("//span[text()='保存量刑结果']/..")[0].click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
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