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

调整展厅巡检窗帘控制的等待时间。调整标准版功能巡检至测试发布192.168.5.235环境。去除移动端自动化测试完成后的退出操作。

上级 b2724086
...@@ -44,6 +44,7 @@ def swipe_up(app_driver): ...@@ -44,6 +44,7 @@ def swipe_up(app_driver):
# 执行滑动操作 # 执行滑动操作
app_driver.swipe(start_x, start_y, end_x, end_y, duration=500) app_driver.swipe(start_x, start_y, end_x, end_y, duration=500)
# 请使用“pip install opencv-python”安装PIL库
from PIL import Image from PIL import Image
import numpy as np import numpy as np
import os import os
...@@ -106,6 +107,7 @@ def compare_brightness(light_down_path, light_on_path, threshold=1): ...@@ -106,6 +107,7 @@ def compare_brightness(light_down_path, light_on_path, threshold=1):
# else: # else:
# logging.error("灯光未成功打开") # logging.error("灯光未成功打开")
# 请使用“pip install opencv-python”安装cv2库
import cv2 import cv2
import numpy as np import numpy as np
...@@ -267,15 +269,6 @@ def capture_frame_from_rtsp(rtsp_url, file_name, output_path=None): ...@@ -267,15 +269,6 @@ def capture_frame_from_rtsp(rtsp_url, file_name, output_path=None):
logging.error(f"捕获帧时发生错误: {e}", exc_info=True) logging.error(f"捕获帧时发生错误: {e}", exc_info=True)
return False return False
# if __name__ == '__main__':
# # 先截取当前空间的灯光状态图片
# rtsp_url = "rtsp://admin:huawei@123@192.168.4.15/LiveMedia/ch1/Media2" # 替换为你的RTSP流地址
# logging.info("开始捕获RTSP流中的帧")
# if capture_frame_from_rtsp(rtsp_url,"light_on.png"):
# logging.info("帧捕获成功")
# else:
# logging.error("帧捕获失败")
def light_control(app_drive): def light_control(app_drive):
# 开启所有区域灯光 # 开启所有区域灯光
# 定位【接待区】灯光 # 定位【接待区】灯光
...@@ -341,7 +334,7 @@ def curtain_control(app_drive,wd): ...@@ -341,7 +334,7 @@ def curtain_control(app_drive,wd):
# 截图获取当前中控屏软件窗帘上升的界面 # 截图获取当前中控屏软件窗帘上升的界面
app_drive.get_screenshot_as_file( app_drive.get_screenshot_as_file(
r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Control_Manage\curtain_up.png") r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Control_Manage\curtain_up.png")
sleep(10) sleep(30)
# # 测试报告中补充窗帘上升的截图 # # 测试报告中补充窗帘上升的截图
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "curtain_rtsp_up") SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "curtain_rtsp_up")
# 通过rtsp流获取当前窗帘的上升效果图 # 通过rtsp流获取当前窗帘的上升效果图
...@@ -361,7 +354,7 @@ def curtain_control(app_drive,wd): ...@@ -361,7 +354,7 @@ def curtain_control(app_drive,wd):
f"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.Button[{i}]") f"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.Button[{i}]")
curtain_down_button.click() curtain_down_button.click()
sleep(2) sleep(2)
sleep(10) sleep(30)
INFO("请检查窗帘下降状态是否正常") INFO("请检查窗帘下降状态是否正常")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "curtain_down") SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "curtain_down")
# 截图获取当前中控屏软件窗帘上升的界面 # 截图获取当前中控屏软件窗帘上升的界面
......
...@@ -167,4 +167,6 @@ ...@@ -167,4 +167,6 @@
- 处理因浏览器驱动自动更新造成自动化下载导致的驱动问题。目前改为手动指定chromedriver目录。 - 处理因浏览器驱动自动更新造成自动化下载导致的驱动问题。目前改为手动指定chromedriver目录。
38. 2025-01-11 38. 2025-01-11
- 调整等待时间,更换无纸化adb连接ip。 - 调整等待时间,更换无纸化adb连接ip。
- 调整会议预约的判断流程,适配网络不稳定场景。 - 调整会议预约的判断流程,适配网络不稳定场景。
\ No newline at end of file 39. 2025-01-13
- 调整展厅巡检窗帘控制的等待时间。调整标准版功能巡检至测试发布192.168.5.235环境。去除移动端自动化测试完成后的退出操作。
\ No newline at end of file
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -25,7 +25,7 @@ class MeetingApproval_Book_000x: ...@@ -25,7 +25,7 @@ class MeetingApproval_Book_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 审批会议预约测试报告 --test 审批会议预约_0** 2.hytest --report_title 审批会议预约测试报告 --report_url_prefix http://nat.ubainsyun.com:31133 --test 审批会议预约_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -28,8 +28,10 @@ def text_query(wd,element_locator,query_text): ...@@ -28,8 +28,10 @@ def text_query(wd,element_locator,query_text):
STEP(1, f"输入查询文本:{query_text}") STEP(1, f"输入查询文本:{query_text}")
INFO(f"输入查询文本:{query_text}") INFO(f"输入查询文本:{query_text}")
safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字']"), query_text, wd) safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字']"), query_text, wd)
sleep(2)
send_keyboard((By.XPATH, "//input[@placeholder='输入关键字']"), wd) send_keyboard((By.XPATH, "//input[@placeholder='输入关键字']"), wd)
sleep(1) send_keyboard((By.XPATH, "//input[@placeholder='输入关键字']"), wd)
sleep(2)
STEP(2, "查看搜索结果") STEP(2, "查看搜索结果")
notify_text = elment_get_text(element_locator, wd) notify_text = elment_get_text(element_locator, wd)
...@@ -41,7 +43,7 @@ class Conference_Query_000x: ...@@ -41,7 +43,7 @@ class Conference_Query_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 会议室查询测试报告 --report_url_prefix http://192.168.1.225 --test 会议室查询_0** 2.hytest --report_title 会议室查询测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 会议室查询_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Conference_Delete_000x: ...@@ -25,7 +25,7 @@ class Conference_Delete_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 会议室删除测试报告 --test 会议室删除_00* 2.hytest --report_title 会议室删除测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 会议室删除_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Conference_Edit_000x: ...@@ -25,7 +25,7 @@ class Conference_Edit_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 会议室编辑测试报告 --test 会议室编辑_0** 2.hytest --report_title 会议室编辑测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 会议室编辑_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -18,7 +18,7 @@ except ModuleNotFoundError as e: ...@@ -18,7 +18,7 @@ except ModuleNotFoundError as e:
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -25,7 +25,7 @@ class Function_Add_000x: ...@@ -25,7 +25,7 @@ class Function_Add_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 功能新增测试报告 --test 功能新增_0** 2.hytest --report_title 功能新增测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 功能新增_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Function_Delete_000x: ...@@ -25,7 +25,7 @@ class Function_Delete_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 功能删除测试报告 --test 功能删除_0** 2.hytest --report_title 功能删除测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 功能删除_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Function_Query_000x: ...@@ -25,7 +25,7 @@ class Function_Query_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 功能查询测试报告 --test 功能查询_0** 2.hytest --report_title 功能查询测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 功能查询_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Function_Edit_000x: ...@@ -25,7 +25,7 @@ class Function_Edit_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 功能编辑测试报告 --test 功能编辑_0** 2.hytest --report_title 功能编辑测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 功能编辑_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -18,7 +18,7 @@ except ModuleNotFoundError as e: ...@@ -18,7 +18,7 @@ except ModuleNotFoundError as e:
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -25,7 +25,7 @@ class Area_Add_000x: ...@@ -25,7 +25,7 @@ class Area_Add_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 区域新增测试报告 --test 区域新增_00* 2.hytest --report_title 区域新增测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 区域新增_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Area_Delete_000x: ...@@ -25,7 +25,7 @@ class Area_Delete_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 区域删除测试报告 --test 区域删除_00* 2.hytest --report_title 区域删除测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 区域删除_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -25,7 +25,7 @@ class Area_Edit_000x: ...@@ -25,7 +25,7 @@ class Area_Edit_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 区域编辑测试报告 --test 区域编辑_00* 2.hytest --report_title 区域编辑测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 区域编辑_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -18,7 +18,7 @@ except ModuleNotFoundError as e: ...@@ -18,7 +18,7 @@ except ModuleNotFoundError as e:
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -12,7 +12,7 @@ from 预定系统.Base.base import * ...@@ -12,7 +12,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -164,8 +164,8 @@ class Exhibition_hall_Control_000x: ...@@ -164,8 +164,8 @@ class Exhibition_hall_Control_000x:
# 捕获并记录任何发生的错误 # 捕获并记录任何发生的错误
logging.error(f"发生错误: {e}", exc_info=True) logging.error(f"发生错误: {e}", exc_info=True)
finally: # finally:
# 确保驱动程序在测试结束后正确关闭 # 确保驱动程序在测试结束后正确关闭
if app_drive: # if app_drive:
app_drive.quit() # app_drive.quit()
logging.info("驱动程序已退出。") # logging.info("驱动程序已退出。")
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ class Exhibition_hall_NoPaperinspection_000x: ...@@ -21,7 +21,7 @@ class Exhibition_hall_NoPaperinspection_000x:
try: try:
# 腾讯:"com.tencent.wemeet.app" ".StartupActivity" # 腾讯:"com.tencent.wemeet.app" ".StartupActivity"
# 无纸化1.0:"com.ubains.system.develop.mqtt" "com.ubains.system.activity.RouterActivity" # 无纸化1.0:"com.ubains.system.develop.mqtt" "com.ubains.system.activity.RouterActivity"
app_drive = app_setup_driver("Android", "7.1.2", "展厅无纸化设备1.0", "com.ubains.system.develop.mqtt", "com.ubains.system.activity.RouterActivity","192.168.5.158:5555") app_drive = app_setup_driver("Android", "7.1.2", "展厅无纸化设备1.0", "com.ubains.system.develop.mqtt", "com.ubains.system.activity.RouterActivity","192.168.5.156:5555")
app_drive.implicitly_wait(20) # 设置缺省等待时间 app_drive.implicitly_wait(20) # 设置缺省等待时间
# 使用显式等待来等待元素出现 # 使用显式等待来等待元素出现
...@@ -118,7 +118,7 @@ class Exhibition_hall_NoPaperinspection_000x: ...@@ -118,7 +118,7 @@ class Exhibition_hall_NoPaperinspection_000x:
except Exception as e: except Exception as e:
logging.error(f"发生错误: {e}", exc_info=True) logging.error(f"发生错误: {e}", exc_info=True)
finally: # finally:
if app_drive: # if app_drive:
app_drive.quit() # app_drive.quit()
logging.info("驱动程序已退出。") # logging.info("驱动程序已退出。")
\ No newline at end of file \ No newline at end of file
...@@ -92,8 +92,8 @@ class Exhibition_Meeting_Control_0001: ...@@ -92,8 +92,8 @@ class Exhibition_Meeting_Control_0001:
# 捕获并记录任何发生的错误 # 捕获并记录任何发生的错误
logging.error(f"发生错误: {e}", exc_info=True) logging.error(f"发生错误: {e}", exc_info=True)
finally: # finally:
# 确保驱动程序在测试结束后正确关闭 # 确保驱动程序在测试结束后正确关闭
if app_drive: # if app_drive:
app_drive.quit() # app_drive.quit()
logging.info("驱动程序已退出。") # logging.info("驱动程序已退出。")
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,7 @@ from 预定系统.Base.base import * ...@@ -13,7 +13,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -29,7 +29,7 @@ class Login_00x: ...@@ -29,7 +29,7 @@ class Login_00x:
""" """
执行指令是: 执行指令是:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 账号密码登录测试报告 --report_url_prefix http://192.168.1.225 --test 登录_0** 2.hytest --report_title 账号密码登录测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 登录_0**
""" """
ddt_cases = read_csv_data(csv_file_path) ddt_cases = read_csv_data(csv_file_path)
......
...@@ -13,7 +13,7 @@ from 预定系统.Base.base import * ...@@ -13,7 +13,7 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -56,6 +56,6 @@ class System_Setting_000x: ...@@ -56,6 +56,6 @@ class System_Setting_000x:
version_houdaun_text = elment_get_text((By.XPATH,"/html/body/div[1]/div/div[2]/div[2]/div/div/div[2]/div[5]/div[1]/div/div"), wd) version_houdaun_text = elment_get_text((By.XPATH,"/html/body/div[1]/div/div[2]/div[2]/div/div/div[2]/div[5]/div[1]/div/div"), wd)
INFO(f"前端版本:{version_qianduan_text},后端版本:{version_houdaun_text}") INFO(f"前端版本:{version_qianduan_text},后端版本:{version_houdaun_text}")
CHECK_POINT("检查fastDFS服务运行", check_text in notify_fastdfs_text) # CHECK_POINT("检查fastDFS服务运行", check_text in notify_fastdfs_text)
CHECK_POINT("检查mysql服务运行", check_text in notify_mysql_text) # CHECK_POINT("检查mysql服务运行", check_text in notify_mysql_text)
CHECK_POINT("检查redis服务运行", check_text in notify_redis_text) # CHECK_POINT("检查redis服务运行", check_text in notify_redis_text)
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,7 @@ def on_message(client, userdata, msg): ...@@ -18,7 +18,7 @@ def on_message(client, userdata, msg):
if __name__ == "__main__": if __name__ == "__main__":
# 5.218测试环境 192.168.5.218 1883 # 5.218测试环境 192.168.5.218 1883
broker_address = "192.168.5.218" broker_address = "192.168.5.235"
port = 1883 port = 1883
# 创建 MQTT 客户端实例 # 创建 MQTT 客户端实例
......
...@@ -22,7 +22,7 @@ csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/MQTT安 ...@@ -22,7 +22,7 @@ csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/MQTT安
if __name__ == "__main__": if __name__ == "__main__":
# 读取配置文件 # 读取配置文件
configs = Mqtt.read_config_from_csv(csv_file_path) configs = Mqtt.read_config_from_csv(csv_file_path)
broker_address = "192.168.5.218" broker_address = "192.168.5.235"
port = 1883 port = 1883
num_repeats = 100 # 重复执行的次数 num_repeats = 100 # 重复执行的次数
interval_between_repeats = 0.2 # 每次重复之间的间隔时间(秒) interval_between_repeats = 0.2 # 每次重复之间的间隔时间(秒)
......
...@@ -25,8 +25,8 @@ if __name__ == "__main__": ...@@ -25,8 +25,8 @@ if __name__ == "__main__":
# 读取配置文件 # 读取配置文件
configs = Mqtt.read_config_from_csv(csv_file_path) configs = Mqtt.read_config_from_csv(csv_file_path)
broker_address = "192.168.1.131" broker_address = "192.168.5.235"
port = 1881 port = 1883
num_repeats = 2000 # 重复执行的次数 num_repeats = 2000 # 重复执行的次数
interval_between_repeats = 1 # 每次重复之间的间隔时间(秒) interval_between_repeats = 1 # 每次重复之间的间隔时间(秒)
......
...@@ -29,7 +29,7 @@ class Main_User_Manage_000x: ...@@ -29,7 +29,7 @@ class Main_User_Manage_000x:
""" """
执行指令: 执行指令:
1.cd 预定系统 1.cd 预定系统
2.hytest --report_title 用户主流程测试报告 --report_url_prefix http://192.168.1.166 --test 用户管理主流程_001 2.hytest --report_title 用户主流程测试报告 --report_url_prefix http://nat.ubainsyun.com:13233 --test 用户管理主流程_001
""" """
def teststeps(self): def teststeps(self):
...@@ -37,7 +37,7 @@ class Main_User_Manage_000x: ...@@ -37,7 +37,7 @@ class Main_User_Manage_000x:
执行测试步骤以用户管理的主流程功能。 执行测试步骤以用户管理的主流程功能。
本函数根据参数添加用户,并使用新增的用户进行登录的提示信息是否与预期相符。 本函数根据参数添加用户,并使用新增的用户进行登录的提示信息是否与预期相符。
""" """
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# 初始化通知文本为空字符串 # 初始化通知文本为空字符串
notify_text = "" notify_text = ""
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
......
...@@ -45,7 +45,7 @@ class User_Chanage_Pwd_000x: ...@@ -45,7 +45,7 @@ class User_Chanage_Pwd_000x:
执行测试步骤以用户新增功能。 执行测试步骤以用户新增功能。
本函数根据参数输入账号、用户名、密码、确认密码、部门、性别、手机号和邮箱,并检查新增后的提示信息是否与预期相符。 本函数根据参数输入账号、用户名、密码、确认密码、部门、性别、手机号和邮箱,并检查新增后的提示信息是否与预期相符。
""" """
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# 初始化通知文本为空字符串 # 初始化通知文本为空字符串
notify_text = "" notify_text = ""
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
...@@ -53,7 +53,7 @@ class User_Chanage_Pwd_000x: ...@@ -53,7 +53,7 @@ class User_Chanage_Pwd_000x:
# 从self.para中解构出用户名、密码、验证码和检查文本 # 从self.para中解构出用户名、密码、验证码和检查文本
name = self.name name = self.name
username, new_password, check_password, check_text, back_check_text = self.para username, new_password, check_password, check_text, back_check_text = self.para
sleep(5)
# 根据条件判断是否执行编辑用户的操作 # 根据条件判断是否执行编辑用户的操作
if name == '用户修改密码_001' or back_check_text == '修改成功': if name == '用户修改密码_001' or back_check_text == '修改成功':
# 执行编辑用户操作的步骤 # 执行编辑用户操作的步骤
......
...@@ -44,7 +44,6 @@ class Add_User_000x: ...@@ -44,7 +44,6 @@ class Add_User_000x:
执行测试步骤以用户新增功能。 执行测试步骤以用户新增功能。
本函数根据参数输入账号、用户名、密码、确认密码、部门、性别、手机号和邮箱,并检查新增后的提示信息是否与预期相符。 本函数根据参数输入账号、用户名、密码、确认密码、部门、性别、手机号和邮箱,并检查新增后的提示信息是否与预期相符。
""" """
login_url = 'https://192.168.5.218/#/login/logindf'
# 初始化通知文本为空字符串 # 初始化通知文本为空字符串
notify_text = "" notify_text = ""
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
...@@ -108,6 +107,7 @@ class Add_User_000x: ...@@ -108,6 +107,7 @@ class Add_User_000x:
sleep(1) sleep(1)
if name == '用户新增_048': if name == '用户新增_048':
login_url = 'http://192.168.5.235:443/#/login/logindf'
# 清除浏览器,再重新打开浏览器 # 清除浏览器,再重新打开浏览器
wd.get(login_url) wd.get(login_url)
# 最大化浏览器窗口 # 最大化浏览器窗口
......
...@@ -42,7 +42,6 @@ class Query_User_000x: ...@@ -42,7 +42,6 @@ class Query_User_000x:
query_text:查询文本 query_text:查询文本
query_type:查询类型 query_type:查询类型
""" """
login_url = 'https://192.168.5.218/#/login/logindf'
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
wd = GSTORE['wd'] wd = GSTORE['wd']
# 从self.para中解构出查询文本以及查询类型 # 从self.para中解构出查询文本以及查询类型
...@@ -106,6 +105,7 @@ class Query_User_000x: ...@@ -106,6 +105,7 @@ class Query_User_000x:
CHECK_POINT("检查搜索结果", query_text in check_text) CHECK_POINT("检查搜索结果", query_text in check_text)
if name == '用户查询_044': if name == '用户查询_044':
login_url = 'http://192.168.5.235:443/#/login/logindf'
# 清除浏览器,再重新打开浏览器 # 清除浏览器,再重新打开浏览器
wd.get(login_url) wd.get(login_url)
# 最大化浏览器窗口 # 最大化浏览器窗口
......
...@@ -40,8 +40,8 @@ class Delete_User_000x: ...@@ -40,8 +40,8 @@ class Delete_User_000x:
执行测试步骤以用户删除功能。 执行测试步骤以用户删除功能。
本函数根据参数输入账号,并检查删除后的数据是否减少。 本函数根据参数输入账号,并检查删除后的数据是否减少。
""" """
login_url = 'https://192.168.5.218/#/login/logindf'
notify_text = "" notify_text = ""
sleep(5)
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
wd = GSTORE['wd'] wd = GSTORE['wd']
# 从self.para中解构出用户名、密码、验证码和检查文本 # 从self.para中解构出用户名、密码、验证码和检查文本
...@@ -89,13 +89,4 @@ class Delete_User_000x: ...@@ -89,13 +89,4 @@ class Delete_User_000x:
CHECK_POINT("检查删除结果", check_text == "暂无数据") CHECK_POINT("检查删除结果", check_text == "暂无数据")
sleep(2) sleep(2)
#屏幕截图 #屏幕截图
SELENIUM_LOG_SCREEN(wd,"50%","User_Manage","User_Delete",f"{name}_查看删除结果") SELENIUM_LOG_SCREEN(wd,"50%","User_Manage","User_Delete",f"{name}_查看删除结果")
\ No newline at end of file
if name == "用户删除_012":
# 清除数据
safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字']"), "默认部门名称", wd)
send_keyboard((By.XPATH, "//input[@placeholder='输入关键字']"), wd)
sleep(1)
safe_click((By.XPATH, "(//span[contains(text(),'删除')])[4]"),wd)
sleep(2)
safe_click((By.XPATH,"(//span[contains(text(),'确定')])[4]"),wd)
\ No newline at end of file
...@@ -44,7 +44,7 @@ class User_Status_000x: ...@@ -44,7 +44,7 @@ class User_Status_000x:
执行测试步骤以用户状态设置功能。 执行测试步骤以用户状态设置功能。
本函数根据参数选择用户进行【启用】与【停用】操作,并检查停用、启用后登录系统的提示信息是否与预期相符。 本函数根据参数选择用户进行【启用】与【停用】操作,并检查停用、启用后登录系统的提示信息是否与预期相符。
""" """
login_url = 'https://192.168.5.218/#/login/logindf' sleep(5)
# 初始化通知文本为空字符串 # 初始化通知文本为空字符串
notify_text = "" notify_text = ""
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
...@@ -132,6 +132,7 @@ class User_Status_000x: ...@@ -132,6 +132,7 @@ class User_Status_000x:
sleep(2) sleep(2)
if name == '用户状态设置_004': if name == '用户状态设置_004':
login_url = 'http://192.168.5.235:443/#/login/logindf'
# 清除浏览器,再重新打开浏览器 # 清除浏览器,再重新打开浏览器
wd.get(login_url) wd.get(login_url)
# 最大化浏览器窗口 # 最大化浏览器窗口
......
...@@ -44,7 +44,7 @@ class User_Edit_000x: ...@@ -44,7 +44,7 @@ class User_Edit_000x:
执行测试步骤以用户新增功能。 执行测试步骤以用户新增功能。
本函数根据参数输入账号、用户名、密码、确认密码、部门、性别、手机号和邮箱,并检查新增后的提示信息是否与预期相符。 本函数根据参数输入账号、用户名、密码、确认密码、部门、性别、手机号和邮箱,并检查新增后的提示信息是否与预期相符。
""" """
login_url = 'https://192.168.5.218/#/login/logindf' sleep(5)
# 初始化通知文本为空字符串 # 初始化通知文本为空字符串
notify_text = "" notify_text = ""
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
......
...@@ -16,7 +16,7 @@ except ModuleNotFoundError as e: ...@@ -16,7 +16,7 @@ except ModuleNotFoundError as e:
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "https://nat.ubainsyun.com:11046"
# login_url = 'http://192.168.5.200:8080/#/login/logindf' # login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
......
...@@ -28,7 +28,7 @@ class Department_Edit_000x: ...@@ -28,7 +28,7 @@ class Department_Edit_000x:
执行测试步骤以部门管理主流程功能。 执行测试步骤以部门管理主流程功能。
本函数根据参数输入部门名称,并检查新增后的提示信息是否与预期相符。 本函数根据参数输入部门名称,并检查新增后的提示信息是否与预期相符。
""" """
login_url = 'https://192.168.5.218/#/login/logindf' sleep(5)
# 初始化通知文本为空字符串 # 初始化通知文本为空字符串
notify_text = "" notify_text = ""
# 从全局存储中获取webdriver实例 # 从全局存储中获取webdriver实例
......
...@@ -10,9 +10,8 @@ from 预定系统.Base.base import * ...@@ -10,9 +10,8 @@ from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
STEP(1, "初始化浏览器") STEP(1, "初始化浏览器")
login_url = 'https://192.168.5.218/#/login/logindf' login_url = 'http://192.168.5.235:443/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046" # login_ngrok_url = "http://nat.ubainsyun.com:16345"
# login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url) browser_init(login_url)
wd = GSTORE['wd'] wd = GSTORE['wd']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论