3 Star 0 Fork 0

Leo / wlgame-tcs-autotest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
run_report.py 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
# coding:utf-8
import os
import re
from sys import executable
from subprocess import Popen, CREATE_NEW_CONSOLE
def main():
os.popen('adb start-server')
devicelist = os.popen('adb devices').read()
devicelist = re.findall(r'(\w+)\s+device\s', devicelist)
os.popen('adb kill-server')
curPath = os.getcwd()
# 获取case列表
print("用例列表:").decode('utf-8').encode('gb2312')
casePath = "%s\\scripts\\CaseConfig" % curPath
if os.path.exists(casePath):
caseList = os.listdir(casePath)
for i in range(0, len(caseList)):
print("\t%s.%s" % (i, caseList[i]))
print("")
# 选择要执行的case
while True:
caseIndex = raw_input(("请选择要执行的用例:").decode('utf-8').encode('gb2312'))
if caseIndex.isdigit():
if int(caseIndex) >= len(caseList):
print(("该选项不存在,请重新输入").decode('utf-8').encode('gb2312'))
else:
break
else:
print(("请输入数字").decode('utf-8').encode('gb2312'))
caseName = caseList[int(caseIndex)]
# 运行多个手机设备
for deviceSerialNo in devicelist:
airPath = "%s\\scripts\\CaseConfig\\%s" % (curPath, caseName)
filePath = "%s\\export\\%s\\%s" % (curPath, deviceSerialNo.replace('\n', ''), caseName.replace('.air', ''))
command = "airtest report %s --log_root %s --outfile %s\\log.html --export %s\\report --lang zh --plugin poco.utils.airtest.report" % (airPath, filePath, filePath, filePath)
print(command)
os.system("start cmd.exe /c %s" % command)
if __name__ == "__main__":
main()
Python
1
https://gitee.com/hzucmj/wlgame-tcs-autotest.git
git@gitee.com:hzucmj/wlgame-tcs-autotest.git
hzucmj
wlgame-tcs-autotest
wlgame-tcs-autotest
master

搜索帮助