How to use ignore_export_dir method in Airtest

Best Python code snippet using Airtest

report.py

Source:report.py Github

copy

Full Screen

...306 dirpath = os.path.join(self.export_dir, dirname)307 if os.path.isdir(dirpath):308 shutil.rmtree(dirpath, ignore_errors=True)309 # copy script310 def ignore_export_dir(dirname, filenames):311 # 忽略当前导出的目录,防止递归导出312 if os.path.commonprefix([dirpath, dirname]) == dirpath:313 return filenames314 return []315 self.copy_tree(self.script_root, dirpath, ignore=ignore_export_dir)316 # copy log317 logpath = os.path.join(dirpath, LOGDIR)318 if os.path.normpath(logpath) != os.path.normpath(self.log_root):319 if os.path.isdir(logpath):320 shutil.rmtree(logpath, ignore_errors=True)321 self.copy_tree(self.log_root, logpath, ignore=shutil.ignore_patterns(dirname))322 # if self.static_root is not a http server address, copy static files from local directory323 if not self.static_root.startswith("http"):324 for subdir in ["css", "fonts", "image", "js"]:...

Full Screen

Full Screen

airtestmod.py

Source:airtestmod.py Github

copy

Full Screen

...122 ''')123 replacedata(path,old,new)124def airtestreportmod(path):125 old = '''126 def ignore_export_dir(dirname, filenames):127 # 忽略当前导出的目录,防止递归导出128 if os.path.commonprefix([dirpath, dirname]) == dirpath:129 return filenames130 return []'''131 new = '''132 def ignore_export_dir(dirname, filenames):133 base = ['.svn']134 # 忽略当前导出的目录,防止递归导出135 if os.path.commonprefix([dirpath, dirname]) == dirpath:136 return filenames137 return base'''138 replacedata(path,old,new)139def pocoinputmod(path):140 replacedata(path,'self.use_render_resolution = False','self.use_render_resolution = True')141if __name__ == "__main__":142 libpath = sys.argv[1]143 # libpath = r'C:\Users\tengmu\AppData\Local\Programs\Python\Python37-32\Lib\site-packages'144 airtestpath = os.path.join(libpath,'airtest')145 pocopath = os.path.join(libpath,'poco')146 if os.path.exists(airtestpath):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Airtest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful