diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/acl_whitelist.json b/cases/smoke/basic/screenshotP7885/new_script/resource/acl_whitelist.json index 3f68f4f6..7b490c16 100644 --- a/cases/smoke/basic/screenshotP7885/new_script/resource/acl_whitelist.json +++ b/cases/smoke/basic/screenshotP7885/new_script/resource/acl_whitelist.json @@ -280,7 +280,8 @@ "processName": "distributeddata", "acls": [ "ohos.permission.MONITOR_DEVICE_NETWORK_STATE", - "ohos.permission.GRANT_URI_PERMISSION_PRIVILEGED" + "ohos.permission.GRANT_URI_PERMISSION_PRIVILEGED", + "ohos.permission.ACCESS_EXT_SYSTEM_ABILITY" ] }, { @@ -374,6 +375,13 @@ "ohos.permission.HIVIEW_TRACE_MANAGE" ] }, + { + "processName": "hiprofilerd", + "acls": [ + "ohos.permission.DUMP", + "ohos.permission.GET_BUNDLE_INFO" + ] + }, { "processName": "mechbody", "acls": [ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/contacts.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/contacts.jpeg index 64c52a78..566836f3 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/contacts.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/contacts.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/controller_center.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/controller_center.jpeg index 42714684..fc6f3f26 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/controller_center.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/controller_center.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/distributedmusicplayer.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/distributedmusicplayer.jpeg index 29c90c16..586165cc 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/distributedmusicplayer.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/distributedmusicplayer.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/launcher.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/launcher.jpeg index 212493f6..a6249e8d 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/launcher.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/launcher.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/mms.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/mms.jpeg index b76c16a0..57d408e2 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/mms.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/mms.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/note.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/note.jpeg index efae17c6..1c92bb3d 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/note.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/note.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/photos.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/photos.jpeg index cda8d175..2ab9b5d5 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/photos.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/photos.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/resource/settings.jpeg b/cases/smoke/basic/screenshotP7885/new_script/resource/settings.jpeg index 58195f73..9c1dd536 100644 Binary files a/cases/smoke/basic/screenshotP7885/new_script/resource/settings.jpeg and b/cases/smoke/basic/screenshotP7885/new_script/resource/settings.jpeg differ diff --git a/cases/smoke/basic/screenshotP7885/new_script/testcases.json b/cases/smoke/basic/screenshotP7885/new_script/testcases.json index ce74b5f7..f84c016b 100644 --- a/cases/smoke/basic/screenshotP7885/new_script/testcases.json +++ b/cases/smoke/basic/screenshotP7885/new_script/testcases.json @@ -15,13 +15,17 @@ "case_file": "testcases/test_acl_check.py", "description": "外部用例ACL白名单检查" }, + { + "case_file": "testcases/test_note.py", + "description": "备忘录应用测试" + }, { "case_file": "testcases/test_settings_wifi.py", "description": "设置和wlan开关测试" }, { - "case_file": "testcases/test_crash_check.py", - "description": "crash检查" + "case_file": "testcases/test_camera.py", + "description": "照相机测试" }, { "case_file": "testcases/test_photos.py", @@ -39,16 +43,12 @@ "case_file": "testcases/test_distributed_musicplayer.py", "description": "音乐测试" }, - { - "case_file": "testcases/test_camera.py", - "description": "照相机测试" - }, { "case_file": "testcases/test_controller_center.py", "description": "控制中心测试" }, { - "case_file": "testcases/test_note.py", - "description": "备忘录应用测试" + "case_file": "testcases/test_crash_check.py", + "description": "crash检查" } ] \ No newline at end of file diff --git a/cases/smoke/basic/screenshotP7885/new_script/testcases/test_camera.py b/cases/smoke/basic/screenshotP7885/new_script/testcases/test_camera.py index 71628cd4..e9254b4f 100644 --- a/cases/smoke/basic/screenshotP7885/new_script/testcases/test_camera.py +++ b/cases/smoke/basic/screenshotP7885/new_script/testcases/test_camera.py @@ -17,7 +17,7 @@ class Test: device.save_snapshot_to_local('{}_camera_step1.jpeg'.format(device.sn)) logging.info('click shot button') - device.click(600, 1741) + device.click(600, 1598) time.sleep(2) device.save_snapshot_to_local('{}_camera_step2.jpeg'.format(device.sn)) @@ -30,17 +30,17 @@ class Test: device.save_snapshot_to_local('{}_camera_step3.jpeg'.format(device.sn)) logging.info('click shot button') - device.click(600, 1741) + device.click(600, 1598) time.sleep(5) device.save_snapshot_to_local('{}_camera_step4.jpeg'.format(device.sn)) logging.info('stop recoding') - device.click(561, 1741) + device.click(600, 1598) time.sleep(3) device.save_snapshot_to_local('{}_camera_step5.jpeg'.format(device.sn)) logging.info('click left behind button in order to switch to gallery app') - device.click(437, 1740) + device.click(312, 1598) time.sleep(5) device.save_snapshot_to_local('{}_camera_step6.jpeg'.format(device.sn)) device.assert_process_running(self.photo_bundle_name) diff --git a/cases/smoke/basic/screenshotP7885/new_script/testcases/test_process.py b/cases/smoke/basic/screenshotP7885/new_script/testcases/test_process.py index 11751e97..84e1d0a1 100644 --- a/cases/smoke/basic/screenshotP7885/new_script/testcases/test_process.py +++ b/cases/smoke/basic/screenshotP7885/new_script/testcases/test_process.py @@ -23,7 +23,6 @@ import pytest class Test: pid_list = [ - 'com.ohos.launcher', 'render_service', ] @@ -68,7 +67,6 @@ class Test: 'wifi_host', 'usb_host', 'blue_host', - 'com.ohos.systemui', 'power_host', ] diff --git a/cases/smoke/basic/screenshotP7885/new_script/utils/device.py b/cases/smoke/basic/screenshotP7885/new_script/utils/device.py index f28d04d6..286bddac 100644 --- a/cases/smoke/basic/screenshotP7885/new_script/utils/device.py +++ b/cases/smoke/basic/screenshotP7885/new_script/utils/device.py @@ -401,6 +401,7 @@ class Device: self.hdc_file_recv(tmp_file, self.report_path) # 根据实际屏幕分辨率裁剪截图 + logging.info(f'截图分辨率: {self.width}x{self.height}') crop_picture(save_file, self.width, self.height) return save_file diff --git a/cases/smoke/basic/screenshotP7885/new_script/utils/images.py b/cases/smoke/basic/screenshotP7885/new_script/utils/images.py index 792715d1..659d603b 100644 --- a/cases/smoke/basic/screenshotP7885/new_script/utils/images.py +++ b/cases/smoke/basic/screenshotP7885/new_script/utils/images.py @@ -18,12 +18,11 @@ def crop_picture(picture, width=720, height=1280): img_height, img_width = img.shape[:2] # 顶部状态栏、底部导航栏需要去除的高度 - status_bar_height = 120 - navigation_bar_height = 1800 + status_bar_height = 90 # 裁剪去除状态栏,保留完整屏幕内容 x1, y1 = 0, status_bar_height - x2, y2 = img_width, navigation_bar_height + x2, y2 = img_width, img_height img = img[y1:y2, x1:x2] cv2.imwrite(picture, img)