diff --git a/cases/smoke/basic/screenshot32/new_script/resource/entry-default-signed1.hap b/cases/smoke/basic/screenshot32/new_script/resource/entry-default-signed1.hap index 90ba1ad0c67ba93879bbb8205b7ed7e568764846..4604f5ebc42fc9cd6197c794b2c3e9164db92561 100644 Binary files a/cases/smoke/basic/screenshot32/new_script/resource/entry-default-signed1.hap and b/cases/smoke/basic/screenshot32/new_script/resource/entry-default-signed1.hap differ diff --git a/cases/smoke/basic/screenshot32/new_script/testcases/test_hap.py b/cases/smoke/basic/screenshot32/new_script/testcases/test_hap.py index 2ea4be2f14406c2d589b68075c0003884866e1ad..c4080611ceabf21b4ef4a96d3f23c619bdf1c837 100644 --- a/cases/smoke/basic/screenshot32/new_script/testcases/test_hap.py +++ b/cases/smoke/basic/screenshot32/new_script/testcases/test_hap.py @@ -12,6 +12,7 @@ def uninstall_hap(device): yield try: device.uninstall_hap('com.example.helloworld') + device.uninstall_hap('com.example.corodemo.helloworld') except: pass @@ -19,8 +20,10 @@ def uninstall_hap(device): class Test: ability_name = 'EntryAbility' bundle_name = 'com.example.helloworld' + ability_name1= 'EntryAbility' + bundle_name1 = 'com.example.corodemo.helloworld' - @pytest.mark.parametrize('setup_teardown', [bundle_name], indirect=True) + @pytest.mark.parametrize('setup_teardown', [None], indirect=True) def test(self, setup_teardown, device): logging.info('install hap') hap_path = os.path.join(device.resource_path, 'entry-default-signed.hap') @@ -35,3 +38,17 @@ class Test: similarity = compare_image_similarity(main_page, stand_pic) assert similarity > 0.8, '截图对比失败' + + logging.info('install hap1') + hap_path = os.path.join(device.resource_path, 'entry-default-signed1.hap') + device.install_hap(hap_path) + time.sleep(2) + logging.info('start app') + device.start_ability(self.bundle_name1, self.ability_name1) + time.sleep(4) + main_page = device.save_snapshot_to_local('{}_hap1.jpeg'.format(device.sn)) + crop_picture(picture=main_page, x1=0, y1=72, x2=160, y2=162) + stand_pic = os.path.join(device.resource_path, 'hap.jpeg') + + similarity = compare_image_similarity(main_page, stand_pic) + assert similarity > 0.8, '截图对比失败'