码迷,mamicode.com
首页 > 移动开发 > 详细

python+appium+unittest 启动一次app,执行多条test

时间:2019-09-28 01:10:33      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:csdn   tps   eth   NPU   range   cas   net   ase   close   

参考地址 https://blog.csdn.net/YZF_DD/article/details/85118078

执行用例过程中只启动一次app,减少代码运行时间,利于代码封装

@classmethod
setUpClass
tearDownClass
技术图片
 1 class TestCase(unittest.TestCase):
 2     @classmethod
 3     def setUpClass(self):
 4         print(开始测试)
 5         self.driver = DriverApp().driver()
 6 
 7     # 滑动手机屏幕
 8     def test_001(self):
 9         for i in range(2):
10             GestureMainpulation().swipe_left(self.driver)
11 
12     # 点击立即体验
13     def test_002(self):
14         AppActions().a(self.driver)
15 
16     @classmethod
17     def tearDownClass(self):
18         print("结束测试")
View Code

 

python+appium+unittest 启动一次app,执行多条test

标签:csdn   tps   eth   NPU   range   cas   net   ase   close   

原文地址:https://www.cnblogs.com/ljf520hj/p/11601015.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!