Skip to content

Commit 2715853

Browse files
authored
Merge pull request #84 from Integration-Automation/dev
Dev
2 parents 5025716 + 7ba5a7c commit 2715853

21 files changed

Lines changed: 301 additions & 162 deletions

automation_ide/automation_editor_ui/editor_main/main_ui.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import sys
2+
from pathlib import Path
23
from typing import List, Dict, Type
34

45
from PySide6.QtCore import QTimer, QCoreApplication
6+
from PySide6.QtGui import QIcon
57
from PySide6.QtWidgets import QApplication, QWidget
68
from je_editor import EditorMain, language_wrapper
79
from qt_material import apply_stylesheet
@@ -36,6 +38,9 @@ def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = False)
3638
# Tab
3739
for widget_name, widget in EDITOR_EXTEND_TAB.items():
3840
self.tab_widget.addTab(widget(), widget_name)
41+
# Icon
42+
self.icon_path = Path(str(Path.cwd()) + "/je_driver_icon.ico")
43+
self.icon = QIcon(str(self.icon_path))
3944
# Title
4045
self.setWindowTitle(language_wrapper.language_word_dict.get("automation_editor_application_name"))
4146
if debug_mode:

automation_ide/automation_editor_ui/extend_multi_language/extend_english.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,9 @@ def update_english_word_dict():
9494
"tools_menu_re_edge_gpt_doc_tab_label": "ReEdgeGPT Doc",
9595
"tools_menu_re_edge_gpt_github_label": "Open ReEdgeGPT GitHub",
9696
"tools_menu_re_edge_gpt_github_tab_label": "ReEdgeGPT GitHub",
97+
# Test Pioneer Menu
98+
"test_pioneer_label": "TestPioneer",
99+
"test_pioneer_create_template_label": "Create TestPioneer Yaml template",
100+
"test_pioneer_run_yaml": "Execute Test Pioneer Yaml",
97101
}
98102
)

automation_ide/automation_editor_ui/extend_multi_language/extend_traditional_chinese.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,9 @@ def update_traditional_chinese_word_dict():
9494
"tools_menu_re_edge_gpt_doc_tab_label": "ReEdgeGPT 文件",
9595
"tools_menu_re_edge_gpt_github_label": "開啟 ReEdgeGPT GitHub",
9696
"tools_menu_re_edge_gpt_github_tab_label": "ReEdgeGPT GitHub",
97+
# Test Pioneer Menu
98+
"test_pioneer_label": "TestPioneer",
99+
"test_pioneer_create_template_label": "建立 TestPioneer Yaml 模板",
100+
"test_pioneer_run_yaml": "執行 Test Pioneer Yaml",
97101
}
98102
)

automation_ide/automation_editor_ui/menu/tools_menu/__init__.py renamed to automation_ide/automation_editor_ui/menu/automation_menu/test_pioneer_menu/__init__.py

File renamed without changes.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from __future__ import annotations
2+
3+
from typing import TYPE_CHECKING
4+
5+
from automation_ide.extend.process_executor.test_pioneer.test_pioneer_process_manager import init_and_start_test_pioneer_process
6+
7+
if TYPE_CHECKING:
8+
from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
9+
10+
from PySide6.QtGui import QAction
11+
from je_editor import language_wrapper
12+
from test_pioneer import create_template_dir, execute_yaml
13+
14+
15+
def set_test_pioneer_menu(ui_we_want_to_set: AutomationEditor):
16+
"""
17+
Build menu include Test Pioneer feature.
18+
:param ui_we_want_to_set: main window to add menu.
19+
:return: None
20+
"""
21+
ui_we_want_to_set.test_pioneer_menu = ui_we_want_to_set.automation_menu.addMenu(
22+
language_wrapper.language_word_dict.get("test_pioneer_label"))
23+
# Create test pioneer template
24+
ui_we_want_to_set.create_template_action = QAction(
25+
language_wrapper.language_word_dict.get("test_pioneer_create_template_label"))
26+
ui_we_want_to_set.create_template_action.triggered.connect(
27+
lambda: create_template_dir()
28+
)
29+
ui_we_want_to_set.test_pioneer_menu.addAction(
30+
ui_we_want_to_set.create_template_action
31+
)
32+
# Run test pioneer yaml
33+
ui_we_want_to_set.run_yaml_action = QAction(
34+
language_wrapper.language_word_dict.get("test_pioneer_run_yaml"))
35+
ui_we_want_to_set.run_yaml_action.triggered.connect(
36+
lambda: init_and_start_test_pioneer_process(ui_we_want_to_set)
37+
)
38+
ui_we_want_to_set.test_pioneer_menu.addAction(
39+
ui_we_want_to_set.run_yaml_action
40+
)

automation_ide/automation_editor_ui/menu/build_menubar.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
from typing import TYPE_CHECKING
44

5+
if TYPE_CHECKING:
6+
from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
7+
58
from automation_ide.automation_editor_ui.menu.automation_menu.api_testka_menu.build_api_testka_menu import \
69
set_apitestka_menu
710
from automation_ide.automation_editor_ui.menu.automation_menu.auto_control_menu.build_autocontrol_menu import \
@@ -18,10 +21,8 @@
1821
build_automation_install_menu
1922
from automation_ide.automation_editor_ui.menu.install_menu.tools_menu.build_tool_install_menu import \
2023
build_tool_install_menu
21-
from automation_ide.automation_editor_ui.menu.tools_menu.bing_gpt_menu.build_bing_gpt_menu import set_bing_gpt_menu
22-
23-
if TYPE_CHECKING:
24-
from automation_ide.automation_editor_ui.editor_main.main_ui import AutomationEditor
24+
from automation_ide.automation_editor_ui.menu.automation_menu.test_pioneer_menu.build_test_pioneer_menu import \
25+
set_test_pioneer_menu
2526

2627
from je_editor import language_wrapper
2728

@@ -37,6 +38,6 @@ def add_menu_to_menubar(ui_we_want_to_set: AutomationEditor):
3738
set_load_density_menu(ui_we_want_to_set)
3839
set_mail_thunder_menu(ui_we_want_to_set)
3940
set_web_runner_menu(ui_we_want_to_set)
41+
set_test_pioneer_menu(ui_we_want_to_set)
4042
build_automation_install_menu(ui_we_want_to_set)
4143
build_tool_install_menu(ui_we_want_to_set)
42-
set_bing_gpt_menu(ui_we_want_to_set)

automation_ide/automation_editor_ui/menu/tools_menu/bing_gpt_menu/build_bing_gpt_menu.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

automation_ide/automation_editor_ui/syntax/syntax_extend.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
from pathlib import Path
43
from typing import TYPE_CHECKING
54

65
from je_editor import EditorWidget
@@ -27,6 +26,15 @@ def syntax_extend_package(main_window: AutomationEditor) -> None:
2726
}
2827
}
2928
)
29+
syntax_extend_setting_dict.update({".yml": {}})
30+
syntax_extend_setting_dict.get(".yml").update(
31+
{
32+
"test_pioneer": {
33+
"words": set(package_keyword_list.get("test_pioneer")),
34+
"color": QColor(255, 153, 0)
35+
}
36+
}
37+
)
3038
widget = main_window.tab_widget.currentWidget()
3139
if isinstance(widget, EditorWidget):
3240
widget.code_edit.reset_highlighter()

automation_ide/automation_editor_ui/syntax/syntax_keyword.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,22 @@
142142
"add_command_to_executor", "create_project_dir"
143143
]
144144

145+
test_pioneer_keys: list = [
146+
"jobs", "pioneer_log",
147+
"steps",
148+
"name",
149+
"run", "with", "run_folder",
150+
"wait",
151+
"open_url",
152+
"open_program", "close_program", "redirect_stdout", "redirect_stderr",
153+
]
154+
145155
package_keyword_list = {
146156
"je_auto_control": auto_control_keys,
147157
"je_load_density": load_density_keys,
148158
"je_api_testka": api_testka_keys,
149159
"je_web_runner": web_runner_keys,
150160
"automation_file": automation_file_keys,
151161
"mail_thunder": mail_thunder_keys,
162+
"test_pioneer": test_pioneer_keys
152163
}

automation_ide/extend/process_executor/process_executor_utils.py

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

99
from automation_ide.automation_editor_ui.show_code_window.code_window import CodeWindow
1010
from automation_ide.extend.mail_thunder_extend.mail_thunder_setting import send_after_test
11-
from automation_ide.extend.process_executor.task_process_manager import TaskProcessManager
11+
from automation_ide.extend.process_executor.python_task_process_manager import TaskProcessManager
1212
from automation_ide.utils.exception.exception_tags import wrong_test_data_format_exception_tag
1313
from automation_ide.utils.exception.exceptions import ITETestExecutorException
1414

0 commit comments

Comments
 (0)