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

通过组合日志格式中的模块+操作+消息内容作为错误唯一标识转为固定的哈希值,记录每个错误最后发送时间 {hash:timestamp},定时任务每天00:00清空发送记录,避免历史错误永远被屏蔽。

上级 6c258a0a
...@@ -23,6 +23,8 @@ def dingding_send_message(error_log_url,ding_type): ...@@ -23,6 +23,8 @@ def dingding_send_message(error_log_url,ding_type):
# 钉钉机器人的 Webhook URL 和密钥(测试环境) # 钉钉机器人的 Webhook URL 和密钥(测试环境)
webhook_url = 'https://oapi.dingtalk.com/robot/send?access_token=7fbf40798cad98b1b5db55ff844ba376b1816e80c5777e6f47ae1d9165dacbb4' webhook_url = 'https://oapi.dingtalk.com/robot/send?access_token=7fbf40798cad98b1b5db55ff844ba376b1816e80c5777e6f47ae1d9165dacbb4'
secret = 'SEC610498ed6261ae2df1d071d0880aaa70abf5e67efe47f75a809c1f2314e0dbd6' secret = 'SEC610498ed6261ae2df1d071d0880aaa70abf5e67efe47f75a809c1f2314e0dbd6'
# 这是错的
# secret = 'SEC610498ed6261ae2df1d071d0880aaa70abf5e67efe47f75a809c1f2314e0dbd612211221'
# 日志类型:1.预定系统对内服务;2.预定系统对外服务 # 日志类型:1.预定系统对内服务;2.预定系统对外服务
log_type = '' log_type = ''
......
...@@ -8,4 +8,6 @@ ...@@ -8,4 +8,6 @@
- 处理运行12小时后被远程主机主动断开连接问题,通过配置 SSH Client 的 keepalive 参数,让连接保持活跃,避免超时断开。 - 处理运行12小时后被远程主机主动断开连接问题,通过配置 SSH Client 的 keepalive 参数,让连接保持活跃,避免超时断开。
- 增加多台服务器的连接监测,补充对展厅的日志监测,调整error_log日志文件存放路径,补充对应的ngrok映射目录。 - 增加多台服务器的连接监测,补充对展厅的日志监测,调整error_log日志文件存放路径,补充对应的ngrok映射目录。
3. 2025-06-09: 3. 2025-06-09:
- 优化日志监控的异常处理。处理路径拼接方式,处理服务出现错误日志没有发送的问题,调试重复发送问题。 - 优化日志监控的异常处理。处理路径拼接方式,处理服务出现错误日志没有发送的问题,调试重复发送问题。
\ No newline at end of file 4. 2025-06-10:
- 通过组合日志格式中的模块+操作+消息内容 作为错误唯一标识转为固定的哈希值,记录每个错误最后发送时间 {hash: timestamp},定时任务每天00:00清空发送记录,避免历史错误永远被屏蔽。
\ No newline at end of file
...@@ -3,5 +3,5 @@ trust_host_root_certs: false ...@@ -3,5 +3,5 @@ trust_host_root_certs: false
tunnels: tunnels:
nat1: nat1:
proto: proto:
tcp: 127.0.0.1:80 tcp: 127.0.0.1:81
remote_port: 32233 remote_port: 32233
...@@ -32,6 +32,12 @@ class TopicDeclaration: ...@@ -32,6 +32,12 @@ class TopicDeclaration:
wd = GSTORE['wd'] wd = GSTORE['wd']
name = self.name name = self.name
# 执行完一个用例就刷新一下页面重置
wd.refresh()
wd.refresh()
wd.refresh()
sleep(10)
# 点击【议题申报】按钮进入模块 # 点击【议题申报】按钮进入模块
INFO("点击【议题申报】按钮") INFO("点击【议题申报】按钮")
safe_click((By.XPATH, "//div[@id='CreateTopic']"), wd) safe_click((By.XPATH, "//div[@id='CreateTopic']"), wd)
...@@ -54,14 +60,16 @@ class TopicDeclaration: ...@@ -54,14 +60,16 @@ class TopicDeclaration:
if element_type == "click": if element_type == "click":
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(4)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input": elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd) safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2) sleep(4)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "getTips": elif element_type == "getTips":
notify_text = get_notify_text(wd, (locator_type, locator_value)) notify_text = get_notify_text(wd, (locator_type, locator_value))
INFO(f"获取到的提示信息为:{notify_text}") INFO(f"获取到的提示信息为:{notify_text}")
sleep(2) sleep(4)
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text) CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "75") SELENIUM_LOG_SCREEN(wd, "75")
...@@ -69,9 +77,4 @@ class TopicDeclaration: ...@@ -69,9 +77,4 @@ class TopicDeclaration:
text = elment_get_text((locator_type, locator_value), wd) text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本信息为:{text}") INFO(f"获取到的文本信息为:{text}")
CHECK_POINT(f"获取到的文本信息为:{text}", expented_result in text) CHECK_POINT(f"获取到的文本信息为:{text}", expented_result in text)
SELENIUM_LOG_SCREEN(wd, "75") SELENIUM_LOG_SCREEN(wd, "75")
\ No newline at end of file
# 执行完一个用例就刷新一下页面重置
wd.refresh()
wd.refresh()
sleep(2)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论