参考地址 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

相关文章:

  • 2021-11-27
  • 2022-12-23
  • 2021-05-08
  • 2021-09-04
  • 2022-12-23
  • 2022-02-21
  • 2021-07-20
  • 2021-05-29
猜你喜欢
  • 2021-09-23
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案