-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun.py
More file actions
32 lines (25 loc) · 870 Bytes
/
Copy pathrun.py
File metadata and controls
32 lines (25 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019-02-26 14:53
# @Author : Innocence
# @Site :
# @File : run.py
# @Software: PyCharm
import pytest, os, subprocess
from tools.loggers import JFMlogging
logger = JFMlogging().getloger()
def init_env():
cmd = "python3 -m uiautomator2 clear-cache"
subprocess.call(cmd, shell=True)
cmd = "python3 -m uiautomator2 init"
subprocess.call(cmd, shell=True)
logger.info("初始化运行环境!")
def init_report():
cmd = "allure generate --clean data -o reports"
subprocess.call(cmd, shell=True)
project_path = os.path.abspath(os.path.dirname(__file__))
report_path = project_path + "/reports/" + "index.html"
logger.info("报告地址:{}".format(report_path))
# init_env()
pytest.main(["-s", "-n 2", "--reruns=2", "testcases", "--alluredir=data"])
init_report()