Skip to content

Commit 958d864

Browse files
authored
Merge pull request #24 from Intergration-Automation-Testing/dev
Dev
2 parents ea373fc + 4ab3b5e commit 958d864

File tree

211 files changed

+9439
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+9439
-464
lines changed

.idea/Integration-testing-environment.iml

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

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import sys
22

33
from PySide6.QtWidgets import QApplication
4-
from je_editor import EditorMain
4+
from je_editor import EditorMain, shell_manager
55
from qt_material import apply_stylesheet
66

77
from automation_editor.automation_editor_ui. \
88
menu.api_testka_menu.build_api_testka_menu import set_apitestka_menu
99
from automation_editor.automation_editor_ui. \
1010
menu.auto_control_menu.build_autocontrol_menu import set_autocontrol_menu
11+
from automation_editor.automation_editor_ui.menu.install_menu.build_install_menu import set_install_menu
1112
from automation_editor.automation_editor_ui.menu. \
1213
load_density_menu.build_load_density_menu import set_load_density_menu
1314
from automation_editor.automation_editor_ui \
@@ -16,7 +17,7 @@
1617
syntax_extend_package
1718

1819

19-
class ITE(EditorMain):
20+
class AutomationEditor(EditorMain):
2021

2122
def __init__(self):
2223
super().__init__()
@@ -26,13 +27,20 @@ def __init__(self):
2627
set_apitestka_menu(self)
2728
set_load_density_menu(self)
2829
set_web_runner_menu(self)
30+
set_install_menu(self)
2931
syntax_extend_package(self)
30-
self.setWindowTitle("ITE & RPA")
32+
shell_manager.main_window = self
33+
shell_manager.later_init()
34+
self.setWindowTitle("Automation Editor")
3135

3236

3337
def start_editor():
3438
new_editor = QApplication(sys.argv)
35-
window = ITE()
39+
window = AutomationEditor()
3640
apply_stylesheet(new_editor, theme='dark_amber.xml')
37-
window.show()
41+
window.showMaximized()
42+
try:
43+
window.startup_setting()
44+
except Exception as error:
45+
print(repr(error))
3846
sys.exit(new_editor.exec())

automation_editor/automation_editor_ui/menu/api_testka_menu/build_api_testka_menu.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ def create_project():
9191
package = package_manager.installed_package_dict.get("je_api_testka", None)
9292
if package is not None:
9393
package.create_project_dir()
94+

automation_editor/automation_editor_ui/menu/install_menu/__init__.py

Whitespace-only changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import os
2+
import shutil
3+
import sys
4+
from pathlib import Path
5+
6+
from PySide6.QtGui import QAction
7+
from PySide6.QtWidgets import QMainWindow
8+
from je_editor import shell_manager
9+
10+
11+
def set_install_menu(ui_we_want_to_set: QMainWindow):
12+
ui_we_want_to_set.install_menu = ui_we_want_to_set.menu.addMenu("Install")
13+
# Try to install Build Tools
14+
ui_we_want_to_set.install_tool_action = QAction("Install Build Tools")
15+
ui_we_want_to_set.install_tool_action.triggered.connect(
16+
install_build_tools
17+
)
18+
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_tool_action)
19+
# Try to install AutoControl
20+
ui_we_want_to_set.install_autocontrol_action = QAction("Install AutoControl")
21+
ui_we_want_to_set.install_autocontrol_action.triggered.connect(
22+
install_autocontrol
23+
)
24+
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_autocontrol_action)
25+
# Try to install APITestka
26+
ui_we_want_to_set.install_api_testka = QAction("Install APITestka")
27+
ui_we_want_to_set.install_api_testka.triggered.connect(
28+
install_api_testka
29+
)
30+
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_api_testka)
31+
# Try to install LoadDensity
32+
ui_we_want_to_set.install_load_density_action = QAction("Install LoadDensity")
33+
ui_we_want_to_set.install_load_density_action.triggered.connect(
34+
install_load_density
35+
)
36+
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_load_density_action)
37+
# Try to install WebRunner
38+
ui_we_want_to_set.install_web_runner_action = QAction("Install WebRunner")
39+
ui_we_want_to_set.install_web_runner_action.triggered.connect(
40+
install_web_runner
41+
)
42+
ui_we_want_to_set.install_menu.addAction(ui_we_want_to_set.install_web_runner_action)
43+
44+
45+
def install_package(package_text: str):
46+
if sys.platform in ["win32", "cygwin", "msys"]:
47+
venv_path = Path(os.getcwd() + "/venv/Scripts")
48+
else:
49+
venv_path = Path(os.getcwd() + "/venv/bin")
50+
if venv_path.is_dir() and venv_path.exists():
51+
compiler_path = shutil.which(
52+
cmd="python3",
53+
path=str(venv_path)
54+
)
55+
else:
56+
compiler_path = shutil.which(cmd="python3")
57+
if compiler_path is None:
58+
compiler_path = shutil.which(
59+
cmd="python",
60+
path=str(venv_path)
61+
)
62+
else:
63+
compiler_path = shutil.which(cmd="python")
64+
shell_manager.exec_shell(f"{compiler_path} -m pip install {package_text}")
65+
66+
67+
def install_build_tools():
68+
install_package("setuptools build wheel")
69+
70+
71+
def install_autocontrol():
72+
install_package("je_auto_control")
73+
74+
75+
def install_api_testka():
76+
install_package("je_api_testka")
77+
78+
79+
def install_load_density():
80+
install_package("je_load_density")
81+
82+
83+
def install_web_runner():
84+
install_package("je_web_runner")

automation_editor/automation_editor_ui/menu/load_density_menu/build_load_density_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ def open_web_browser(url: str):
9191
def create_project():
9292
package = package_manager.installed_package_dict.get("je_load_density", None)
9393
if package is not None:
94-
package.create_project_dir()
94+
package.create_project_dir()

automation_editor/utils/exception/exception_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# ui exception
1919
wrong_test_data_format_exception_tag: str = "get the wrong test data format"
2020
# exec exception
21-
exec_error: str = "ITE exec error"
21+
exec_error: str = "AutomationEditor exec error"
2222
file_not_fond_error: str = "File not found"
2323
compiler_not_found_error: str = "Compiler not found"
2424
not_install_package_error: str = "not install required package"

automation_editor/utils/file_process/get_dir_file_list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
import tkinter.filedialog
32
from os import getcwd
43
from os import walk
54
from os.path import abspath

0 commit comments

Comments
 (0)