def test_login4(self): """用户名、密码正确""" self.user_login_verify(username='******', password='******') sleep(2) po = login(self.driver) self.assertEqual(po.get_url(), 'http://192.168.199.150:8080/#/dashboard') function.insert_img(self.driver, 'user_pawd_empty.jpg')
def test_login3(self): """用户名正确,密码错误""" self.user_login_verify(username='******', password='******') po = login(self.driver) self.assertEqual(po.error(), '登录失败,请确认用户名密码是否正确!') function.insert_img(self.driver, 'pawd_err.jpg')
def test_login1(self): """用户名、密码为空登录""" self.user_login_verify(username='', password='') po = login(self.driver) self.assertEqual(po.error(), '登录失败,请确认用户名密码是否正确!') function.insert_img(self.driver, 'user_pawd_empty.jpg')
def test_login2(self): """用户名错误""" self.user_login_verify(username='******', password='******') po = login(self.driver) self.assertEqual(po.error(), '登录失败,请确认用户名密码是否正确!') function.insert_img(self.driver, 'user_err.jpg')
def user_login_verify(self, username='', password=''): login(self.driver).user_login(username, password)