diff --git a/MangoActuator/requirements.txt b/MangoActuator/requirements.txt index cd350de1..93172e82 100644 --- a/MangoActuator/requirements.txt +++ b/MangoActuator/requirements.txt @@ -3,17 +3,21 @@ uiautomator2==3.2.5 pywinauto==0.6.8 uiautodev==0.5.0 locust==2.27.0 + mangokit==1.3.3 mangoui==3.0.14 + websockets==10.4 websocket-client==1.5.1 assertpy==1.1 +deepdiff==8.0.1 +adbutils==2.7.0 +gevent==24.2.1 + pyinstaller==6.11.1 retrying==1.3.4 Pympler==1.0.1 psutil==5.9.5 -adbutils==2.7.0 -gevent==24.2.1 -deepdiff==8.0.1 + diff --git a/MangoActuator/src/network/http/http_client.py b/MangoActuator/src/network/http/http_client.py index d29443a3..4ab6bd9e 100644 --- a/MangoActuator/src/network/http/http_client.py +++ b/MangoActuator/src/network/http/http_client.py @@ -13,26 +13,26 @@ from src.exceptions import ERROR_MSG_0007, ToolsError from src.network.http.http_base import HttpBase from src.tools import project_dir from src.tools.log_collector import log - +from src.settings.settings import IS_MINIO class HttpClientApi(HttpBase): @classmethod def download_file(cls, file_name): - response = requests.get(urljoin(cls.get_host(), f'files/{file_name}'), cls.headers) - file_path = project_dir.upload() - try: - with open(fr'{file_path}\{file_name}', 'wb') as f: - f.write(response.content) - except FileNotFoundError: - raise ToolsError(*ERROR_MSG_0007) + if IS_MINIO: + pass + else: + response = requests.get(urljoin(cls.get_host(), f'test_file/{file_name}'), cls.headers) + file_path = project_dir.upload() + try: + with open(fr'{file_path}\{file_name}', 'wb') as f: + f.write(response.content) + except FileNotFoundError: + raise ToolsError(*ERROR_MSG_0007) @classmethod - def upload_file(cls, project_product_id: int, file_path: str, file_name: str): - file_size = os.path.getsize(file_path) + def upload_file(cls, file_path: str, file_name: str): data = { 'type': ClientTypeEnum.ACTUATOR.value, - 'project_product_id': project_product_id, - 'price': file_size, 'name': file_name } files = [ diff --git a/MangoActuator/src/pages/config/test_file/test_file.py b/MangoActuator/src/pages/config/test_file/test_file.py index a1a15b2f..128a0ff5 100644 --- a/MangoActuator/src/pages/config/test_file/test_file.py +++ b/MangoActuator/src/pages/config/test_file/test_file.py @@ -46,7 +46,7 @@ class TestFilePage(TableParent): file_size = os.path.getsize(file_name) file_name_only = os.path.basename(file_name) files = [ - ('file', (file_name_only, open(file_name, 'rb'), 'application/octet-stream')) # 根据文件类型设置 MIME 类型 + ('test_file', (file_name_only, open(file_name, 'rb'), 'application/octet-stream')) # 根据文件类型设置 MIME 类型 ] response = self.post({ 'type': 0, diff --git a/MangoActuator/src/pages/config/test_file/test_file_dict.py b/MangoActuator/src/pages/config/test_file/test_file_dict.py index c1f0690f..1b062a03 100644 --- a/MangoActuator/src/pages/config/test_file/test_file_dict.py +++ b/MangoActuator/src/pages/config/test_file/test_file_dict.py @@ -23,19 +23,10 @@ table_column = [ 'name': 'ID', 'width': 7 }, - { - 'key': 'project', - 'name': '项目名称', - 'width': 100 - }, + { 'key': 'name', 'name': '文件名称', - 'width': 150 - }, - { - 'key': 'file', - 'name': '文件地址', }, { 'key': 'ope', diff --git a/MangoActuator/src/services/ui/bases/__init__.py b/MangoActuator/src/services/ui/bases/__init__.py index 80cb7f27..103a3ed2 100644 --- a/MangoActuator/src/services/ui/bases/__init__.py +++ b/MangoActuator/src/services/ui/bases/__init__.py @@ -6,6 +6,7 @@ import traceback from mangokit import MangoKitError from playwright._impl._errors import TargetClosedError, Error, TimeoutError + from src.enums.tools_enum import StatusEnum from src.enums.ui_enum import ElementOperationEnum, DriveTypeEnum from src.exceptions import * @@ -13,7 +14,6 @@ from src.models.ui_model import ElementResultModel, ElementModel from src.network import HTTP from src.services.ui.bases.android import AndroidDriver from src.services.ui.bases.web import WebDevice -from src.settings import settings from src.tools import project_dir from src.tools.decorator.memory import async_memory from src.tools.log_collector import log @@ -280,4 +280,4 @@ class ElementOperation(WebDevice, AndroidDriver): pass case _: log.error('自动化类型不存在,请联系管理员检查!') - HTTP.not_auth.upload_file(self.project_product_id, file_path, file_name) + HTTP.not_auth.upload_file(file_path, file_name) diff --git a/MangoActuator/src/settings/settings.py b/MangoActuator/src/settings/settings.py index 98bd1422..ed9504c3 100644 --- a/MangoActuator/src/settings/settings.py +++ b/MangoActuator/src/settings/settings.py @@ -4,31 +4,28 @@ from mango_ui import AppConfig, MenusModel from src.tools import project_dir -# ****************************************** DEBUG ****************************************** # -IS_DEBUG = False - -# ************************************** 是否弹出首页弹窗 ************************************** # -IS_WINDOW = True - -# ***************************************** 内存阈值 ***************************************** # - -MEMORY_THRESHOLD = 100 # 控制内存高于多少就不可以执行用例,防止崩溃 -LOOP_MIX = 10 # 最大检查内存次数 - -# ************************************* 找不到元素循环次数 ************************************* # - -FAILED_RETRY_TIME = 10 # 秒 -RETRY_WAITING_TIME = 0.2 # 每隔多少秒重新一次 - # **************************************** 下面不用管 **************************************** # - IP = None PORT = None USERNAME = None PASSWORD = None - with open(project_dir.resource_path('src/settings/settings.json'), "r", encoding='utf-8') as f: STYLE = AppConfig(**json.loads(f.read())) - with open(project_dir.resource_path('src/settings/menus.json'), "r", encoding='utf-8') as f: MENUS = MenusModel(**json.loads(f.read())) +# **************************************** 上面不用管 **************************************** # + +# ****************************************** DEBUG ****************************************** # +IS_DEBUG = False +# ************************************** 是否弹出首页弹窗 ************************************** # +IS_WINDOW = True +# ************************************* 找不到元素循环次数 ************************************* # +FAILED_RETRY_TIME = 10 # 秒 +RETRY_WAITING_TIME = 0.2 # 每隔多少秒重新一次 +# **************************************** 文件资源路径 **************************************** # +IS_MINIO = False +FILE_PATH = IP # 配置IP则代表你没有minio,如果有minio则配置mini的IP和端口 +# ***************************************** 内存阈值 ***************************************** # +# 现在没有用到这个配置 +MEMORY_THRESHOLD = 100 # 控制内存高于多少就不可以执行用例,防止崩溃 +LOOP_MIX = 10 # 最大检查内存次数 diff --git a/MangoActuator/tests/ope_json.json b/MangoActuator/tests/ope_json.json index ef4c02ec..32ca0702 100644 --- a/MangoActuator/tests/ope_json.json +++ b/MangoActuator/tests/ope_json.json @@ -1,1376 +1 @@ -[ - { - "uiautomator_operation_method": [ - { - "value": "UiautomatorApplication", - "label": "应用操作", - "children": [ - { - "value": "a_app_stop_all", - "label": "停止所有app", - "parameter": {} - }, - { - "value": "a_app_stop_appoint", - "label": "停止除指定app外所有app", - "parameter": { - "package_name_list": "" - } - }, - { - "value": "a_clear_app", - "label": "清除app数据", - "parameter": { - "package_name": "" - } - }, - { - "value": "a_close_app", - "label": "关闭应用", - "parameter": { - "package_name": "" - } - }, - { - "value": "a_start_app", - "label": "启动应用", - "parameter": { - "package_name": "" - } - } - ] - }, - { - "value": "UiautomatorElement", - "label": "元素操作", - "children": [ - { - "value": "a_clear_text", - "label": "清空输入框", - "parameter": { - "locating": "" - } - }, - { - "value": "a_click", - "label": "元素单击", - "parameter": { - "locating": "" - } - }, - { - "value": "a_click_coord", - "label": "坐标单击", - "parameter": { - "x": "", - "y": "" - } - }, - { - "value": "a_double_click", - "label": "元素双击", - "parameter": { - "locating": "" - } - }, - { - "value": "a_double_click_coord", - "label": "坐标双击", - "parameter": { - "x": "", - "y": "" - } - }, - { - "value": "a_drag_to_coord", - "label": "拖动元素到坐标上", - "parameter": { - "locating": "", - "x": "", - "y": "" - } - }, - { - "value": "a_drag_to_ele", - "label": "拖动A元素到达B元素上", - "parameter": { - "locating": "", - "locating2": "" - } - }, - { - "value": "a_element_screenshot", - "label": "元素截图", - "parameter": { - "locating": "", - "path": "" - } - }, - { - "value": "a_get_center", - "label": "提取元素坐标", - "parameter": { - "locating": "", - "x_key": "", - "y_key": "" - } - }, - { - "value": "a_get_text", - "label": "获取元素文本", - "parameter": { - "locating": "", - "set_cache_key": "" - } - }, - { - "value": "a_input", - "label": "单击输入", - "parameter": { - "locating": "", - "text": "" - } - }, - { - "value": "a_long_click", - "label": "长按元素", - "parameter": { - "locating": "", - "time_": "" - } - }, - { - "value": "a_pinch_in", - "label": "元素缩小", - "parameter": { - "locating": "" - } - }, - { - "value": "a_pinch_out", - "label": "元素放大", - "parameter": { - "locating": "" - } - }, - { - "value": "a_set_text", - "label": "设置文本", - "parameter": { - "locating": "", - "text": "" - } - }, - { - "value": "a_swipe_ele", - "label": "元素内向下滑动", - "parameter": { - "locating": "" - } - }, - { - "value": "a_swipe_left", - "label": "元素内向左滑动", - "parameter": { - "locating": "" - } - }, - { - "value": "a_swipe_right", - "label": "元素内向右滑动", - "parameter": { - "locating": "" - } - }, - { - "value": "a_swipe_up", - "label": "元素内向上滑动", - "parameter": { - "locating": "" - } - }, - { - "value": "a_wait", - "label": "等待元素出现", - "parameter": { - "locating": "", - "time_": "" - } - }, - { - "value": "a_wait_gone", - "label": "等待元素消失", - "parameter": { - "locating": "", - "time_": "" - } - } - ] - }, - { - "value": "UiautomatorEquipment", - "label": "设备操作", - "children": [ - { - "value": "a_get_window_size", - "label": "提取屏幕尺寸", - "parameter": {} - }, - { - "value": "a_press_back", - "label": "按back键", - "parameter": {} - }, - { - "value": "a_press_camera", - "label": "按camera键", - "parameter": {} - }, - { - "value": "a_press_center", - "label": "按center键", - "parameter": {} - }, - { - "value": "a_press_delete", - "label": "按delete键", - "parameter": {} - }, - { - "value": "a_press_down", - "label": "按down键", - "parameter": {} - }, - { - "value": "a_press_enter", - "label": "按enter键", - "parameter": {} - }, - { - "value": "a_press_home", - "label": "按home键", - "parameter": {} - }, - { - "value": "a_press_left", - "label": "按left键", - "parameter": {} - }, - { - "value": "a_press_menu", - "label": "按menu键", - "parameter": {} - }, - { - "value": "a_press_power", - "label": "按power键", - "parameter": {} - }, - { - "value": "a_press_recent", - "label": "按recent键", - "parameter": {} - }, - { - "value": "a_press_right", - "label": "按right键", - "parameter": {} - }, - { - "value": "a_press_search", - "label": "按search键", - "parameter": {} - }, - { - "value": "a_press_up", - "label": "按up键", - "parameter": {} - }, - { - "value": "a_press_volume_down", - "label": "按volume_down键", - "parameter": {} - }, - { - "value": "a_press_volume_mute", - "label": "按volume_mute键", - "parameter": {} - }, - { - "value": "a_press_volume_up", - "label": "按volume_up键", - "parameter": {} - }, - { - "value": "a_pull", - "label": "提取文件-未测试", - "parameter": { - "feli_path": "", - "catalogue": "" - } - }, - { - "value": "a_push", - "label": "推送一个文件-未测试", - "parameter": { - "feli_path": "", - "catalogue": "" - } - }, - { - "value": "a_screen_off", - "label": "关闭屏幕", - "parameter": {} - }, - { - "value": "a_screen_on", - "label": "打开屏幕", - "parameter": {} - }, - { - "value": "a_sleep", - "label": "强制等待", - "parameter": { - "time_": "" - } - }, - { - "value": "a_swipe_left", - "label": "获取屏幕开关状态", - "parameter": {} - }, - { - "value": "a_unlock", - "label": "解锁屏幕", - "parameter": {} - } - ] - }, - { - "value": "UiautomatorPage", - "label": "页面操作", - "children": [ - { - "value": "a_drag", - "label": "坐标拖动", - "parameter": { - "sx": "", - "sy": "", - "ex": "", - "ey": "" - } - }, - { - "value": "a_dump_hierarchy", - "label": "获取转储的内容", - "parameter": {} - }, - { - "value": "a_freeze_rotation", - "label": "冻结旋转", - "parameter": {} - }, - { - "value": "a_freeze_rotation_false", - "label": "取消冻结旋转", - "parameter": {} - }, - { - "value": "a_long_click", - "label": "长按屏幕3秒", - "parameter": { - "x": "", - "y": "", - "time_": "" - } - }, - { - "value": "a_open_notification", - "label": "打开通知", - "parameter": {} - }, - { - "value": "a_open_quick_settings", - "label": "打开快速设置", - "parameter": {} - }, - { - "value": "a_screenshot", - "label": "屏幕截图", - "parameter": { - "filepath": "" - } - }, - { - "value": "a_set_orientation_left", - "label": "设置为natural", - "parameter": {} - }, - { - "value": "a_set_orientation_natural", - "label": "设置为natural", - "parameter": {} - }, - { - "value": "a_set_orientation_right", - "label": "设置为right", - "parameter": {} - }, - { - "value": "a_set_orientation_upsidedown", - "label": "设置为upsidedown", - "parameter": {} - }, - { - "value": "a_swipe", - "label": "坐标滑动", - "parameter": { - "sx": "", - "sy": "", - "ex": "", - "ey": "" - } - }, - { - "value": "a_swipe_down", - "label": "下滑", - "parameter": {} - }, - { - "value": "a_swipe_left", - "label": "左滑", - "parameter": {} - }, - { - "value": "a_swipe_right", - "label": "右滑", - "parameter": {} - }, - { - "value": "a_swipe_up", - "label": "上滑", - "parameter": {} - } - ] - } - ] - }, - { - "playwright_operation_method": [ - { - "value": "PlaywrightElement", - "label": "元素操作", - "children": [ - { - "value": "w_click", - "label": "元素单击", - "parameter": { - "locating": "" - } - }, - { - "value": "w_click_upload_files", - "label": "点击并选择文件上传", - "parameter": { - "locating": "", - "file_path": "" - } - }, - { - "value": "w_dblclick", - "label": "元素双击", - "parameter": { - "locating": "" - } - }, - { - "value": "w_download", - "label": "下载文件", - "parameter": { - "locating": "", - "save_path": "" - } - }, - { - "value": "w_drag_down_pixel", - "label": "往下拖动N个像素", - "parameter": { - "locating": "", - "n": "" - } - }, - { - "value": "w_drag_left_pixel", - "label": "往左拖动N个像素", - "parameter": { - "locating": "", - "n": "" - } - }, - { - "value": "w_drag_right_pixel", - "label": "往右拖动N个像素", - "parameter": { - "locating": "", - "n": "" - } - }, - { - "value": "w_drag_to", - "label": "拖动A元素到达B", - "parameter": { - "locating1": "", - "locating2": "" - } - }, - { - "value": "w_drag_up_pixel", - "label": "往上拖动N个像素", - "parameter": { - "locating": "", - "n": "" - } - }, - { - "value": "w_force_click", - "label": "强制单击", - "parameter": { - "locating": "" - } - }, - { - "value": "w_get_text", - "label": "获取元素文本", - "parameter": { - "locating": "", - "set_cache_key": "" - } - }, - { - "value": "w_input", - "label": "元素输入", - "parameter": { - "locating": "", - "input_value": "" - } - }, - { - "value": "w_time_click", - "label": "循环点击N秒", - "parameter": { - "locating": "", - "n": "" - } - }, - { - "value": "w_upload_files", - "label": "拖拽文件上传", - "parameter": { - "locating": "", - "file_path": "" - } - } - ] - }, - { - "value": "PlaywrightDeviceInput", - "label": "输入设备操作", - "children": [ - { - "value": "w_hover", - "label": "鼠标悬停", - "parameter": { - "locating": "" - } - }, - { - "value": "w_keyboard_delete_text", - "label": "删除光标左侧的字符", - "parameter": { - "count": "" - } - }, - { - "value": "w_keyboard_insert_text", - "label": "直接输入文字", - "parameter": { - "text": "" - } - }, - { - "value": "w_keyboard_type_text", - "label": "模拟输入文字", - "parameter": { - "text": "" - } - }, - { - "value": "w_keys", - "label": "模拟按下指定的键", - "parameter": { - "keyboard": "" - } - }, - { - "value": "w_mouse_center", - "label": "移动鼠标到浏览器中间", - "parameter": {} - }, - { - "value": "w_mouse_click", - "label": "鼠标点击坐标", - "parameter": { - "x": "", - "y": "" - } - }, - { - "value": "w_wheel", - "label": "鼠标上下滚动像素,负数代表向上", - "parameter": { - "y": "" - } - } - ] - }, - { - "value": "PlaywrightBrowser", - "label": "浏览器操作", - "children": [ - { - "value": "w_alert", - "label": "设置弹窗不予处理", - "parameter": {} - }, - { - "value": "w_ele_screenshot", - "label": "元素截图", - "parameter": { - "locating": "", - "path": "" - } - }, - { - "value": "w_get_cookie", - "label": "测试-获取storage_state保存到logs目录", - "parameter": {} - }, - { - "value": "w_goto", - "label": "打开URL", - "parameter": { - "url": "" - } - }, - { - "value": "w_screenshot", - "label": "整个页面截图", - "parameter": { - "path": "", - "full_page": "" - } - }, - { - "value": "w_set_cookie", - "label": "设置storage_state(cookie)", - "parameter": { - "storage_state": "" - } - }, - { - "value": "w_wait_for_timeout", - "label": "强制等待", - "parameter": { - "_time": "" - } - } - ] - }, - { - "value": "PlaywrightPage", - "label": "页面操作", - "children": [ - { - "value": "open_new_tab_and_switch", - "label": "点击并打开新页签", - "parameter": { - "locating": "" - } - }, - { - "value": "w_close_current_tab", - "label": "关闭当前页签", - "parameter": {} - }, - { - "value": "w_switch_tabs", - "label": "切换页签", - "parameter": { - "individual": "" - } - } - ] - }, - { - "value": "PlaywrightCustomization", - "label": "定制开发", - "children": [ - { - "value": "w_click_right_coordinate", - "label": "CDP定开-总和坐标点击", - "parameter": { - "locating": "" - } - }, - { - "value": "w_list_input", - "label": "DESK定开-列表输入", - "parameter": { - "locating": "", - "input_list_value": "", - "element_loc": "" - } - } - ] - } - ] - }, - { - "playwright_assertion_method": [ - { - "value": "PlaywrightAssertion", - "label": "元素断言", - "children": [ - { - "value": "w_not_to_be_editable", - "label": "元素已启用", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_be_empty", - "label": "元素不为空", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_be_enabled", - "label": "元素不启用", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_be_focused", - "label": "元素不聚焦", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_be_hidden", - "label": "元素不可隐藏", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_be_in_viewport", - "label": "元素不在视窗中", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_be_visible", - "label": "元素不可见", - "parameter": { - "actual": "" - } - }, - { - "value": "w_not_to_contain_text", - "label": "元素不包含文本", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "w_not_to_have_class", - "label": "元素没有阶级", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "w_to_be_checked", - "label": "复选框已选中", - "parameter": { - "actual": "" - } - }, - { - "value": "w_to_be_disabled", - "label": "元素已禁用", - "parameter": { - "actual": "" - } - }, - { - "value": "w_to_be_empty", - "label": "元素为空", - "parameter": { - "actual": "" - } - }, - { - "value": "w_to_be_visible", - "label": "元素可见", - "parameter": { - "actual": "" - } - }, - { - "value": "w_to_element_count", - "label": "元素是否存在,存在传1,不存在传0", - "parameter": { - "actual": "", - "count": "" - } - }, - { - "value": "w_to_element_exists", - "label": "元素是存在", - "parameter": { - "actual": "" - } - }, - { - "value": "w_to_element_not_exists", - "label": "元素不存在", - "parameter": { - "actual": "" - } - }, - { - "value": "w_to_have_count", - "label": "元素计数", - "parameter": { - "actual": "", - "expect": "" - } - } - ] - } - ] - }, - { - "public_assertion_method": [ - { - "value": "WhatIsItAssertion", - "label": "是什么", - "children": [ - { - "value": "p_is_alpha", - "label": "是字母", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_digit", - "label": "是数字", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_empty", - "label": "是空字符串", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_false", - "label": "是false", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_none", - "label": "是null", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_not_empty", - "label": "不是空符串", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_not_none", - "label": "不是null", - "parameter": { - "actual": "" - } - }, - { - "value": "p_is_true", - "label": "是true", - "parameter": { - "actual": "" - } - } - ] - }, - { - "value": "ContainAssertion", - "label": "包含什么", - "children": [ - { - "value": "p_contains", - "label": "包含expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_contains_ignoring_case", - "label": "包含忽略大小写expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_contains_only", - "label": "仅包含expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_does_not_contain", - "label": "不包含expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_is_equal_to_ignoring_case", - "label": "忽略大小写等于expect", - "parameter": { - "actual": "", - "expect": "" - } - } - ] - }, - { - "value": "MatchingAssertion", - "label": "匹配什么", - "children": [ - { - "value": "p_does_not_match", - "label": "正则不匹配expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_ends_with", - "label": "以expect结尾", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_is_in", - "label": "在expect里面", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_is_not_in", - "label": "不在expect里面", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_matches", - "label": "正则匹配等于expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_starts_with", - "label": "以expect开头", - "parameter": { - "actual": "", - "expect": "" - } - } - ] - }, - { - "value": "WhatIsEqualToAssertion", - "label": "等于什么", - "children": [ - { - "value": "p_is_equal_to", - "label": "等于expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_is_length", - "label": "长度等于expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_is_not_equal_to", - "label": "不等于expect", - "parameter": { - "actual": "", - "expect": "" - } - }, - { - "value": "p_sum_equal_expect", - "label": "长度等于expect", - "parameter": { - "actual": "", - "expect": "" - } - } - ] - } - ] - }, - { - "uiautomator_assertion_method": [ - { - "value": "UiautomatorAssertion", - "label": "元素断言", - "children": [ - { - "value": "a_assert_ele_attribute", - "label": "断言元素属性", - "parameter": { - "locating": "", - "attribute": "", - "assertion": "", - "expect": "" - } - }, - { - "value": "a_assert_ele_center", - "label": "断言元素位置", - "parameter": { - "locating": "", - "assertion": "", - "expect": "" - } - }, - { - "value": "a_assert_ele_exists", - "label": "断言元素存在", - "parameter": { - "locating": "", - "assertion": "", - "expect": "" - } - }, - { - "value": "a_assert_ele_text", - "label": "断言元素文本", - "parameter": { - "locating": "", - "assertion": "", - "expect": "" - } - }, - { - "value": "a_assert_ele_x", - "label": "断言元素X坐标", - "parameter": { - "locating": "", - "assertion": "", - "expect": "" - } - }, - { - "value": "a_assert_ele_y", - "label": "断言元素Y坐标", - "parameter": { - "locating": "", - "assertion": "", - "expect": "" - } - } - ] - } - ] - }, - { - "sql_assertion_method": [ - { - "value": "SqlAssertion", - "label": "sql断言", - "children": [ - { - "value": "sql_is_equal", - "label": "值相等", - "parameter": { - "sql": "", - "expect": "" - } - } - ] - } - ] - }, - { - "assertion_method": [ - { - "title": "是什么", - "func_list": [ - { - "label": "p_is_alpha", - "value": "是字母" - }, - { - "label": "p_is_digit", - "value": "是数字" - }, - { - "label": "p_is_empty", - "value": "是空字符串" - }, - { - "label": "p_is_false", - "value": "是false" - }, - { - "label": "p_is_none", - "value": "是null" - }, - { - "label": "p_is_not_empty", - "value": "不是空符串" - }, - { - "label": "p_is_not_none", - "value": "不是null" - }, - { - "label": "p_is_true", - "value": "是true" - } - ] - }, - { - "title": "包含什么", - "func_list": [ - { - "label": "p_contains", - "value": "包含expect" - }, - { - "label": "p_contains_ignoring_case", - "value": "包含忽略大小写expect" - }, - { - "label": "p_contains_only", - "value": "仅包含expect" - }, - { - "label": "p_does_not_contain", - "value": "不包含expect" - }, - { - "label": "p_is_equal_to_ignoring_case", - "value": "忽略大小写等于expect" - } - ] - }, - { - "title": "匹配什么", - "func_list": [ - { - "label": "p_does_not_match", - "value": "正则不匹配expect" - }, - { - "label": "p_ends_with", - "value": "以expect结尾" - }, - { - "label": "p_is_in", - "value": "在expect里面" - }, - { - "label": "p_is_not_in", - "value": "不在expect里面" - }, - { - "label": "p_matches", - "value": "正则匹配等于expect" - }, - { - "label": "p_starts_with", - "value": "以expect开头" - } - ] - }, - { - "title": "等于什么", - "func_list": [ - { - "label": "p_is_equal_to", - "value": "等于expect" - }, - { - "label": "p_is_length", - "value": "长度等于expect" - }, - { - "label": "p_is_not_equal_to", - "value": "不等于expect" - }, - { - "label": "p_sum_equal_expect", - "value": "长度等于expect" - } - ] - }, - { - "title": "WEB元素断言", - "func_list": [ - { - "label": "w_not_to_be_editable", - "value": "元素已启用" - }, - { - "label": "w_not_to_be_empty", - "value": "元素不为空" - }, - { - "label": "w_not_to_be_enabled", - "value": "元素不启用" - }, - { - "label": "w_not_to_be_focused", - "value": "元素不聚焦" - }, - { - "label": "w_not_to_be_hidden", - "value": "元素不可隐藏" - }, - { - "label": "w_not_to_be_in_viewport", - "value": "元素不在视窗中" - }, - { - "label": "w_not_to_be_visible", - "value": "元素不可见" - }, - { - "label": "w_not_to_contain_text", - "value": "元素不包含文本" - }, - { - "label": "w_not_to_have_class", - "value": "元素没有阶级" - }, - { - "label": "w_to_be_checked", - "value": "复选框已选中" - }, - { - "label": "w_to_be_disabled", - "value": "元素已禁用" - }, - { - "label": "w_to_be_empty", - "value": "元素为空" - }, - { - "label": "w_to_be_visible", - "value": "元素可见" - }, - { - "label": "w_to_element_count", - "value": "元素是否存在,存在传1,不存在传0" - }, - { - "label": "w_to_element_exists", - "value": "元素是存在" - }, - { - "label": "w_to_element_not_exists", - "value": "元素不存在" - }, - { - "label": "w_to_have_count", - "value": "元素计数" - } - ] - }, - { - "title": "安卓元素断言", - "func_list": [ - { - "label": "a_assert_ele_attribute", - "value": "断言元素属性" - }, - { - "label": "a_assert_ele_center", - "value": "断言元素位置" - }, - { - "label": "a_assert_ele_exists", - "value": "断言元素存在" - }, - { - "label": "a_assert_ele_text", - "value": "断言元素文本" - }, - { - "label": "a_assert_ele_x", - "value": "断言元素X坐标" - }, - { - "label": "a_assert_ele_y", - "value": "断言元素Y坐标" - } - ] - } - ] - } -] \ No newline at end of file +[{"line_num":0,"value":"【${account_name}  】的数据报告","filter":[{}]},{"line_num":1,"value":"报告周期: ${period}           ","filter":[{}]},{"line_num":2,"value":"消耗: ${fee}           ","filter":[{}]},{"line_num":3,"value":"平均点击成本: ${acp}           ","filter":[{}]},{"line_num":4,"value":"总互动: ${interaction}          ","filter":[{}]},{"line_num":5,"value":"点赞: ${like}          ","filter":[{}]},{"line_num":6,"value":"收藏: ${collect}          ","filter":[{}]},{"line_num":7,"value":"评论:${comment}          ","filter":[{}]},{"line_num":8,"value":"赞藏评cpe:${cost_per_engagement} ","filter":[{}]},{"line_num":9,"value":"点赞成本: ${like_cost}          ","filter":[{}]},{"line_num":10,"value":"","filter":[]},{"line_num":11,"value":"【信息流点击】数据","filter":[]},{"line_num":12,"value":"消费:${fee}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":13,"value":"平均点击成本: ${acp}           ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":14,"value":"总互动:  ${interaction}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":15,"value":" 点赞: ${like}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":16,"value":" 收藏: ${collect}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":17,"value":" 评论:${comment}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":18,"value":" 赞藏评cpe:${cost_per_engagement} ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":19,"value":"点赞成本:${like_cost} ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["点手"]}]}]},{"line_num":20,"value":"","filter":[]},{"line_num":21,"value":"【信息流互动点击】数据","filter":[]},{"line_num":22,"value":" 消费: ${fee}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":23,"value":"平均点击成本:${acp}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":24,"value":"总互动:${interaction}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":25,"value":"点赞:${like}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":26,"value":"收藏:${collect}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":27,"value":"评论:${comment}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":28,"value":"赞藏评cpe:${cost_per_engagement} ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":29,"value":" 点赞成本:${like_cost} ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自点"]}]}]},{"line_num":30,"value":"","filter":[]},{"line_num":31,"value":"【信息流互动】数据","filter":[]},{"line_num":32,"value":"消费:${fee}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]},{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]}]}]},{"line_num":33,"value":"平均点击成本:${acp}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]},{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]}]}]},{"line_num":34,"value":"总互动:${interaction}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]},{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]}]}]},{"line_num":35,"value":"点赞:${like}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]},{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]}]}]},{"line_num":36,"value":"收藏:${collect}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]},{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]}]}]},{"line_num":37,"value":"评论:${comment}          ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]},{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]}]}]},{"line_num":38,"value":"赞藏评cpe:${cost_per_engagement} ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]},{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]}]}]},{"line_num":39,"value":" 点赞成本:${like_cost} ","filter":[{"relation":"AND","conditions":[{"attr":"campaign_name","dataType":"STRING","function":"CONTAIN","params":["互自互"]},{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["1"]}]}]},{"line_num":40,"value":"","filter":[]},{"line_num":41,"value":"【视频流互动】数据","filter":[]},{"line_num":42,"value":"消费:${fee}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":43,"value":"平均点击成本:${acp}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":44,"value":"总互动:${interaction}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":45,"value":"点赞:${like}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":46,"value":"收藏:${collect}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":47,"value":"评论:${comment}          ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":48,"value":"赞藏评cpe:${cost_per_engagement} ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]},{"line_num":49,"value":" 点赞成本:${like_cost} ","filter":[{"relation":"AND","conditions":[{"attr":"placement","dataType":"STRING","function":"EQUAL","params":["7"]}]}]}] \ No newline at end of file diff --git a/MangoServer/.dockerignore b/MangoServer/.dockerignore index 256494a3..670789ff 100644 --- a/MangoServer/.dockerignore +++ b/MangoServer/.dockerignore @@ -1,6 +1,5 @@ .git __pycache__ -*.pyc *.pyo *.pyd .venv diff --git a/MangoServer/.gitignore b/MangoServer/.gitignore index 506e0857..e53b56fd 100644 --- a/MangoServer/.gitignore +++ b/MangoServer/.gitignore @@ -4,6 +4,6 @@ *.log .logs/* logs/ -files/ -db.sqlite3 +test_file/ +failed_screenshot/ PyAutoTest/settings/database.json \ No newline at end of file diff --git a/MangoServer/PyAutoTest/auto_test/auto_system/apps.py b/MangoServer/PyAutoTest/auto_test/auto_system/apps.py index 9a535594..60f72f01 100644 --- a/MangoServer/PyAutoTest/auto_test/auto_system/apps.py +++ b/MangoServer/PyAutoTest/auto_test/auto_system/apps.py @@ -81,5 +81,8 @@ class AutoSystemConfig(AppConfig): self.system_task.start() def shutdown(self): - self.consumer_thread.stop() - self.system_task.join() + try: + self.consumer_thread.stop() + self.system_task.join() + except AttributeError: + pass diff --git a/MangoServer/PyAutoTest/auto_test/auto_system/migrations/0003_remove_filedata_file_remove_filedata_price_and_more.py b/MangoServer/PyAutoTest/auto_test/auto_system/migrations/0003_remove_filedata_file_remove_filedata_price_and_more.py new file mode 100644 index 00000000..c8a68e6c --- /dev/null +++ b/MangoServer/PyAutoTest/auto_test/auto_system/migrations/0003_remove_filedata_file_remove_filedata_price_and_more.py @@ -0,0 +1,40 @@ +# Generated by Django 4.1.5 on 2025-01-15 12:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('auto_system', '0002_tasksdetails_command_alter_tasksdetails_case_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='filedata', + name='file', + ), + migrations.RemoveField( + model_name='filedata', + name='price', + ), + migrations.RemoveField( + model_name='filedata', + name='project', + ), + migrations.AddField( + model_name='filedata', + name='failed_screenshot', + field=models.ImageField(null=True, upload_to='failed_screenshot/', verbose_name='失败截图'), + ), + migrations.AddField( + model_name='filedata', + name='test_file', + field=models.FileField(null=True, upload_to='test_file/', verbose_name='文件'), + ), + migrations.AlterField( + model_name='filedata', + name='name', + field=models.CharField(max_length=255, unique=True, verbose_name='文件名称'), + ), + ] diff --git a/MangoServer/PyAutoTest/auto_test/auto_system/models.py b/MangoServer/PyAutoTest/auto_test/auto_system/models.py index e3d185ce..42b880cd 100644 --- a/MangoServer/PyAutoTest/auto_test/auto_system/models.py +++ b/MangoServer/PyAutoTest/auto_test/auto_system/models.py @@ -23,8 +23,6 @@ class Project(models.Model): def delete(self, *args, **kwargs): if ProjectProduct.objects.filter(project=self).exists(): raise ToolsError(300, "有关联数据,请先删除绑定的产品后再删除!") - if FileData.objects.filter(project=self).exists(): - raise ToolsError(300, "有关联数据,请先删除绑定的测试文件后再删除!") super().delete(*args, **kwargs) @@ -156,17 +154,14 @@ class Database(models.Model): ordering = ['-id'] - - class FileData(models.Model): """ 文件表 """ create_time = models.DateTimeField(verbose_name="创建时间", auto_now_add=True) update_time = models.DateTimeField(verbose_name="修改时间", auto_now=True) - project = models.ForeignKey(to=Project, to_field="id", on_delete=models.SET_NULL, null=True) type = models.SmallIntegerField(verbose_name="类型") - name = models.CharField(verbose_name="文件名称", max_length=64) - price = models.DecimalField(verbose_name="文件大小", max_digits=10, decimal_places=2) - file = models.FileField(verbose_name='文件', upload_to='files/') + name = models.CharField(verbose_name="文件名称", max_length=255, unique=True) + test_file = models.FileField(verbose_name='文件', upload_to='test_file/', null=True) + failed_screenshot = models.ImageField(verbose_name='失败截图', upload_to='failed_screenshot/', null=True) class Meta: db_table = 'file_data' diff --git a/MangoServer/PyAutoTest/settings/__init__.py b/MangoServer/PyAutoTest/settings/__init__.py index a8f4513d..deecc582 100644 --- a/MangoServer/PyAutoTest/settings/__init__.py +++ b/MangoServer/PyAutoTest/settings/__init__.py @@ -21,6 +21,15 @@ elif DJANGO_ENV == SystemEnvEnum.MASTER.value: else: raise Exception( '你选择的环境不在系统默认的环境中,无法启动!!!如果你有能力修改代码请自行解决,如果没有能力请使用master即可') +if DEBUG: + DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' + MINIO_STORAGE_ENDPOINT = None + MINIO_STORAGE_ACCESS_KEY = None + MINIO_STORAGE_SECRET_KEY = None +else: + DEFAULT_FILE_STORAGE = 'minio_storage.storage.MinioMediaStorage' + + nuw_dir() USE_TZ = False @@ -45,9 +54,8 @@ INSTALLED_APPS = [ 'rest_framework', # 前后端分离 'corsheaders', # 跨域 'channels', # 验证 - # 'storages', + 'minio_storage', ] -DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', diff --git a/MangoServer/PyAutoTest/settings/dev.py b/MangoServer/PyAutoTest/settings/dev.py index 7ba29168..fcae9c47 100644 --- a/MangoServer/PyAutoTest/settings/dev.py +++ b/MangoServer/PyAutoTest/settings/dev.py @@ -16,33 +16,22 @@ MYSQL_PASSWORD = 'mP123456&' MYSQL_IP = '127.0.0.1' # ************************ DEBUG配置 ************************ # -DEBUG = False +DEBUG = True # ************************ REDIS配置 ************************ # REDIS = False # ************************ Minio配置 ************************ # -IS_MINIO = True -MINIO_IP = '127.0.0.1' -MINIO_PORT = 9000 - +MINIO_STORAGE_ENDPOINT = 'localhost:9000' +MINIO_STORAGE_ACCESS_KEY = 'HpApeT5FMen6nKyjCyep' +MINIO_STORAGE_SECRET_KEY = 'uPh0fLlWnRFHnPOEgsGFhFm0tx8wvcFfb0Os2xPt' +MINIO_STORAGE_USE_HTTPS = False # 如果使用 HTTPS,设置为 True +MINIO_STORAGE_MEDIA_BUCKET_NAME = 'mango_file' # 桶名称 +MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET = True # 桶不存在时自动创建 # ************************ 是否允许删除 ************************ # IS_DELETE = True -# settings.py - -# 使用 django-storages 的 S3 后端 -DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' - -# MinIO 配置 -AWS_ACCESS_KEY_ID = 'kGio1ain4dleEQwymPl5' # MinIO 的 Access Key -AWS_SECRET_ACCESS_KEY = 'lc5YVRRl3ShbPKzDgCPGQnJjxKpKnmEuW2tz9scq' # MinIO 的 Secret Key -AWS_STORAGE_BUCKET_NAME = 'mango' # MinIO 存储桶名称 -AWS_S3_ENDPOINT_URL = 'http://127.0.0.1:9000' # MinIO 服务器的地址 -AWS_S3_USE_SSL = False # 如果 MinIO 使用 HTTP 而不是 HTTPS,设置为 False -AWS_S3_FILE_OVERWRITE = True # 如果不想覆盖同名文件,设置为 False - # **************** 个人配置,开源用户忽略这部分代码 **************** # # file_name = 'PyAutoTest/settings/database.json' # if os.path.exists(file_name): diff --git a/MangoServer/PyAutoTest/settings/master.py b/MangoServer/PyAutoTest/settings/master.py index a1847beb..1db8f01e 100644 --- a/MangoServer/PyAutoTest/settings/master.py +++ b/MangoServer/PyAutoTest/settings/master.py @@ -21,6 +21,13 @@ DEBUG = True # ************************ REDIS配置 ************************ # REDIS = False +# ************************ Minio配置 ************************ # +MINIO_STORAGE_ENDPOINT = 'localhost:9000' +MINIO_STORAGE_ACCESS_KEY = 'HpApeT5FMen6nKyjCyep' +MINIO_STORAGE_SECRET_KEY = 'uPh0fLlWnRFHnPOEgsGFhFm0tx8wvcFfb0Os2xPt' +MINIO_STORAGE_USE_HTTPS = False # 如果使用 HTTPS,设置为 True +MINIO_STORAGE_MEDIA_BUCKET_NAME = 'mango' # 桶名称 +MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET = True # 桶不存在时自动创建 # ************************ 是否允许删除 ************************ # IS_DELETE = True diff --git a/MangoServer/PyAutoTest/settings/prod.py b/MangoServer/PyAutoTest/settings/prod.py index af6446ab..bc39a678 100644 --- a/MangoServer/PyAutoTest/settings/prod.py +++ b/MangoServer/PyAutoTest/settings/prod.py @@ -17,11 +17,18 @@ MYSQL_IP = 'db' MYSQL_PORT = 3306 # ************************ DEBUG配置 ************************ # -DEBUG = True +DEBUG = False # ************************ REDIS配置 ************************ # REDIS = False +# ************************ Minio配置 ************************ # +MINIO_STORAGE_ENDPOINT = 'localhost:9000' +MINIO_STORAGE_ACCESS_KEY = 'HpApeT5FMen6nKyjCyep' +MINIO_STORAGE_SECRET_KEY = 'uPh0fLlWnRFHnPOEgsGFhFm0tx8wvcFfb0Os2xPt' +MINIO_STORAGE_USE_HTTPS = False # 如果使用 HTTPS,设置为 True +MINIO_STORAGE_MEDIA_BUCKET_NAME = 'mango' # 桶名称 +MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET = True # 桶不存在时自动创建 # ************************ 是否允许删除 ************************ # IS_DELETE = False diff --git a/MangoServer/PyAutoTest/tools/__init__.py b/MangoServer/PyAutoTest/tools/__init__.py index c5a844e5..43ef8197 100644 --- a/MangoServer/PyAutoTest/tools/__init__.py +++ b/MangoServer/PyAutoTest/tools/__init__.py @@ -18,14 +18,13 @@ def ensure_path_sep(path: str) -> str: def nuw_dir(): - files = ensure_path_sep('/files') - if not os.path.exists(files): - os.makedirs(files) - file = ['auto_api', 'auto_perf', 'auto_system', 'auto_ui', 'auto_user'] + for i in ['/logs', '/test_file', '/failed_screenshot', '/upload_template']: + file = ensure_path_sep(i) + if not os.path.exists(file): + os.makedirs(file) + logs_dir = ensure_path_sep('/logs') - if not os.path.exists(logs_dir): - os.makedirs(logs_dir) - for i in file: + for i in ['auto_api', 'auto_perf', 'auto_system', 'auto_ui', 'auto_user']: subdirectory = os.path.join(logs_dir, i) if not os.path.exists(subdirectory): os.makedirs(subdirectory) diff --git a/MangoServer/requirements.txt b/MangoServer/requirements.txt index 9e1ecfb9..4316c2ad 100644 Binary files a/MangoServer/requirements.txt and b/MangoServer/requirements.txt differ diff --git a/mango-console/.env.development b/mango-console/.env.development index 9ec046b2..17c84f88 100644 --- a/mango-console/.env.development +++ b/mango-console/.env.development @@ -2,4 +2,5 @@ BUILD_PATH=/ VITE_APP_ENV='dev' VITE_APP_BASE_URL = 'http://127.0.0.1:8000' VITE_APP_SOCKET_URL = 'ws://127.0.0.1:8000/web/socket?' -VITE_IS_INDEX_WINDOW = 'false' \ No newline at end of file +VITE_APP_MINIO_URL = 'ws://127.0.0.1:9000/mango_file' +VITE_IS_INDEX_WINDOW = 'true' \ No newline at end of file diff --git a/mango-console/src/api/axios.config.ts b/mango-console/src/api/axios.config.ts index 09309c73..018d62d9 100644 --- a/mango-console/src/api/axios.config.ts +++ b/mango-console/src/api/axios.config.ts @@ -2,6 +2,7 @@ import Axios, { AxiosResponse } from 'axios' import qs from 'qs' export const baseURL = import.meta.env.VITE_APP_BASE_URL +export const minioURL = import.meta.env.VITE_APP_MINIO_URL export const webSocketURL = import.meta.env.VITE_APP_SOCKET_URL export const CONTENT_TYPE = 'Content-Type' diff --git a/mango-console/src/layouts/avatar/index.vue b/mango-console/src/layouts/avatar/index.vue index c30f6950..85699d36 100644 --- a/mango-console/src/layouts/avatar/index.vue +++ b/mango-console/src/layouts/avatar/index.vue @@ -26,8 +26,8 @@ - 作者微信 - 交流群 + 作者微信 + 交流群 @@ -40,7 +40,7 @@ import useUserStore from '@/store/modules/user' import { useRouter } from 'vue-router' import { websocket } from '@/utils/socket' - import { baseURL, webSocketURL } from '@/api/axios.config' + import {baseURL, minioURL, webSocketURL} from '@/api/axios.config' import { SERVER } from '@/setting' const userStore = useUserStore() diff --git a/mango-console/src/views/config/test-files/config.ts b/mango-console/src/views/config/test-files/config.ts index d4532bbd..1f63f4ea 100644 --- a/mango-console/src/views/config/test-files/config.ts +++ b/mango-console/src/views/config/test-files/config.ts @@ -2,21 +2,12 @@ import { useTable, useTableColumn } from '@/hooks/table' const table = useTable() export const tableColumns = useTableColumn([ table.indexColumn, - { - title: '项目名称', - key: 'project', - dataIndex: 'project', - }, + { title: '文件名称', key: 'name', dataIndex: 'name', }, - { - title: '文件地址', - key: 'file', - dataIndex: 'file', - }, { title: '操作', key: 'actions', diff --git a/mango-console/src/views/config/test-files/index.vue b/mango-console/src/views/config/test-files/index.vue index 80dd4c9c..01078e90 100644 --- a/mango-console/src/views/config/test-files/index.vue +++ b/mango-console/src/views/config/test-files/index.vue @@ -7,7 +7,6 @@ - 注意:上传文件时必须要选择项目后才能进行上传 {{ record.id }} -