修改HTMLTestRunner.py

This commit is contained in:
lily 2019-02-19 15:03:44 +08:00
parent 80d50f0199
commit 43d9a91368
8 changed files with 778 additions and 501 deletions

View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.6 (python)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.6 (untitled)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">

View File

@ -3,5 +3,5 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (python)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (untitled)" project-jdk-type="Python SDK" />
</project>

View File

@ -2,14 +2,13 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="09a4aeb4-cd0a-454b-9878-fc6edee9400a" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/HTMLTestRunner.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/common/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/run.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/testcase/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/testcase/test.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/movie.py" beforeDir="false" />
<change afterPath="$PROJECT_DIR$/testcase/testDemo.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/Automated-Test.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/Automated-Test.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/HTMLTestRunner.py" beforeDir="false" afterPath="$PROJECT_DIR$/HTMLTestRunner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/report/2019-02-18-22-18-57result.html" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/testcase/test.py" beforeDir="false" afterPath="$PROJECT_DIR$/testcase/test.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -20,22 +19,36 @@
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/Automated_Test$Unittests_for_t_MyTestCase.coverage" NAME="Unittests for t.MyTestCase Coverage Results" MODIFIED="1550495220265" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Automated_Test$Unnamed.coverage" NAME="Unnamed Coverage Results" MODIFIED="1550499537590" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
<SUITE FILE_PATH="coverage/Automated_Test$Unittests_in_test_py.coverage" NAME="Unittests in test.py Coverage Results" MODIFIED="1550499024214" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
<SUITE FILE_PATH="coverage/Automated_Test$Unnamed.coverage" NAME="Unnamed Coverage Results" MODIFIED="1550546753307" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
<SUITE FILE_PATH="coverage/Automated_Test$Unittests_in_test_py.coverage" NAME="Unittests in test.py Coverage Results" MODIFIED="1550545365197" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
<SUITE FILE_PATH="coverage/Automated_Test$run__1_.coverage" NAME="run (1) Coverage Results" MODIFIED="1550497417209" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Automated_Test$test.coverage" NAME="test Coverage Results" MODIFIED="1550558865800" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
<SUITE FILE_PATH="coverage/Automated_Test$Unittests_for_test_TestDemo.coverage" NAME="Unittests for test.TestDemo Coverage Results" MODIFIED="1550493736228" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Automated_Test$run.coverage" NAME="run Coverage Results" MODIFIED="1550497543321" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Automated_Test$Unittests_in_t_py.coverage" NAME="Unittests in t.py Coverage Results" MODIFIED="1550495271315" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Automated_Test$Unittests_for_test_TestLogin.coverage" NAME="Unittests for test.TestLogin Coverage Results" MODIFIED="1550545430554" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
</component>
<component name="FileEditorManager">
<leaf>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="test.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/testcase/test.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
<state relative-caret-position="116">
<caret line="45" column="76" selection-start-line="45" selection-start-column="76" selection-end-line="45" selection-end-column="76" />
<folding>
<element signature="e#0#41#0" expanded="true" />
<element signature="e#15#56#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="HTMLTestRunner.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/HTMLTestRunner.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="396" column="47" lean-forward="true" selection-start-line="396" selection-start-column="47" selection-end-line="396" selection-end-column="47" />
<folding>
<element signature="e#3209#3224#0" expanded="true" />
</folding>
</state>
</provider>
@ -53,6 +66,25 @@
<component name="FindInProjectRecents">
<findStrings>
<find>HTMLTestRunner</find>
<find>#faebcc</find>
<find>#d6e9c6</find>
<find>font-size</find>
<find>测试</find>
<find>description</find>
<find>heading</find>
<find>Test</find>
<find>TestLogin</find>
<find>failClass</find>
<find>tEST</find>
<find>result</find>
<find>_generate_chart</find>
<find>show</find>
<find>showTestDetail</find>
<find>pie</find>
<find>border</find>
<find>Test</find>
<find>Pass</find>
<find>testChars</find>
</findStrings>
</component>
<component name="Git.Settings">
@ -69,8 +101,16 @@
<option value="$PROJECT_DIR$/common/__init__.py" />
<option value="$PROJECT_DIR$/__init__.py" />
<option value="$PROJECT_DIR$/run.py" />
<option value="$PROJECT_DIR$/testcase/test.py" />
<option value="$PROJECT_DIR$/testcase/testDemo.py" />
<option value="$PROJECT_DIR$/report/2019-02-19-13-10-07result.html" />
<option value="$PROJECT_DIR$/report/2019-02-19-13-21-06result.html" />
<option value="$PROJECT_DIR$/report/2019-02-19-13-25-34result.html" />
<option value="$PROJECT_DIR$/report/2019-02-19-13-42-35result.html" />
<option value="$PROJECT_DIR$/report/2019-02-19-14-09-28result.html" />
<option value="$PROJECT_DIR$/report/2019-02-19-14-28-25result.html" />
<option value="$PROJECT_DIR$/HTMLTestRunner.py" />
<option value="$PROJECT_DIR$/report/2019-02-19-14-35-13result.html" />
<option value="$PROJECT_DIR$/testcase/test.py" />
</list>
</option>
</component>
@ -83,11 +123,10 @@
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="948" />
<option name="y" value="27" />
<component name="ProjectFrameBounds" extendedState="7">
<option name="x" value="939" />
<option name="width" value="981" />
<option name="height" value="1092" />
<option name="height" value="1080" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
@ -107,11 +146,6 @@
<item name="Automated-Test" type="462c0819:PsiDirectoryNode" />
<item name="report" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Automated-Test" type="b2602c69:ProjectViewProjectNode" />
<item name="Automated-Test" type="462c0819:PsiDirectoryNode" />
<item name="testcase" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
@ -147,8 +181,8 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.Unnamed">
<configuration name="Unnamed" type="PythonConfigurationType" factoryName="Python">
<component name="RunManager">
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<module name="Automated-Test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -167,7 +201,7 @@
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
</configuration>
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<configuration name="test" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="Automated-Test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -175,43 +209,20 @@
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="D:\tmp\test\venv\Scripts\python3.exe" />
<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" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<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="run" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="Automated-Test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="D:\tmp\test\venv\Scripts\python3.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/testcase" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/run.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/testcase/test.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>
<list>
<item itemvalue="Python.Unnamed" />
<item itemvalue="Python.run" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.run" />
<item itemvalue="Python.test" />
</list>
</recent_temporary>
</component>
@ -229,21 +240,6 @@
<servers />
</component>
<component name="TestHistory">
<history-entry file="Unittests_in_test_py - 2019.02.18 at 20h 47m 35s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_py - 2019.02.18 at 20h 47m 59s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_py - 2019.02.18 at 20h 50m 08s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_py - 2019.02.18 at 20h 50m 29s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_t_py - 2019.02.18 at 20h 59m 20s.xml">
<configuration name="Unittests in t.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_t_py - 2019.02.18 at 20h 59m 40s.xml">
<configuration name="Unittests in t.py" configurationId="tests" />
</history-entry>
@ -259,30 +255,45 @@
<history-entry file="Unittests_in_test_py - 2019.02.18 at 22h 10m 27s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_for_test_TestLogin - 2019.02.19 at 11h 01m 57s.xml">
<configuration name="Unittests for test.TestLogin" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_py - 2019.02.19 at 11h 02m 30s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_py - 2019.02.19 at 11h 02m 37s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_py - 2019.02.19 at 11h 02m 45s.xml">
<configuration name="Unittests in test.py" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_for_test_TestLogin - 2019.02.19 at 11h 03m 51s.xml">
<configuration name="Unittests for test.TestLogin" configurationId="tests" />
</history-entry>
</component>
<component name="ToolWindowManager">
<frame x="-7" y="-7" width="1295" height="735" extended-state="6" />
<frame x="-7" y="-7" width="1295" height="735" extended-state="7" />
<editor active="true" />
<layout>
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Event Log" side_tool="true" weight="0.3292683" />
<window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" weight="0.3292683" />
<window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Python Console" order="7" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.3292683" />
<window_info anchor="bottom" id="Version Control" />
<window_info anchor="bottom" id="Python Console" />
<window_info anchor="bottom" id="Terminal" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2497979" />
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
<window_info anchor="right" id="Database" />
<window_info anchor="bottom" id="Terminal" order="7" weight="0.3292683" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25383994" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="right" id="Database" order="3" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3292683" />
<window_info anchor="right" id="SciView" />
<window_info anchor="right" id="SciView" order="3" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.3989547" />
<window_info id="Favorites" side_tool="true" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
</layout>
@ -293,19 +304,24 @@
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="3" />
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/movie.py">
<entry file="file://$PROJECT_DIR$/testcase/test.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-516" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/reports/HTMLTestRunner.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="224">
<caret line="601" column="83" selection-start-line="601" selection-start-column="83" selection-end-line="601" selection-end-column="83" />
<state relative-caret-position="114">
<caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
<folding>
<element signature="e#15#56#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/movie.py" />
<entry file="file://$PROJECT_DIR$/reports/HTMLTestRunner.py" />
<entry file="file://D:/software/Python/python2.7.10/Lib/unittest/loader.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
@ -313,29 +329,9 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/result.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/test_case/test.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="28" column="40" lean-forward="true" selection-start-line="28" selection-start-column="40" selection-end-line="28" selection-end-column="40" />
<folding>
<element signature="e#15#56#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test_case/t.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="133">
<caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" />
<folding>
<element signature="e#16#31#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/result.html" />
<entry file="file://$PROJECT_DIR$/test_case/test.py" />
<entry file="file://$PROJECT_DIR$/test_case/t.py" />
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
@ -362,30 +358,8 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-18-22-15-31result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="2" column="43" lean-forward="true" selection-start-line="2" selection-start-column="43" selection-end-line="2" selection-end-column="43" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-18-22-16-23result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="133">
<caret line="7" column="4" lean-forward="true" selection-start-line="7" selection-start-column="4" selection-end-line="7" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/HTMLTestRunner.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="848">
<caret line="866" column="21" selection-start-line="866" selection-start-column="21" selection-end-line="866" selection-end-column="21" />
<folding>
<element signature="e#3209#3224#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-18-22-15-31result.html" />
<entry file="file://$PROJECT_DIR$/report/2019-02-18-22-16-23result.html" />
<entry file="file://$PROJECT_DIR$/report/2019-02-18-22-18-57result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
@ -393,12 +367,203 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/testcase/test.py">
<entry file="file://$PROJECT_DIR$/report/2019-02-19-10-46-49result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="133">
<caret line="7" column="94" lean-forward="true" selection-start-line="7" selection-start-column="94" selection-end-line="7" selection-end-column="94" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-11-27-59result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" column="6" lean-forward="true" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-11-28-39result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-494">
<caret line="4" column="24" lean-forward="true" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/testcase/testDemo.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
<folding>
<element signature="e#0#22#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-04-03result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="2" column="43" lean-forward="true" selection-start-line="2" selection-start-column="43" selection-end-line="2" selection-end-column="43" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-10-07result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="92" column="16" lean-forward="true" selection-start-line="92" selection-start-column="16" selection-end-line="92" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-14-04result.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-15-17result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3211">
<caret line="215" column="55" selection-start-line="215" selection-start-column="55" selection-end-line="215" selection-end-column="55" />
<folding>
<element signature="n#style#0;n#p#0;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-21-06result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1406">
<caret line="70" column="26" lean-forward="true" selection-start-line="70" selection-start-column="26" selection-end-line="70" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-35-32result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="4" column="24" lean-forward="true" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-38-32result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
<caret line="6" column="57" lean-forward="true" selection-start-line="6" selection-start-column="57" selection-end-line="6" selection-end-column="57" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-25-34result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="202" column="23" selection-start-line="202" selection-start-column="23" selection-end-line="202" selection-end-column="23" />
<folding>
<element signature="e#0#41#0" expanded="true" />
<element signature="n#style#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#1;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-40-47result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="35" column="20" lean-forward="true" selection-start-line="35" selection-start-column="20" selection-end-line="35" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-42-35result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="149">
<caret line="84" column="41" lean-forward="true" selection-start-line="84" selection-start-column="41" selection-end-line="84" selection-end-column="41" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-13-47-12result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="8" column="8" lean-forward="true" selection-start-line="8" selection-start-column="8" selection-end-line="8" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-09-28result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="283">
<caret line="347" column="24" selection-start-line="347" selection-start-column="17" selection-end-line="347" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-19-47result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="38">
<caret line="2" column="43" lean-forward="true" selection-start-line="2" selection-start-column="43" selection-end-line="2" selection-end-column="43" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-11-14result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="107" column="29" selection-start-line="107" selection-start-column="22" selection-end-line="107" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-21-24result.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-23-44result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="95">
<caret line="5" column="59" lean-forward="true" selection-start-line="5" selection-start-column="59" selection-end-line="5" selection-end-column="59" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-25-43result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" column="6" lean-forward="true" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-26-48result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="19">
<caret line="1" column="98" lean-forward="true" selection-start-line="1" selection-start-column="98" selection-end-line="1" selection-end-column="98" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-28-25result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2501">
<caret line="92" column="1" lean-forward="true" selection-start-line="92" selection-start-column="1" selection-end-line="92" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-35-13result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178">
<caret line="214" lean-forward="true" selection-start-line="214" selection-end-line="214" />
<folding>
<element signature="n#style#0;n#div#1;n#body#0;n#html#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#3;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/report/2019-02-19-14-43-59result.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" column="72" lean-forward="true" selection-start-line="6" selection-start-column="72" selection-end-line="6" selection-end-column="72" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/HTMLTestRunner.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="396" column="47" lean-forward="true" selection-start-line="396" selection-start-column="47" selection-end-line="396" selection-end-column="47" />
<folding>
<element signature="e#3209#3224#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/testcase/test.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="116">
<caret line="45" column="76" selection-start-line="45" selection-start-column="76" selection-end-line="45" selection-end-column="76" />
<folding>
<element signature="e#15#56#0" expanded="true" />
</folding>
</state>
</provider>

View File

@ -291,15 +291,18 @@ h1 {
color: gray;
}
.heading {
font-size: 12px;
margin-top: 0ex;
margin-bottom: 1ex;
margin-left: 10px;
}
.heading .attribute {
font-size: 12px;
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
font-size: 12px;
margin-top: 4ex;
margin-bottom: 6ex;
}
@ -317,7 +320,7 @@ a.popup_link:hover {
/*border: solid #627173 1px; */
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
font-size: 12pt;
width: 500px;
}
}
@ -334,7 +337,7 @@ a.popup_link:hover {
margin-left: 10px;
}
#header_row {
font-weight: bold;
font-weight: bold;T
color: #606060;
background-color: #f5f5f5;
border-top-width: 10px;
@ -342,6 +345,7 @@ a.popup_link:hover {
font-size: 12px;
}
#result_table td {
font-size:10px
border: 1px solid #f5f5f5;
padding: 2px;
}
@ -358,20 +362,20 @@ a.popup_link:hover {
#ending {
}
/* -- chars ---------------------------------------------------------------------- */
.testChars {margin-left: 150px;}
.testChars {margin-left: 150px; font-size:10px; text-align:center;}
.btn-info1 {
color: #fff;
background-color: #d6e9c6;
background-color: #28B463;
border-color: #d6e9c6;
}
.btn-info2 {
color: #fff;
background-color: #faebcc;
background-color: #D4AC0D;
border-color: #faebcc;
}
.btn-info3 {
color: #fff;
background-color: #ebccd1;
background-color: #D35400;
border-color: #ebccd1;
}
</style>
@ -388,13 +392,14 @@ a.popup_link:hover {
%(parameters)s
<p class='description'>%(description)s</p>
</div>
<div style="float:left; margin-left: 10px;">
<div style="float:left; margin-left: 10px; font-size:12px">
<p> Test Case Pie charts </p>
<a class="btn btn-xs btn-info1">-Pass-</a><br>
<a class="btn btn-xs btn-info2">-Faild-</a><br>
<a class="btn btn-xs btn-info3">-Error-</a><br>
</div>
<div class="testChars">
<div class="testChars" style="center">
<canvas id="myChart" width="250" height="250"></canvas>
</div>
""" # variables: (title, parameters, description)
@ -408,23 +413,26 @@ a.popup_link:hover {
ECHARTS_SCRIPT = """
<script type="text/javascript">
var data = [
{
{
name: 'error',
value: %(error)s,
color: "#ebccd1",
color: "#D35400",
label: "Error",
labelColor: 'white',
labelFontSize: '16'
},
{
name: 'fail',
value : %(fail)s,
color : "#faebcc",
color : "#D4AC0D",
label: "Fail",
labelColor: 'white',
labelFontSize: '16'
},
{
name : 'pass',
value : %(Pass)s,
color : "#d6e9c6",
color : "#28B463",
label : "Pass",
labelColor: 'white',
labelFontSize: '16'
@ -451,7 +459,7 @@ var myNewChart = new Chart(ctx).Pie(data,newopts);
#
REPORT_TMPL = """
<p id='show_detail_line' style="margin-left: 10px;">Show
<p id='show_detail_line' style="margin-left: 16px; font-size:12px">Show
<a href='javascript:showCase(0)' class="btn btn-xs btn-primary">Summary</a>
<a href='javascript:showCase(1)' class="btn btn-xs btn-danger">Failed</a>
<a href='javascript:showCase(2)' class="btn btn-xs btn-info">All</a>

View File

@ -1,344 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>自动化测试</title>
<meta name="generator" content="HTMLTestRunner 0.8.2"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="http://apps.bdimg.com/libs/Chart.js/0.2.0/Chart.min.js"></script>
<!-- <link href="https://cdn.bootcss.com/echarts/3.8.5/echarts.common.min.js" rel="stylesheet"> -->
<style type="text/css" media="screen">
body { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; }
table { font-size: 100%; }
pre { }
/* -- heading ---------------------------------------------------------------------- */
h1 {
font-size: 16pt;
color: gray;
}
.heading {
margin-top: 0ex;
margin-bottom: 1ex;
margin-left: 10px;
}
.heading .attribute {
margin-top: 1ex;
margin-bottom: 0;
}
.heading .description {
margin-top: 4ex;
margin-bottom: 6ex;
}
/* -- css div popup ------------------------------------------------------------------------ */
a.popup_link {
}
a.popup_link:hover {
color: red;
}
.popup_window {
display: none;
position: relative;
left: 0px;
top: 0px;
/*border: solid #627173 1px; */
font-family: "Lucida Console", "Courier New", Courier, monospace;
text-align: left;
font-size: 8pt;
width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
margin-top: 3ex;
margin-bottom: 1ex;
margin-left: 10px;
}
#result_table {
width: 80%;
border-collapse: collapse;
border: 1px solid #777;
margin-left: 10px;
}
#header_row {
font-weight: bold;
color: #606060;
background-color: #f5f5f5;
border-top-width: 10px;
border-color: #d6e9c6;
font-size: 12px;
}
#result_table td {
border: 1px solid #f5f5f5;
padding: 2px;
}
#total_row { font-weight: bold; }
.passClass { background-color: #d6e9c6; }
.failClass { background-color: #faebcc; }
.errorClass { background-color: #ebccd1; }
.passCase { color: #6c6; }
.failCase { color: #c60; font-weight: bold; }
.errorCase { color: #c00; font-weight: bold; }
.hiddenRow { display: none; }
.testcase { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}
/* -- chars ---------------------------------------------------------------------- */
.testChars {margin-left: 150px;}
.btn-info1 {
color: #fff;
background-color: #d6e9c6;
border-color: #d6e9c6;
}
.btn-info2 {
color: #fff;
background-color: #faebcc;
border-color: #faebcc;
}
.btn-info3 {
color: #fff;
background-color: #ebccd1;
border-color: #ebccd1;
}
</style>
</head>
<body>
<script language="javascript" type="text/javascript"><!--
output_list = Array();
/* level - 0:Summary; 1:Failed; 2:All */
function showCase(level) {
trs = document.getElementsByTagName("tr");
for (var i = 0; i < trs.length; i++) {
tr = trs[i];
id = tr.id;
if (id.substr(0,2) == 'ft') {
if (level < 1) {
tr.className = 'hiddenRow';
}
else {
tr.className = '';
}
}
if (id.substr(0,2) == 'pt') {
if (level > 1) {
tr.className = '';
}
else {
tr.className = 'hiddenRow';
}
}
}
}
function showClassDetail(cid, count) {
var id_list = Array(count);
var toHide = 1;
for (var i = 0; i < count; i++) {
tid0 = 't' + cid.substr(1) + '.' + (i+1);
tid = 'f' + tid0;
tr = document.getElementById(tid);
if (!tr) {
tid = 'p' + tid0;
tr = document.getElementById(tid);
}
id_list[i] = tid;
if (tr.className) {
toHide = 0;
}
}
for (var i = 0; i < count; i++) {
tid = id_list[i];
if (toHide) {
document.getElementById('div_'+tid).style.display = 'none'
document.getElementById(tid).className = 'hiddenRow';
}
else {
document.getElementById(tid).className = '';
}
}
}
function showTestDetail(div_id){
var details_div = document.getElementById(div_id)
var displayState = details_div.style.display
// alert(displayState)
if (displayState != 'block' ) {
displayState = 'block'
details_div.style.display = 'block'
}
else {
details_div.style.display = 'none'
}
}
function html_escape(s) {
s = s.replace(/&/g,'&amp;');
s = s.replace(/</g,'&lt;');
s = s.replace(/>/g,'&gt;');
return s;
}
/* obsoleted by detail in <div>
function showOutput(id, name) {
var w = window.open("", //url
name,
"resizable,scrollbars,status,width=800,height=450");
d = w.document;
d.write("<pre>");
d.write(html_escape(output_list[id]));
d.write("\n");
d.write("<a href='javascript:window.close()'>close</a>\n");
d.write("</pre>\n");
d.close();
}
*/
--></script>
<div class='heading'>
<h1>自动化测试</h1>
<p class='attribute'><strong>Start Time:</strong> 2019-02-18 22:18:57</p>
<p class='attribute'><strong>Duration:</strong> 0:00:00.001995</p>
<p class='attribute'><strong>Status:</strong> Error 2</p>
<p class='description'>测试</p>
</div>
<div style="float:left; margin-left: 10px;">
<p> Test Case Pie charts </p>
<a class="btn btn-xs btn-info1">-Pass-</a><br>
<a class="btn btn-xs btn-info2">-Faild-</a><br>
<a class="btn btn-xs btn-info3">-Error-</a><br>
</div>
<div class="testChars">
<canvas id="myChart" width="250" height="250"></canvas>
</div>
<p id='show_detail_line' style="margin-left: 10px;">Show
<a href='javascript:showCase(0)' class="btn btn-xs btn-primary">Summary</a>
<a href='javascript:showCase(1)' class="btn btn-xs btn-danger">Failed</a>
<a href='javascript:showCase(2)' class="btn btn-xs btn-info">All</a>
</p>
<table id='result_table'>
<colgroup>
<col align='left' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
</colgroup>
<tr id='header_row' class="panel-title">
<td>Test Group/Test case</td>
<td>Count</td>
<td>Pass</td>
<td>Fail</td>
<td>Error</td>
<td>View</td>
</tr>
<tr class='errorClass'>
<td>TestLogin</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>2</td>
<td><a href="javascript:showClassDetail('c1',2)">Detail</a></td>
</tr>
<tr id='ft1.1' class='none'>
<td class='errorCase'><div class='testcase'>test_search</div></td>
<td colspan='5' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft1.1')" >
error</a>
<div id='div_ft1.1' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_ft1.1').style.display = 'none' " >
[x]</a>
</div>
<pre>
ft1.1: Traceback (most recent call last):
File "D:/githublily/Automated-Test/testcase/test.py", line 11, in setUp
self.driver = webdriver.Chrome()
AttributeError: module 'selenium.webdriver' has no attribute 'Chrome'
</pre>
</div>
<!--css div popup end-->
</td>
</tr>
<tr id='ft1.2' class='none'>
<td class='errorCase'><div class='testcase'>test_search1</div></td>
<td colspan='5' align='center'>
<!--css div popup start-->
<a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft1.2')" >
error</a>
<div id='div_ft1.2' class="popup_window">
<div style='text-align: right; color:red;cursor:pointer'>
<a onfocus='this.blur();' onclick="document.getElementById('div_ft1.2').style.display = 'none' " >
[x]</a>
</div>
<pre>
ft1.2: Traceback (most recent call last):
File "D:/githublily/Automated-Test/testcase/test.py", line 11, in setUp
self.driver = webdriver.Chrome()
AttributeError: module 'selenium.webdriver' has no attribute 'Chrome'
</pre>
</div>
<!--css div popup end-->
</td>
</tr>
<tr id='total_row'>
<td>Total</td>
<td>2</td>
<td class="text text-success">0</td>
<td class="text text-danger">0</td>
<td class="text text-warning">2</td>
<td>&nbsp;</td>
</tr>
</table>
<div id='ending'>&nbsp;</div>
<script type="text/javascript">
var data = [
{
value: 2,
color: "#ebccd1",
label: "Error",
labelColor: 'white',
labelFontSize: '16'
},
{
value : 0,
color : "#faebcc",
label: "Fail",
labelColor: 'white',
labelFontSize: '16'
},
{
value : 0,
color : "#d6e9c6",
label : "Pass",
labelColor: 'white',
labelFontSize: '16'
}
]
var newopts = {
animationSteps: 100,
animationEasing: 'easeInOutQuart',
}
//Get the context of the canvas element we want to select
var ctx = document.getElementById("myChart").getContext("2d");
var myNewChart = new Chart(ctx).Pie(data,newopts);
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,4 @@
# coding=utf-8
from HTMLTestRunner import HTMLTestRunner
from selenium import webdriver
import time
@ -26,7 +25,13 @@ class TestLogin(unittest.TestCase):
self.driver.find_element_by_id("kw").send_keys("hello")
self.driver.find_element_by_id("su").click()
time.sleep(2)
self.assertIn("hello", self.driver.page_source)
self.assertIn("hello1232323", self.driver.page_source)
def test_search2(self):
self.driver.find_element_by_id("k").send_keys("hello")
self.driver.find_element_by_id("su").click()
time.sleep(2)
self.assertIn("hello1232323", self.driver.page_source)
if __name__ == '__main__':
@ -34,10 +39,11 @@ if __name__ == '__main__':
suite = unittest.TestSuite()
suite.addTest(TestLogin("test_search"))
suite.addTest(TestLogin("test_search1"))
suite.addTest(TestLogin("test_search2"))
path = "../report/" + now + "result.html"
fp = open(path, 'wb')
runner = HTMLTestRunner(stream=fp, title=u"自动化测试", description=u"测试")
runner = HTMLTestRunner(stream=fp, title=u"Web页面自动化测试", description=u"测试查询功能")
runner.run(suite)
fp.close()

39
testcase/testDemo.py Normal file
View File

@ -0,0 +1,39 @@
from time import sleep
from selenium import webdriver
import unittest
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
# 窗口最大化
self.driver.maximize_window()
self.msg = '海贼王'
self.url = 'http://www.baidu.com'
def testSearch(self):
"""
test body
:return:
"""
# open browser
self.driver.get(self.url)
sleep(3)
# click search input
self.driver.find_element_by_id('kw').click()
sleep(1)
# input value
self.driver.find_element_by_id('kw').send_keys(self.msg)
sleep(1)
self.driver.find_element_by_id('su').click()
sleep(1)
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
unittest.main()