代码拉取完成,页面将自动刷新
同步操作将从 默金/APP自动化测试框架pytest+allure+uiautomator2+pom 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# coding: utf-8
import shutil,pytest,os
from multiprocessing import Pool
def run(device_info):
pytest.main([ f"--cmdopt={device_info}",'%s'%device_info['test_case_path'] , "-vs", "--alluredir","target/allure-results"])
os.system('allure generate ./target/allure-results -o ./target/allure-report --clean')
def start_run():
try:
shutil.rmtree("./target") # 删除报告目录,删除后只能看到当前执行后的报告结果,不删除能看到执行的历史执行结果
except:
pass
device_info1 = [
{"devices_list":['0123456789ABCDEF'],"test_case_path":'./test_case','test_data_yaml':"group_data_1.yaml",'NO':"1"},
{"devices_list":['Q5S5T19423012718'],"test_case_path":'./test_case','test_data_yaml':"group_data_2.yaml",'NO':"2"}
]#非交互用例
device_info2 = [
{"devices_list": ['0123456789ABCDEF', 'Q5S5T19423012718', ], "test_case_path": './test_case_jh', 'test_data_yaml': "group_data_1.yaml",'NO':"1"},
#{"devices_list": ['0123456789ABCDEF', 'Q5S5T19423012718', ], "test_case_path": './test_case_jh','test_data_yaml': "group_data_2.yaml",'NO':"2"},
]#交互用例
device_info_list=[device_info1,device_info2]
for device_info in device_info_list:
with Pool(len(device_info)) as pool:#len(device_info)拿到配置的设备数,实现多进程执行,
pool.map(run, (device_info))
pool.close()
pool.join()
if __name__=="__main__":
start_run()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。