From 6a9925714afbfe1f5941631cd38119bae1bec61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E5=AD=9F=E5=85=83?= Date: Fri, 1 Aug 2025 15:37:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96usb=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 贾孟元 --- .../basic/screenshot32/new_script/conftest.py | 18 +++++++-------- .../new_script/testcases/test_launcher.py | 22 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/cases/smoke/basic/screenshot32/new_script/conftest.py b/cases/smoke/basic/screenshot32/new_script/conftest.py index a3e7244..e5dd4d8 100644 --- a/cases/smoke/basic/screenshot32/new_script/conftest.py +++ b/cases/smoke/basic/screenshot32/new_script/conftest.py @@ -42,15 +42,15 @@ def setup_teardown(request, device): if device.get_focus_window() == 'SystemDialog1': device.click(360, 800) time.sleep(2) - if device.get_focus_window() == 'SystemDialog1': - rst = self.hdc_shell(f'ps -ef | grep -w com.ohos.systemui | grep -v grep') - rst_list = rst.split() - logging.info(f'Process ID: {rst_list[1]}') - device.hdc_shell(f'kill -9 {rst_list[1]}') - #device.click(595, 555) - time.sleep(5) - device.unlock() - #device.click(360, 800) + #if device.get_focus_window() == 'SystemDialog1': + # rst = self.hdc_shell(f'ps -ef | grep -w com.ohos.systemui | grep -v grep') + # rst_list = rst.split() + # logging.info(f'Process ID: {rst_list[1]}') + # device.hdc_shell(f'kill -9 {rst_list[1]}') + # #device.click(595, 555) + # time.sleep(5) + # device.unlock() + device.click(360, 1245) time.sleep(1) #device.click(360, 1245) diff --git a/cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py b/cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py index 1b6cf0a..07af60f 100644 --- a/cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py +++ b/cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py @@ -14,17 +14,19 @@ class Test: def test(self, setup_teardown, device): logging.info('compare image similarity') # usb弹窗 - device.unlock() - time.sleep(2) - #device.click(595, 555) - #time.sleep(10) - device.click(360, 1245) - #device.unlock() - time.sleep(2) - #if device.get_focus_window() == 'SystemDialog1': - # device.click(595, 555) - # time.sleep(10) + + if device.get_focus_window() == 'SystemDialog1': + rst = self.hdc_shell(f'ps -ef | grep -w com.ohos.systemui | grep -v grep') + rst_list = rst.split() + logging.info(f'Process ID: {rst_list[1]}') + device.hdc_shell(f'kill -9 {rst_list[1]}') + # device.click(595, 555) + time.sleep(5) + device.unlock() + + device.click(360, 1245) + time.sleep(1) #if device.get_focus_window() == 'SystemDialog1': # device.click(360, 800) # time.sleep(10) -- Gitee