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

将ngrok.cfg配置文件本机IP改为127.0.0.1,避免本机IP变化后无法打开测试报告。

上级 05bc8fe3
......@@ -4,5 +4,6 @@
"展厅运维巡检": "http://192.168.5.200:8081/#/login",
"展厅统一平台巡检": "http://192.168.5.200:38083/#/login",
"展厅讯飞系统巡检": "http://192.168.5.201:8080/#/login",
"长安大学预定测试环境": "https://192.168.5.186/#/login/logindf"
"长安大学预定测试环境": "https://192.168.5.186/#/login/logindf",
"工商银行项目生产环境": "https://192.168.52.63:21443/#/login/logindf"
}
\ No newline at end of file
......@@ -271,4 +271,8 @@
- 优化write_xlsx_data函数实现表格自动填充测试结果和日志截图功能。
- 处理会议测试用例所有模块的JSON数据格式以及代码处理,规范化类名。
73. 2025-03-25
- 处理展厅巡检会议文件空问题,排查展厅巡检的讯飞系统转录,调试没有问题,正常转录成功。
\ No newline at end of file
- 处理展厅巡检会议文件空问题,排查展厅巡检的讯飞系统转录,调试没有问题,正常转录成功。
74. 2025-04-01
- 补充工商银行项目的JSON数据自动化测试。
75. 2025-04-02
- 将ngrok.cfg配置文件本机IP改为127.0.0.1,避免本机IP变化后无法打开测试报告。
\ No newline at end of file
......@@ -66,6 +66,7 @@ class SMCMeeting:
sleep(2)
elif element_type == "click":
safe_click((locator_type, locator_value), wd)
safe_click((locator_type, locator_value), wd)
sleep(2)
......
......@@ -71,6 +71,7 @@ class TxcentMeeting:
sleep(2)
elif element_type == "click":
safe_click((locator_type, locator_value), wd)
safe_click((locator_type, locator_value), wd)
sleep(2)
......
import sys
import os
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..', '..', '..' , '..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
from 预定系统.Base.base import *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '会议预定测试用例.xlsx')
class AccountManagement:
tags = ['工商银行OA组织架构同步']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 工商银行项目测试报告 --report_url_prefix http://nat.ubainsyun.com:31133 --tag 工商银行OA组织架构同步
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='账号管理')
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
clear_columns_in_xlsx(xlsx_file_path, sheet_name='账号管理', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
elif element_type == "getTips":
notify_text = get_notify_text(wd, (locator_type, locator_value))
INFO(f"获取到的提示信息为:{notify_text}")
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
elif element_type == "getText":
text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本信息为:{text}")
CHECK_POINT(f"获取到的文本信息为:{text}", expented_result in text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
import sys
import os
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
from 预定系统.Base.base import *
def suite_setup():
STEP(1, "初始化浏览器")
# 初始化浏览器与系统地址
browser_init("工商银行项目生产环境")
user_login("admin", "Admin@686868")
sleep(2)
wd = GSTORE['wd']
# 进入后台管理界面
safe_click((By.XPATH, "//img[@title='后台系统']"), wd)
sleep(2)
# 展开账号管理模块
safe_click((By.XPATH, "//span[contains(text(),'账号管理')]"), wd)
def suite_teardown():
wd = GSTORE['wd']
wd.quit()
\ No newline at end of file
......@@ -4,4 +4,4 @@ tunnels:
nat1:
remote_port: 31134
proto:
tcp: "192.168.5.88:81"
\ No newline at end of file
tcp: "127.0.0.1:81"
\ No newline at end of file
......@@ -3,5 +3,5 @@ trust_host_root_certs: false
tunnels:
nat1:
proto:
tcp: 192.168.1.133:80
tcp: 127.0.0.1:80
remote_port: 31133
......@@ -84,8 +84,13 @@ start_workers(3)
# start_ngrok(ngrok_path, ngrok_config_path)
# 定时执行展厅巡检任务
schedule.every().day.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
# schedule.every().day.at("11:48").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:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().monday.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().thursday.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().wednesday.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().tuesday.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().friday.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
# 调试使用
# schedule.every().day.at("08:44").do(run_task, run_automation_test, report_title="展厅调试", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="腾讯会议", ding_type="展厅巡检")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论