From adfdf51d870a6b3c957eaafb451600f0e0f558a3 Mon Sep 17 00:00:00 2001 From: redjie Date: Wed, 22 Feb 2023 17:57:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=B9=B2=E5=85=A8=E9=83=A8=E4=BB=93?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E5=85=A8=E9=87=8F=E5=86=92=E7=83=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: redjie --- .../app_capture_screen_test_config.json | 6 ++--- .../resource/capturescreentest.py | 27 ++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json b/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json index 37f3cbb..0095fe8 100644 --- a/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json +++ b/cases/smoke/basic/screenshot32/resource/app_capture_screen_test_config.json @@ -1,7 +1,7 @@ [ { - "DEVICE_1":[], - "DEVICE_2":[1], + "DEVICE_1":[5, 6, 7, 8, 9, 10], + "DEVICE_2":[1, 2, 3, 4], "DEVICE_3":[5, 6, 7, 8, 9, 10], "DEVICE_4":[1, 2, 3, 4], "recent-x-y":[515, 1240], @@ -30,7 +30,7 @@ "crop_range":[140, 450, 30, 500], "kill_settings": ["killall com.ohos.settings"], "all_actions": [ - [1, "shot_cmd", "settings"], [1, "cmp_cmd-level", "settings"], [8, "wlan-x-y"], [1, "shot_cmd", "wlan_list"], [8, "connect_wifi", "wlan_list"], [1, "shot_cmd", "wifi"], + [1, "shot_cmd", "settings"], [1, "cmp_cmd-level", "settings"], [8, "wlan-x-y"], [2, "shot_cmd", "wlan_list"], [10, "connect_wifi", "wlan_list"], [1, "shot_cmd", "wifi"], [1, "cmp_twice", "wifi", 90, "crop_range"], [1, "kill_settings"] ] }, diff --git a/cases/smoke/basic/screenshot32/resource/capturescreentest.py b/cases/smoke/basic/screenshot32/resource/capturescreentest.py index 5765170..f64f982 100644 --- a/cases/smoke/basic/screenshot32/resource/capturescreentest.py +++ b/cases/smoke/basic/screenshot32/resource/capturescreentest.py @@ -158,23 +158,25 @@ def connect_wifi(prefix, pic): data = get_coordinate("{}\\{}_{}".format(args.save_path, prefix, pic), "testapold") enter_shell_cmd("uinput -M -m {} {} -c 0".format(data[0], data[1]), WAIT_TIME_TWO) enter_shell_cmd("uinput -M -m 360 200 -c 0") - enter_shell_cmd("uinput -M -m 680 810 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 80 910 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 150 910 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 150 910 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 110 810 -c 0", WAIT_TIME_HALF) + enter_shell_cmd("uinput -M -m 680 810 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("uinput -M -m 80 910 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("uinput -M -m 150 910 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("uinput -M -m 150 910 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("uinput -M -m 110 810 -c 0", WAIT_TIME_ONE) enter_shell_cmd("uinput -M -m 50 1150 -c 0", WAIT_TIME_TWO) - enter_shell_cmd("uinput -M -m 680 810 -c 0", WAIT_TIME_HALF) + enter_shell_cmd("uinput -M -m 680 810 -c 0", WAIT_TIME_ONE) enter_shell_cmd("uinput -M -m 50 1150 -c 0", WAIT_TIME_TWO) - enter_shell_cmd("uinput -M -m 250 810 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 220 910 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 50 1150 -c 0", WAIT_TIME_TWO) - enter_shell_cmd("uinput -M -m 40 810 -c 0", WAIT_TIME_HALF) - enter_shell_cmd("uinput -M -m 500 1020 -c 0", WAIT_TIME_HALF) + enter_shell_cmd("uinput -M -m 250 810 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("uinput -M -m 220 910 -c 0", WAIT_TIME_ONE) enter_shell_cmd("uinput -M -m 50 1150 -c 0", WAIT_TIME_TWO) + enter_shell_cmd("uinput -M -m 40 810 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("uinput -M -m 500 1020 -c 0", WAIT_TIME_ONE) + enter_shell_cmd("snapshot_display -f /data/screen_test/{}".format("testapold.jpeg")) + file_from_dev("/data/screen_test/{}".format("testapold.jpeg"), args.save_path) enter_shell_cmd("uinput -M -m 680 690 -c 0") enter_shell_cmd("uinput -M -m 550 680 -c 0", single_action[0]) except Exception as e: + print(e) print_to_log("SmokeTest:: wifi list loading errror!") @@ -317,7 +319,6 @@ if __name__ == "__main__": cmp_status = 0 global_pos = all_app[0] - WAIT_TIME_HALF = 0.5 WAIT_TIME_ONE = 1 WAIT_TIME_TWO = 2 WAIT_TIME_FOUR = 4 @@ -438,6 +439,8 @@ if __name__ == "__main__": mode='a', encoding='utf-8') as cmd_f: cmd_f.write("\nSmokeTest::::::Last failed, try again \n") cmd_f.close() + if idx == 1: + testcnt = 1 if single_app['entry'] != "": enter_shell_cmd(call_app_cmd, WAIT_TIME_FOUR) print_to_log("SmokeTest:: execute command {}".format(single_app['all_actions'])) -- Gitee