diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0fc2297..23f264e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,14 @@ + + + + + + + - @@ -350,7 +356,8 @@ - + + @@ -445,7 +452,7 @@ - + diff --git a/docs/source/doc/doc_index.rst b/docs/source/doc/doc_index.rst index fa44ef9..b0f52f4 100644 --- a/docs/source/doc/doc_index.rst +++ b/docs/source/doc/doc_index.rst @@ -13,3 +13,4 @@ Doc auto_control_record_doc/auto_control_record_doc.rst auto_control_screen_doc/auto_control_screen_doc.rst auto_control_test_record_doc/auto_control_test_record_doc.rst + generate_html_doc/generate_html_doc.rst diff --git a/docs/source/doc/generate_html_doc/generate_html_doc.rst b/docs/source/doc/generate_html_doc/generate_html_doc.rst new file mode 100644 index 0000000..0b0fb27 --- /dev/null +++ b/docs/source/doc/generate_html_doc/generate_html_doc.rst @@ -0,0 +1,16 @@ +========================== +AutoControlGUI Generate Html Report Doc +========================== + + +.. code-block:: python + + def generate_html(html_name: str = "default_name"): + """ + this function will create and save html report on current folder + :param html_name: save html file name + :return: html_string + """ + + + diff --git a/docs/source/example/example_index.rst b/docs/source/example/example_index.rst index 0fb6c9c..1c46933 100644 --- a/docs/source/example/example_index.rst +++ b/docs/source/example/example_index.rst @@ -13,4 +13,5 @@ Example image_detect_example/image_detect.rst record_example/record.rst executor_example/execute_action.rst - editor_example/editor.rst \ No newline at end of file + editor_example/editor.rst + generate_html_example/generate_html_example.rst \ No newline at end of file diff --git a/docs/source/example/generate_html_example/generate_html_example.rst b/docs/source/example/generate_html_example/generate_html_example.rst new file mode 100644 index 0000000..c7ef4c1 --- /dev/null +++ b/docs/source/example/generate_html_example/generate_html_example.rst @@ -0,0 +1,47 @@ +======================== +AutoControlGUI Generate Html Example +======================== + +.. code-block:: python + + import sys + + from je_auto_control import test_record + from je_auto_control import press_key + from je_auto_control import release_key + from je_auto_control import write + from je_auto_control import keys_table + from je_auto_control import generate_html + + # init test_record to record test detail + test_record.init_total_record = True + + print(keys_table.keys()) + # do something + press_key("shift") + write("123456789") + press_key("return") + release_key("return") + assert (write("abcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyz") + release_key("shift") + press_key("return") + release_key("return") + assert (write("abcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyz") + press_key("return") + release_key("return") + + # this write will print one error -> keyboard write error can't find key : ? and write remain string + try: + assert (write("?123456789") == "123456789") + except Exception as error: + print(repr(error), file=sys.stderr) + # this write will print one error -> keyboard write error can't find key : ! and write remain string + try: + write("!#@L@#{@#PL#{!@#L{!#{|##PO}!@#O@!O#P!)KI#O_!K") + except Exception as error: + print(repr(error), file=sys.stderr) + + print(test_record.total_record_list) + # html name is test.html and this html will recode all test detail + # if test_record.init_total_record = True + generate_html("test") \ No newline at end of file diff --git a/je_auto_control/utils/html_report/html_report_generate.py b/je_auto_control/utils/html_report/html_report_generate.py index c26a65b..d2cf638 100644 --- a/je_auto_control/utils/html_report/html_report_generate.py +++ b/je_auto_control/utils/html_report/html_report_generate.py @@ -130,6 +130,7 @@ def make_html_table(event_str: str, record_data: dict, table_head: str): def generate_html(html_name: str = "default_name"): """ + this function will create and save html report on current folder :param html_name: save html file name :return: html_string """ diff --git a/je_auto_control/wrapper/auto_control_screen.py b/je_auto_control/wrapper/auto_control_screen.py index ad1c1cf..d2b0579 100644 --- a/je_auto_control/wrapper/auto_control_screen.py +++ b/je_auto_control/wrapper/auto_control_screen.py @@ -38,7 +38,7 @@ def screenshot(file_path: str = None, region: list = None): record_total("screenshot", param) return cv2.cvtColor(np.array(pil_screenshot(file_path=file_path, region=region)), cv2.COLOR_RGB2BGR) except AutoControlScreenException as error: - raise AutoControlScreenException(screen_screenshot + repr(error)) + raise AutoControlScreenException(screen_screenshot + " " + repr(error)) except Exception as error: record_total("screenshot", None, repr(error)) print(repr(error), file=sys.stderr) diff --git a/setup.py b/setup.py index 7185a60..188cfbc 100644 --- a/setup.py +++ b/setup.py @@ -33,4 +33,3 @@ ) # python setup.py sdist bdist_wheel -# python -m twine upload dist/* diff --git a/test/integrated_test/total_record_and_html_report_test/total_record_and_html_report_test.py b/test/integrated_test/total_record_and_html_report_test/total_record_and_html_report_test.py index e4572b4..7dea540 100644 --- a/test/integrated_test/total_record_and_html_report_test/total_record_and_html_report_test.py +++ b/test/integrated_test/total_record_and_html_report_test/total_record_and_html_report_test.py @@ -38,4 +38,3 @@ generate_html("test") -