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

排查展厅巡检中的语音转录与摄像头关闭操作失效问题,原因是缺少一个返回操作,并且麦克风和摄像头的元素定位发生变化导致操作失败,缩短等待时间。

上级 946c9138
......@@ -1002,8 +1002,8 @@ def play_cloud_voice(app_id, app_secret, device_sn):
logging.error(f"发生未知异常: {e}")
# # 示例调用
# if __name__ == "__main__":
# app_id = os.getenv("APP_ID", "a98a124c6c3252f6612fc544a0d0fa79")
# app_secret = os.getenv("APP_SECRET", "88bc1ec4eba624f47b2200a4ce8c3852")
# device_sn = os.getenv("DEVICE_SN", "W703BB44444")
# play_cloud_voice(app_id, app_secret, device_sn)
\ No newline at end of file
if __name__ == "__main__":
app_id = os.getenv("APP_ID", "a98a124c6c3252f6612fc544a0d0fa79")
app_secret = os.getenv("APP_SECRET", "88bc1ec4eba624f47b2200a4ce8c3852")
device_sn = os.getenv("DEVICE_SN", "W703BB44444")
play_cloud_voice(app_id, app_secret, device_sn)
\ No newline at end of file
......@@ -203,3 +203,5 @@
51. 2025-02-10
- 处理展厅巡检测试报告中的参数获取异常。
- 展厅巡检补充离开模式、系统开的操作,将展厅内设备进行断电。
52. 2025-02-12
- 排查展厅巡检中的语音转录与摄像头关闭操作失效问题,原因是缺少一个返回操作,并且麦克风和摄像头的元素定位发生变化导致操作失败,缩短等待时间。
\ No newline at end of file
......@@ -25,100 +25,107 @@ class Exhibition_Meeting_Control_0001:
app_drive = app_setup_driver("Android", "5.1.1", "UT-12", "com.ubains.gviewer.develop",
"com.ubains.gviewer.activity.SplashActivity", "192.168.5.142:5555")
app_drive.implicitly_wait(60) # 设置缺省等待时间
logging.info("等待登录页加载...")
INFO("等待登录页加载...")
sleep(20)
# 点击【进入系统】按钮
enter_system_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.Button[9]")
enter_system_button.click()
sleep(20)
logging.info("进入系统")
sleep(10)
INFO("进入系统")
# 点击【确认】按钮
logging.info("点击【确认】按钮")
INFO("点击【确认】按钮")
confirm_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[2]/android.widget.Button[1]")
confirm_button.click()
sleep(10)
# 进入视频会议模式,使用摄像头跟踪功能
logging.info("进入视频会议模式")
INFO("进入视频会议模式")
video_meeting_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[4]/android.widget.Button[14]")
video_meeting_button.click()
sleep(20)
sleep(10)
# 点击【入住式会议】按钮
logging.info("点击【入住式会议】按钮")
INFO("点击【入住式会议】按钮")
enter_meeting_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[5]/android.widget.Button[2]")
enter_meeting_button.click()
sleep(20)
sleep(10)
# 点击【摄像头跟踪】按钮
logging.info("点击【摄像头跟踪】按钮")
INFO("点击【摄像头跟踪】按钮")
camera_tracking_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[5]/android.widget.Button[30]")
camera_tracking_button.click()
sleep(10)
#选择左屏进行摄像头跟踪
logging.info("选择左屏进行摄像头跟踪")
INFO("选择左屏进行摄像头跟踪")
left_screen_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[3]")
left_screen_button.click()
sleep(20)
sleep(5)
# 返回上一级界面
logging.info("返回上一级界面")
INFO("返回上一级界面")
back_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[1]")
back_button.click()
sleep(10)
sleep(5)
# 点击无纸化
logging.info("点击无纸化")
INFO("点击无纸化")
no_paper_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[5]/android.widget.Button[10]")
no_paper_button.click()
sleep(30)
sleep(5)
# 点击【全部上升】按钮
logging.info("点击【全部上升】按钮")
INFO("点击【全部上升】按钮")
all_up_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[1]")
all_up_button.click()
sleep(30)
sleep(5)
# 点击【返回】按钮
INFO("点击【返回】按钮")
back_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[6]")
back_button.click()
sleep(5)
# 点击左上角logo进入后台
# 等待元素可见,并在可见后执行长按操作。
enter_back_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.Button[1]")
logging.info("点击左上角logo进入后台")
INFO("点击左上角logo进入后台")
enter_back_button.click()
sleep(10)
logging.info("尝试定位麦克风按钮")
sleep(5)
INFO("尝试定位麦克风按钮")
mic_on_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[2]/android.widget.Button[2]")
logging.info("开启麦克风")
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[2]")
INFO("开启麦克风")
mic_on_button.click()
sleep(10)
sleep(5)
# 云喇叭参数
app_id = os.getenv("APP_ID", "a98a124c6c3252f6612fc544a0d0fa79")
app_secret = os.getenv("APP_SECRET", "88bc1ec4eba624f47b2200a4ce8c3852")
device_sn = os.getenv("DEVICE_SN", "W703BB44444")
play_cloud_voice(app_id, app_secret, device_sn)
sleep(10)
sleep(5)
mic_off_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[2]/android.widget.Button[3]")
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[5]")
mic_off_button.click()
sleep(10)
sleep(5)
# 关闭左摄像头
left_camera_off_button = app_drive.find_element(AppiumBy.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[2]/android.widget.Button[5]")
logging.info("关闭左摄像头")
INFO("关闭左摄像头")
left_camera_off_button.click()
sleep(20)
sleep(10)
except Exception as e:
......@@ -129,4 +136,4 @@ class Exhibition_Meeting_Control_0001:
# 确保驱动程序在测试结束后正确关闭
# if app_drive:
# app_drive.quit()
# logging.info("驱动程序已退出。")
\ No newline at end of file
# IN("驱动程序已退出。")
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论