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 1b6cf0a6fe2f14353dc82168befee56f62b98159..fd2311c71b1890552247305b56674490fa99cd95 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)