예제 #1
0
    def before_func(self):
        DriverUtil.get_driver()  # 获取驱动对象
        self.factory = PageFactory()

        yield  # 结束操作
        time.sleep(3)
        DriverUtil.quit_driver()  # 退出驱动对象
예제 #2
0
 def tearDownClass(cls):
     DriverUtil.quit_driver()
예제 #3
0
 def tearDownClass(cls) -> None:
     DriverUtil.quit_driver()  # 退出浏览器对象
예제 #4
0
import time
import unittest

from report.HTMLTestRunner.HTMLTestRunner import HTMLTestRunner
from script.cart_case import TestCart
from script.login_case import TestLogin
from utils import DriverUtil

suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLogin))
suite.addTest(unittest.makeSuite(TestCart))
DriverUtil.kaiguan = False
with open("./report/report.html", "wb") as f:
    runner = HTMLTestRunner(stream=f, title="tpshop商城测试用例", description="报告描述")
    runner.run(suite)

DriverUtil.kaiguan = True
DriverUtil.quit_driver()
예제 #5
0
 def tearDownClass(cls):
     sleep(2)
     DriverUtil.quit_driver()  # 退出浏览器对象
예제 #6
0
 def tearDownClass(cls):
     time.sleep(3)
     DriverUtil.quit_driver()  # 退出浏览器对象