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)
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)
class TestBase(unittest.TestCase): fn_web = FanNengWeb(browser) @classmethod def setUpClass(self): self.fn_web.open(test_login_url) self.fn_web.type(dc_password, passwd) self.fn_web.click(dc_login) sleep(2) # self.fn_web.open(operation_index) @classmethod def tearDownClass(self): # 关闭窗口并退出driver self.fn_web.close() self.fn_web.quit()
class TestBase(unittest.TestCase): fn_web = FanNengWeb(browser) @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()
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()