def test_action(self): # self.user_login_verify() po = login(self.driver) po.user_login() ho = overview(self.driver) ho.Unified_landing_entrance() self.assertEqual(ho.click_validation(), "5130-7")
def user_login_verify(self): login(self.driver).user_login()
def test_login5(self): '''用户名、密码正确''' self.user_login_verify(username="******", password="******") po = login(self.driver) self.assertEqual(po.login_user_success(username="******"), "admin")
def test_login4(self): '''用户名和密码不匹配''' self.user_login_verify(username="******", password="******") po = login(self.driver) self.assertEqual(po.login_error_hint(), "Login name or password is incorrect.")
def test_login3(self): '''用户名为空,密码正确''' self.user_login_verify(password="******") po = login(self.driver) self.assertEqual(po.login_error_hint(), "Login name or password is incorrect.")
def test_login2(self): '''用户名正确,密码为空登录验证''' self.user_login_verify(username="******", password="") po = login(self.driver) self.assertEqual(po.login_error_hint(), "Login name or password is incorrect.")
def test_login1(self): '''用户名、密码为空登录''' self.user_login_verify() po = login(self.driver) self.assertEqual(po.login_error_hint(), 'Login name or password is incorrect.') screenshots.insert_img(self.driver, "user_pawd_empty.png")
def user_login_verify(self, username="", password=""): login(self.driver).user_login(username, password)