Пример #1
0
class TestBase(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        # 登录
        self.fn_web = FanNengWeb(browser)
        self.fn_web.open(test_login_url)
        self.fn_web.type(LoginPage.user_name, user)
        self.fn_web.type(LoginPage.passwd, pass_wd)
        self.fn_web.type(LoginPage.check_text, '1234')
        self.fn_web.click(LoginPage.submit_button)
        sleep(2)
        self.fn_web.open(operation_index)

    @classmethod
    def tearDownClass(self):
        # 关闭窗口并退出driver
        self.fn_web.close()
        self.fn_web.quit()
Пример #2
0
class TestBase(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        # 登录
        print("···········登录············")
        print("···········browser············", browser)
        print("···········url············", test_login_url)
        print()
        self.fn_web = FanNengWeb(browser)
        self.fn_web.max_window()
        self.fn_web.open(test_login_url)
        self.fn_web.type(LoginPage.user_name, user)
        self.fn_web.type(LoginPage.passwd, pass_wd)
        self.fn_web.click(LoginPage.submit_button)
        sleep(2)

    @classmethod
    def tearDownClass(self):
        print("···········退出浏览器············")
        # 关闭窗口并退出driver
        self.fn_web.close()
        self.fn_web.quit()