提交 1303c43f authored 作者: 陈泽健's avatar 陈泽健

删除未使用的代码片段,优化代码注释。

上级 44f4709b
from appium.webdriver.common.appiumby import AppiumBy from appium.webdriver.common.appiumby import AppiumBy
from time import sleep from time import sleep
from appium.options.android import UiAutomator2Options from appium.options.android import UiAutomator2Options
import time
from hytest import * from hytest import *
from selenium import webdriver from selenium import webdriver
from selenium.common import TimeoutException, NoSuchElementException, ElementNotInteractableException
from selenium.webdriver.common.keys import Keys
from urllib.parse import urlencode
from datetime import datetime
def app_setup_driver(platformName, platformVersion, deviceName, appPackage, appActivity, udid): def app_setup_driver(platformName, platformVersion, deviceName, appPackage, appActivity, udid):
......
...@@ -77,26 +77,6 @@ def browser_init(login_type): ...@@ -77,26 +77,6 @@ def browser_init(login_type):
# 设置隐式等待时间为10秒,以允许元素加载 # 设置隐式等待时间为10秒,以允许元素加载
wd.implicitly_wait(60) wd.implicitly_wait(60)
# # 获取当前脚本的绝对路径
# current_dir = os.path.dirname(os.path.abspath(__file__))
# # 构建配置文件的绝对路径
# config_path = os.path.join(current_dir, '..', 'Base', 'config.json')
# logging.info(f"配置文件路径: {config_path}")
#
# # 检查文件是否存在
# if not os.path.exists(config_path):
# raise FileNotFoundError(f"配置文件 {config_path} 不存在")
#
# # 读取配置文件
# with open(config_path, 'r', encoding='utf-8') as config_file:
# config = json.load(config_file)
# login_url = config.get(login_type)
# INFO(f"正在打开{login_type}的登录页面:{login_url}")
#
# # 检查是否成功获取到 URL
# if not login_url:
# raise ValueError(f"未找到对应的 URL 配置项: {login_type}")
# 获取登录URL # 获取登录URL
login_url = get_login_url_from_config(login_type) login_url = get_login_url_from_config(login_type)
# 打开对应类型的登录页面 # 打开对应类型的登录页面
...@@ -1022,8 +1002,8 @@ def play_cloud_voice(app_id, app_secret, device_sn): ...@@ -1022,8 +1002,8 @@ def play_cloud_voice(app_id, app_secret, device_sn):
logging.error(f"发生未知异常: {e}") logging.error(f"发生未知异常: {e}")
# # 示例调用 # # 示例调用
if __name__ == "__main__": # if __name__ == "__main__":
app_id = os.getenv("APP_ID", "a98a124c6c3252f6612fc544a0d0fa79") # app_id = os.getenv("APP_ID", "a98a124c6c3252f6612fc544a0d0fa79")
app_secret = os.getenv("APP_SECRET", "88bc1ec4eba624f47b2200a4ce8c3852") # app_secret = os.getenv("APP_SECRET", "88bc1ec4eba624f47b2200a4ce8c3852")
device_sn = os.getenv("DEVICE_SN", "W703BB44444") # device_sn = os.getenv("DEVICE_SN", "W703BB44444")
play_cloud_voice(app_id, app_secret, device_sn) # play_cloud_voice(app_id, app_secret, device_sn)
\ No newline at end of file \ No newline at end of file
...@@ -194,4 +194,6 @@ ...@@ -194,4 +194,6 @@
- 优化处理展厅统一平台视讯会议巡检腾讯终端入会流程。 - 优化处理展厅统一平台视讯会议巡检腾讯终端入会流程。
- 根据测试报告处理历史会议模块异常问题。 - 根据测试报告处理历史会议模块异常问题。
49. 2025-02-07 49. 2025-02-07
- 根据标准版功能巡检测试报告处理会议审批模块的异常。 - 根据标准版功能巡检测试报告处理会议审批模块的异常。
\ No newline at end of file 50. 2025-02-08
- 删除未使用的代码片段,优化代码注释。
\ No newline at end of file
...@@ -31,8 +31,8 @@ class Message_Book_000x: ...@@ -31,8 +31,8 @@ class Message_Book_000x:
def teststeps(self): def teststeps(self):
""" """
执行测试步骤以会议室删除功能。 执行测试步骤以会议预约功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。 本函数根据参数输入会议室名称进行搜索并预约会议,并检查预约后的提示信息是否与预期相符。
字段含义: 字段含义:
name:用例名称 name:用例名称
conference_name:会议室名称 conference_name:会议室名称
......
...@@ -30,8 +30,8 @@ class Message_Update_000x: ...@@ -30,8 +30,8 @@ class Message_Update_000x:
def teststeps(self): def teststeps(self):
""" """
执行测试步骤以会议室删除功能。 执行测试步骤以修改会议功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。 本函数根据参数输入会议室名称进行搜索并修改会议,并检查修改后的提示信息是否与预期相符。
字段含义: 字段含义:
name:用例名称 name:用例名称
message_name:原会议名称 message_name:原会议名称
......
...@@ -32,8 +32,8 @@ class Message_Update_000x: ...@@ -32,8 +32,8 @@ class Message_Update_000x:
def teststeps(self): def teststeps(self):
""" """
执行测试步骤以会议室删除功能。 执行测试步骤以删除会议功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。 本函数根据参数输入会议室名称进行搜索会议,并检查删除后的提示信息是否与预期相符。
字段含义: 字段含义:
name:用例名称 name:用例名称
message_name:原会议名称 message_name:原会议名称
......
...@@ -94,8 +94,8 @@ class Message_UpdateStatus_000x: ...@@ -94,8 +94,8 @@ class Message_UpdateStatus_000x:
def teststeps(self): def teststeps(self):
""" """
执行测试步骤以会议室删除功能。 执行测试步骤以会议状态设置功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。 本函数根据参数输入会议室名称进行搜索会议,并检查会议操作后的提示信息是否与预期相符。
字段含义: 字段含义:
name:用例名称 name:用例名称
conference_name:会议室名称 conference_name:会议室名称
......
...@@ -33,8 +33,8 @@ class History_Query_000x: ...@@ -33,8 +33,8 @@ class History_Query_000x:
def teststeps(self): def teststeps(self):
""" """
执行测试步骤以会议室删除功能。 执行测试步骤以历史会议筛选功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。 本函数根据参数输入会议室名称进行搜索会议,并检查筛选后的提示信息是否与预期相符。
字段含义: 字段含义:
name:用例名称 name:用例名称
query_message_name:查询的会议名称 query_message_name:查询的会议名称
......
...@@ -33,8 +33,8 @@ class History_Book_000x: ...@@ -33,8 +33,8 @@ class History_Book_000x:
def teststeps(self): def teststeps(self):
""" """
执行测试步骤以会议室删除功能。 执行测试步骤以历史会议再次预定功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。 本函数根据参数输入会议室名称进行搜索会议,并检查再次预定后的提示信息是否与预期相符。
字段含义: 字段含义:
name:用例名称 name:用例名称
query_message_name:查询的会议名称 query_message_name:查询的会议名称
......
...@@ -10,9 +10,8 @@ import logging ...@@ -10,9 +10,8 @@ import logging
1.打开一个终端输入: 1.打开一个终端输入:
- cd .\预定系统\ - cd .\预定系统\
- python -m http.server 80 --directory reports - python -m http.server 80 --directory reports
2.打开新终端输入: 2.打开新终端输入:
- cd .\预定系统\ - cd .\预定系统\ngrok\ngrok-调试主机\
- cd .\ngrok\ngrok-调试主机\
- .\start.bat - .\start.bat
3.再打开一个终端输入: 3.再打开一个终端输入:
- cd .\预定系统\ - cd .\预定系统\
...@@ -23,8 +22,7 @@ import logging ...@@ -23,8 +22,7 @@ import logging
- cd .\预定系统\ - cd .\预定系统\
- python -m http.server 81 --directory reports - python -m http.server 81 --directory reports
2.打开新终端输入: 2.打开新终端输入:
- cd .\预定系统\ - cd .\预定系统\ngrok\ngrok-自动化运行虚拟机
- cd .\ngrok\ngrok-自动化运行虚拟机
- .\start.bat - .\start.bat
3.再打开一个终端输入: 3.再打开一个终端输入:
- cd .\预定系统\ - cd .\预定系统\
...@@ -71,7 +69,7 @@ def start_workers(num_workers): ...@@ -71,7 +69,7 @@ def start_workers(num_workers):
start_workers(3) start_workers(3)
# 定时执行预定系统测试任务1 # 定时执行预定系统测试任务1
schedule.every().day.at("09:00").do(run_task, run_automation_test, report_title="预定系统测试报告", report_url_prefix="http://nat.ubainsyun.com:31134", test_case="预定系统功能", ding_type="标准版巡检") # schedule.every().day.at("09:00").do(run_task, run_automation_test, report_title="预定系统测试报告", report_url_prefix="http://nat.ubainsyun.com:31134", test_case="预定系统功能", ding_type="标准版巡检")
# 定时执行展厅巡检任务 # 定时执行展厅巡检任务
schedule.every().day.at("07:50").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检") schedule.every().day.at("07:50").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论