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

调整控制顺序.

上级 e7e447e2
...@@ -187,4 +187,4 @@ ...@@ -187,4 +187,4 @@
- 根据测试报告处理统一平台没有截图的问题。调整议题上传函数等待时间。 - 根据测试报告处理统一平台没有截图的问题。调整议题上传函数等待时间。
- 封装云喇叭的注册与播放接口调用,后续对接至展厅巡检流程中。 - 封装云喇叭的注册与播放接口调用,后续对接至展厅巡检流程中。
46. 2025-01-23 46. 2025-01-23
- 增加麦克风与摄像头控制按钮控制,以及云喇叭调用播放音频流程. - 增加麦克风与摄像头控制按钮控制,以及云喇叭调用播放音频流程.调整控制顺序.
\ No newline at end of file \ No newline at end of file
...@@ -27,37 +27,6 @@ class Exhibition_Meeting_Control_0001: ...@@ -27,37 +27,6 @@ class Exhibition_Meeting_Control_0001:
app_drive.implicitly_wait(60) # 设置缺省等待时间 app_drive.implicitly_wait(60) # 设置缺省等待时间
logging.info("等待登录页加载...") logging.info("等待登录页加载...")
sleep(20) sleep(20)
# 点击左上角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进入后台")
enter_back_button.click()
sleep(10)
logging.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("开启麦克风")
mic_on_button.click()
sleep(10)
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)
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]")
mic_off_button.click()
sleep(10)
# 关闭左摄像头
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("关闭左摄像头")
left_camera_off_button.click()
sleep(20)
# 点击【进入系统】按钮 # 点击【进入系统】按钮
enter_system_button = app_drive.find_element(AppiumBy.XPATH, 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]") "/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]")
...@@ -120,6 +89,36 @@ class Exhibition_Meeting_Control_0001: ...@@ -120,6 +89,36 @@ class Exhibition_Meeting_Control_0001:
all_up_button.click() all_up_button.click()
sleep(30) sleep(30)
# 点击左上角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进入后台")
enter_back_button.click()
sleep(10)
logging.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("开启麦克风")
mic_on_button.click()
sleep(10)
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)
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]")
mic_off_button.click()
sleep(10)
# 关闭左摄像头
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("关闭左摄像头")
left_camera_off_button.click()
sleep(20)
except Exception as e: except Exception as e:
# 捕获并记录任何发生的错误 # 捕获并记录任何发生的错误
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论