From c6e367ea8e07b5a5e0ab37386e0cdcd2bbdfbc32 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 07:22:16 +0000 Subject: [PATCH] update cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 贾孟元 --- .../new_script/testcases/test_launcher.py | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) 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..fd2311c 100644 --- a/cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py +++ b/cases/smoke/basic/screenshot32/new_script/testcases/test_launcher.py @@ -14,20 +14,19 @@ class Test: def test(self, setup_teardown, device): logging.info('compare image similarity') # usb弹窗 - device.unlock() - 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(10) + time.sleep(5) + device.unlock() 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': - # device.click(360, 800) - # time.sleep(10) + time.sleep(1) + + standard_pic = os.path.join(device.resource_path, 'launcher.jpeg') launcher_pic = device.save_snapshot_to_local('{}_launcher.jpeg'.format(device.sn)) similarity = compare_image_similarity(launcher_pic, standard_pic) -- Gitee