def test_login_pawd_null(self): '''密码为空登录''' po = LoginPage(self.browser) po.open() po.login_action("testaaa","") sleep(self.waitback) self.assertEqual(po.login_error(), '请输入密码')
def test_login_user_pawd_null(self): '''用户名、密码为空登录''' po = LoginPage(self.browser) po.open() po.login_action("","") sleep(self.waitback) self.assertEqual(po.login_error(),'请输入帐号')
def test_login_success(self): '''用户名、密码正确,登录成功''' po = LoginPage(self.browser) po.open() po.login_action("simple","111111") sleep(self.waitback) #po2 = MailPage(self.browser) self.assertTrue(po.login_success())
def test_login_user_pawd_error(self): '''用户名、密码为错误''' po = LoginPage(self.browser) po.open() character = random.choice('zyxwvutsrqponmlkjihgfedcba') username = "******" + character po.login_action(username,"@#$%") sleep(self.waitback) self.assertEqual(po.login_error(), '用户名或密码错误')