前言:看了官方文档,也看了其他文章,self.exec_other_script()方法python已不推荐使用,在setUp方法中直接添加想要启动的内容,一直不生效。目前用以下的方法是生效的,可以尝试下,有问题可以联系我,一起探讨。
- 官方文档:http://airtest.netease.com/docs/cn/5_airtest_framework/3_launcherpy.html?highlight=setup
- 使用using方法添加air脚本
using("setup.air")
from setup import *
- 启动器start.py方法:
from airtest.cli.runner import AirtestCase, run_script
from argparse import *
import airtest.report.report as report
import jinja2
import shutil
import io
from airtest.core.api import *
from airtest.core.api import using
using("setup.air")
from setup import *
class CustomAirtestCase(AirtestCase):
def setUp(self):
print("stock setup")
#self.exec_other_script("setup.air")
super(CustomAirtestCase, self).setUp()
def tearDown(self):
print("stock tearDown")