Skip to content

Commit 56decb8

Browse files
committed
fix record and report error
fix record and report error * fix record will record multi time * fix record will record both error and success on one test step
1 parent 135cb29 commit 56decb8

File tree

8 files changed

+217
-43
lines changed

8 files changed

+217
-43
lines changed

.idea/workspace.xml

Lines changed: 26 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="je_auto_control_dev",
8-
version="0.0.16",
8+
version="0.0.17",
99
author="JE-Chen",
1010
author_email="[email protected]",
1111
description="auto testing",

je_auto_control/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@
7070

7171
# file process
7272
from je_auto_control.utils.file_process.get_dir_file_list import get_dir_files_as_list
73+
from je_auto_control.utils.file_process.create_project_structure import create_template_dir

je_auto_control/utils/executor/action_executor.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"mouse_left": click_mouse,
3333
"mouse_right": click_mouse,
3434
"mouse_middle": click_mouse,
35+
"click_mouse": click_mouse,
3536
"mouse_table": mouse_table,
3637
"position": position,
3738
"press_mouse": press_mouse,
@@ -70,21 +71,16 @@ def execute_action(action_list: list):
7071
for action in action_list:
7172
event = event_dict.get(action[0])
7273
if len(action) == 2:
73-
param = action[1]
7474
event(**action[1])
7575
elif len(action) == 1:
76-
param = None
7776
event()
7877
else:
7978
raise AutoControlActionException(cant_execute_action_error)
80-
try:
81-
temp_string = "execute: " + str(action)
82-
print(temp_string)
83-
record_total(action[0], param)
84-
execute_record_string = "".join([execute_record_string, temp_string + "\n"])
85-
except AutoControlActionException as error:
86-
record_total(action[0], param, repr(error))
79+
temp_string = "execute: " + str(action)
80+
print(temp_string)
81+
execute_record_string = "".join([execute_record_string, temp_string + "\n"])
8782
except Exception as error:
83+
record_total("execute_action", action_list, repr(error))
8884
print(repr(error), file=sys.stderr)
8985
return execute_record_string
9086

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from pathlib import Path
2+
3+
4+
def create_dir(dir_name: str):
5+
Path(dir_name).mkdir(
6+
parents=True,
7+
exist_ok=True
8+
)
9+
10+
11+
def create_template_dir():
12+
create_dir("auto_control/template")

0 commit comments

Comments
 (0)