def test_login_pawd_null(self): '''密码为空登录''' po = LoginPage(self.driver) po.open() po.login_action("testaaa", "") sleep(2) self.assertEqual(po.login_error_hint(), '请输入密码')
def test_login_user_pawd_null(self): '''用户名、密码为空登录''' po = LoginPage(self.driver) po.open() po.login_action("", "") sleep(2) self.assertEqual(po.login_error_hint(), '请输入帐号')
def test_login_pawd_null(self): '''密码为空登录''' po = LoginPage(self.driver) po.open() po.login_action("testaaa","") sleep(2) self.assertEqual(po.login_error_hint(), '登录失败,请检查您的用户名或密码是否填写正确。')
def test_login_success(self): '''用户名、密码正确,登录成功''' po = LoginPage(self.driver) po.open() user = "******" po.login_action(user, "password") sleep(2) po2 = MailPage(self.driver) self.assertEqual(po2.login_success_user(), user + "@163.com")
def test_login_user_pawd_error(self): '''用户名、密码为错误''' po = LoginPage(self.driver) po.open() character = random.choice('zyxwvutsrqponmlkjihgfedcba') username = "******" + character po.login_action(username, "@#$%") sleep(2) self.assertEqual(po.login_error_hint(), '帐号或密码错误')
def test_login_success(self): '''用户名、密码正确,登录成功''' po = LoginPage(self.driver) po.open() user = "******" po.login_action(user,"123456") sleep(2) po2 = homePage(self.driver) self.assertEqual(po2.login_success_user(),'何美建')
def test_login_user_pawd_error(self): '''用户名、密码为错误''' po = LoginPage(self.driver) po.open() character = random.choice('登录失败,请检查您的用户名或密码是否填写正确。') username = "******" + character po.login_action(username,"@#$%") sleep(2) self.assertEqual(po.login_error_hint(), '登录失败,请检查您的用户名或密码是否填写正确。')