提交 05190b3f 编写于 作者: L lnlan

添加音频播放用例

Signed-off-by: Nlnlan <lanleinan3@huawei.com>
Change-Id: I0116e0c6de0976ada6140f810b1a7f5cc34bf08c
上级 e5dcb326
......@@ -46,6 +46,7 @@ if __name__ == "__main__":
for single_app in all_app[1:]:
print(single_app['entry'])
print(single_app['all_actions'])
sys.stdout.flush()
call_app_cmd = "hdc_std shell " + single_app['entry']
send_file_cmd = "hdc_std file send {} {}"
capture_screen_cmd = "hdc_std shell /data/screen_test/printscreen -f /data/screen_test/{}"
......@@ -62,11 +63,15 @@ if __name__ == "__main__":
else:
pic_name = single_app['app_name'] + ".png"
raw_pic_name = single_app['app_name'] + ".pngraw"
next_cmd = capture_screen_cmd.format(pic_name)
EnterCmd(capture_screen_cmd.format(pic_name), 1)
EnterCmd(recv_file_cmd.format(pic_name, args.save_path), 1)
EnterCmd(recv_file_cmd.format(raw_pic_name, args.save_path), 1)
next_cmd = ""
#cmp_cmd-level is stable, different to other cmd,so handle it specialy
elif type(single_action[1]) == str and single_action[1] == 'cmp_cmd-level':
next_cmd = ""
print(send_file_cmd.format(os.path.join(args.anwser_path, raw_pic_name), "/data/screen_test/train_set"))
sys.stdout.flush()
EnterCmd(send_file_cmd.format(os.path.join(args.anwser_path, raw_pic_name), "/data/screen_test/train_set"))
new_cmp_cmd = cmp_cmd.format(raw_pic_name, raw_pic_name)
if len(single_action) == 3:
......@@ -75,13 +80,12 @@ if __name__ == "__main__":
tolerance = global_pos['cmp_cmd-level'][1]
p = EnterCmd(new_cmp_cmd, single_action[0])
num = re.findall(r'[-+]?\d+', p[0])
EnterCmd(recv_file_cmd.format(pic_name, args.save_path))
EnterCmd(recv_file_cmd.format(raw_pic_name, args.save_path))
if type(num) == list and len(num) > 0 and int(num[0]) < tolerance:
print("{} screenshot check is ok!\n\n".format(raw_pic_name))
else:
print("{} screenshot check is abnarmal!\n\n".format(raw_pic_name))
print("ERROR:{} screenshot check is abnarmal!\n\n".format(raw_pic_name))
cmp_status = cmp_status + 1
sys.stdout.flush()
#other cmd handle
elif type(single_action[1]) == str:
if single_action[1] not in single_app.keys():
......@@ -98,8 +102,9 @@ if __name__ == "__main__":
if findsome != -1:
print("\"{}\" execut result success!\n\n".format(target_[0]))
else:
print("\"{}\" execut result failed!\n\n".format(target_[0]))
print("ERROR:\"{}\" execut result failed!\n\n".format(target_[0]))
cmp_status = cmp_status + 1
sys.stdout.flush()
#this cmd only is a name of x,y postion, to get x,y an click it
else:
next_cmd = "hdc_std shell input -M -m {} {} -c 0".format(target_[0], target_[1])
......@@ -109,9 +114,10 @@ if __name__ == "__main__":
EnterCmd(next_cmd, single_action[0])
if cmp_status != 0:
print("screenshot check is abnarmal {}".format(cmp_status))
print("ERROR:screenshot check is abnarmal {}".format(cmp_status))
print("End of check, test failed!")
else:
print("screenshot check is ok {}".format(cmp_status))
print("End of check, test succeeded!")
sys.stdout.flush()
sys.exit(cmp_status)
\ No newline at end of file
[
{
"return-x-y":[199, 1262],
"recent-x-y":[500, 1262],
"home-x-y":[350, 1262],
"recent_del-x-y":[350, 1140],
"permisson_ok-x-y":[495, 690],
"permisson_no-x-y":[241, 690],
"shot_cmd":[""],
"cmp_cmd-level":["", 443200]
},
"return-x-y":[199, 1262],
"recent-x-y":[500, 1262],
"home-x-y":[350, 1262],
"recent_del-x-y":[350, 1140],
"permisson_ok-x-y":[495, 690],
"permisson_no-x-y":[241, 690],
"shot_cmd":[""],
"remount":["hdc_std shell mount -o rw,remount /"],
"cmp_cmd-level":["", 443200]
},
{
"app_name": "audio_render",
"entry": "",
"remount":["hdc_std shell mount -o rw,remount /"],
"sendfile1":["hdc_std file send D:\\DeviceTestTools\\screenshot\\audiotest\\hdf_audio_hdi_server_function_test /data/"],
"sendfile2":["hdc_std file send D:\\DeviceTestTools\\screenshot\\audiotest\\audiorendertest.wav /bin/"],
"chmodfile1":["hdc_std shell chmod 777 /data/hdf_audio_hdi_server_function_test"],
"executefile1":["hdc_std shell ./data/hdf_audio_hdi_server_function_test"],
"audio_render_test":["hdc_std shell \"cd /data && ./hdf_audio_hdi_server_function_test --gtest_filter=AudioServerFunctionTest.SUB_Audio_Function_Render_Test_* && rm *.xml\"", "[ PASSED ] 12 tests."],
"audio_capture_test":["hdc_std shell \"cd /data && ./hdf_audio_hdi_server_function_test --gtest_filter=AudioServerFunctionTest.SUB_Audio_Function_Capture_Test_* && rm *.xml\"", "[ PASSED ] 10 test."],
"all_actions": [
[2, "remount"], [2, "sendfile1"], [2, "sendfile2"], [2, "chmodfile1"],
[5, "audio_render_test"]
]
},
{
"app_name": "launcher",
"entry": "",
......@@ -18,9 +34,9 @@
"app_name": "settings",
"entry": "aa start -a com.ohos.settings.MainAbility -b com.ohos.settings",
"all_actions": [
[3, "shot_cmd", "settings"], [3, "cmp_cmd-level"], [3, 400, 120], [3, 400, 120], [20, 400, 80], [3, 400, 80],
[3, "shot_cmd", "keyboard"], [3, "recent-x-y"], [3, "recent_del-x-y"], [3, "recent-x-y"], [3, "recent_del-x-y"], [3, "cmp_cmd-level", 200000]
]
[3, "shot_cmd", "settings"], [3, "cmp_cmd-level"], [3, 400, 120], [3, 400, 120], [20, 400, 80], [3, 400, 80],
[3, "shot_cmd", "keyboard"], [3, "recent-x-y"], [3, "recent_del-x-y"], [3, "recent-x-y"], [3, "recent_del-x-y"], [3, "cmp_cmd-level", 200000]
]
},
{
"app_name": "photos",
......@@ -41,50 +57,18 @@
"app_name": "camera",
"entry": "aa start -a com.ohos.camera.MainAbility -b com.ohos.camera",
"all_actions": [
[2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"],
[2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"]
]
[2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"],
[2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"]
]
},
{
"app_name": "camera",
"entry": "aa start -a com.ohos.camera.MainAbility -b com.ohos.camera",
"all_actions": [[2, "shot_cmd"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "cmp_cmd-level", 3686400]]
},
{
"app_name": "contacts",
"entry": "aa start -a com.ohos.contacts.MainAbility -b com.ohos.contacts",
"all_actions": [
[2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"],
[2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"]
]
},
{
"app_name": "contacts",
"entry": "aa start -a com.ohos.contacts.MainAbility -b com.ohos.contacts",
"all_actions": [[2, "shot_cmd"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "cmp_cmd-level", 3686400], [2, "recent-x-y"], [2, "recent_del-x-y"]]
},
{
"app_name": "music",
"entry": "aa start -a com.ohos.distributedmusicplayer.MainAbility -b com.ohos.distributedmusicplayer",
"all_actions": [[2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"]]
},
{
"app_name": "music",
"entry": "aa start -a com.ohos.distributedmusicplayer.MainAbility -b com.ohos.distributedmusicplayer",
"all_actions": [[2, "permisson_ok-x-y"], [2, "shot_cmd"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "cmp_cmd-level", 3686400]]
},
{
"app_name": "mms",
"entry": "aa start -a com.ohos.mms.MainAbility -b com.ohos.mms",
"all_actions": [
[2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"],
[2, "shot_cmd"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "cmp_cmd-level", 3686400]
]
},
{
"app_name": "note",
"entry": "aa start -a com.ohos.note.MainAbility -b com.ohos.note",
"all_actions": [[2, "shot_cmd"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "cmp_cmd-level", 3686400]]
"all_actions": [[2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "permisson_ok-x-y"], [2, "shot_cmd"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "recent-x-y"], [2, "recent_del-x-y"], [2, "cmp_cmd-level"]]
}
]
\ No newline at end of file
......@@ -46,6 +46,7 @@ if __name__ == "__main__":
for single_app in all_app[1:]:
print(single_app['entry'])
print(single_app['all_actions'])
sys.stdout.flush()
call_app_cmd = "hdc_std shell " + single_app['entry']
send_file_cmd = "hdc_std file send {} {}"
capture_screen_cmd = "hdc_std shell /data/screen_test/printscreen -f /data/screen_test/{}"
......@@ -62,11 +63,15 @@ if __name__ == "__main__":
else:
pic_name = single_app['app_name'] + ".png"
raw_pic_name = single_app['app_name'] + ".pngraw"
next_cmd = capture_screen_cmd.format(pic_name)
EnterCmd(capture_screen_cmd.format(pic_name), 1)
EnterCmd(recv_file_cmd.format(pic_name, args.save_path), 1)
EnterCmd(recv_file_cmd.format(raw_pic_name, args.save_path), 1)
next_cmd = ""
#cmp_cmd-level is stable, different to other cmd,so handle it specialy
elif type(single_action[1]) == str and single_action[1] == 'cmp_cmd-level':
next_cmd = ""
print(send_file_cmd.format(os.path.join(args.anwser_path, raw_pic_name), "/data/screen_test/train_set"))
sys.stdout.flush()
EnterCmd(send_file_cmd.format(os.path.join(args.anwser_path, raw_pic_name), "/data/screen_test/train_set"))
new_cmp_cmd = cmp_cmd.format(raw_pic_name, raw_pic_name)
if len(single_action) == 3:
......@@ -75,13 +80,12 @@ if __name__ == "__main__":
tolerance = global_pos['cmp_cmd-level'][1]
p = EnterCmd(new_cmp_cmd, single_action[0])
num = re.findall(r'[-+]?\d+', p[0])
EnterCmd(recv_file_cmd.format(pic_name, args.save_path))
EnterCmd(recv_file_cmd.format(raw_pic_name, args.save_path))
if type(num) == list and len(num) > 0 and int(num[0]) < tolerance:
print("{} screenshot check is ok!\n\n".format(raw_pic_name))
else:
print("{} screenshot check is abnarmal!\n\n".format(raw_pic_name))
print("ERROR:{} screenshot check is abnarmal!\n\n".format(raw_pic_name))
cmp_status = cmp_status + 1
sys.stdout.flush()
#other cmd handle
elif type(single_action[1]) == str:
if single_action[1] not in single_app.keys():
......@@ -98,8 +102,9 @@ if __name__ == "__main__":
if findsome != -1:
print("\"{}\" execut result success!\n\n".format(target_[0]))
else:
print("\"{}\" execut result failed!\n\n".format(target_[0]))
print("ERROR:\"{}\" execut result failed!\n\n".format(target_[0]))
cmp_status = cmp_status + 1
sys.stdout.flush()
#this cmd only is a name of x,y postion, to get x,y an click it
else:
next_cmd = "hdc_std shell input -M -m {} {} -c 0".format(target_[0], target_[1])
......@@ -109,9 +114,10 @@ if __name__ == "__main__":
EnterCmd(next_cmd, single_action[0])
if cmp_status != 0:
print("screenshot check is abnarmal {}".format(cmp_status))
print("ERROR:screenshot check is abnarmal {}".format(cmp_status))
print("End of check, test failed!")
else:
print("screenshot check is ok {}".format(cmp_status))
print("End of check, test succeeded!")
sys.stdout.flush()
sys.exit(cmp_status)
\ No newline at end of file
screenshot/rk_master/note.png

118.3 KB | W: | H:

screenshot/rk_master/note.png

153.7 KB | W: | H:

screenshot/rk_master/note.png
screenshot/rk_master/note.png
screenshot/rk_master/note.png
screenshot/rk_master/note.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -46,6 +46,7 @@ if __name__ == "__main__":
for single_app in all_app[1:]:
print(single_app['entry'])
print(single_app['all_actions'])
sys.stdout.flush()
call_app_cmd = "hdc_std shell " + single_app['entry']
send_file_cmd = "hdc_std file send {} {}"
capture_screen_cmd = "hdc_std shell /data/screen_test/printscreen -f /data/screen_test/{}"
......@@ -62,11 +63,15 @@ if __name__ == "__main__":
else:
pic_name = single_app['app_name'] + ".png"
raw_pic_name = single_app['app_name'] + ".pngraw"
next_cmd = capture_screen_cmd.format(pic_name)
EnterCmd(capture_screen_cmd.format(pic_name), 1)
EnterCmd(recv_file_cmd.format(pic_name, args.save_path), 1)
EnterCmd(recv_file_cmd.format(raw_pic_name, args.save_path), 1)
next_cmd = ""
#cmp_cmd-level is stable, different to other cmd,so handle it specialy
elif type(single_action[1]) == str and single_action[1] == 'cmp_cmd-level':
next_cmd = ""
print(send_file_cmd.format(os.path.join(args.anwser_path, raw_pic_name), "/data/screen_test/train_set"))
sys.stdout.flush()
EnterCmd(send_file_cmd.format(os.path.join(args.anwser_path, raw_pic_name), "/data/screen_test/train_set"))
new_cmp_cmd = cmp_cmd.format(raw_pic_name, raw_pic_name)
if len(single_action) == 3:
......@@ -75,13 +80,12 @@ if __name__ == "__main__":
tolerance = global_pos['cmp_cmd-level'][1]
p = EnterCmd(new_cmp_cmd, single_action[0])
num = re.findall(r'[-+]?\d+', p[0])
EnterCmd(recv_file_cmd.format(pic_name, args.save_path))
EnterCmd(recv_file_cmd.format(raw_pic_name, args.save_path))
if type(num) == list and len(num) > 0 and int(num[0]) < tolerance:
print("{} screenshot check is ok!\n\n".format(raw_pic_name))
else:
print("{} screenshot check is abnarmal!\n\n".format(raw_pic_name))
print("ERROR:{} screenshot check is abnarmal!\n\n".format(raw_pic_name))
cmp_status = cmp_status + 1
sys.stdout.flush()
#other cmd handle
elif type(single_action[1]) == str:
if single_action[1] not in single_app.keys():
......@@ -98,23 +102,22 @@ if __name__ == "__main__":
if findsome != -1:
print("\"{}\" execut result success!\n\n".format(target_[0]))
else:
print("\"{}\" execut result failed!\n\n".format(target_[0]))
print("ERROR:\"{}\" execut result failed!\n\n".format(target_[0]))
cmp_status = cmp_status + 1
sys.stdout.flush()
#this cmd only is a name of x,y postion, to get x,y an click it
else:
next_cmd = "hdc_std shell input -M -m {} {} -c 0".format(target_[0], target_[1])
#recent_del sometimes click no effect,so double click
if single_action[1] == 'recent_del-x-y':
EnterCmd(next_cmd, single_action[0])
#input x,y postion, to click it
else:
next_cmd = "hdc_std shell input -M -m {} {} -c 0".format(single_action[1], single_action[2])
EnterCmd(next_cmd, single_action[0])
if cmp_status != 0:
print("screenshot check is abnarmal {}".format(cmp_status))
print("ERROR:screenshot check is abnarmal {}".format(cmp_status))
print("End of check, test failed!")
else:
print("screenshot check is ok {}".format(cmp_status))
print("End of check, test succeeded!")
sys.stdout.flush()
sys.exit(cmp_status)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册