示例#1
0
 def test_login_user_pwd_error(self):
     '''用户名或密码错误'''
     po = LoginPage(self.driver)
     po.open()
     character = random.choice('zyxwvutsrqponmlkjihgfedcba')
     username = "******" + character
     po.login_action(username, "$#%#")
     sleep(2)
     print(po.login_error_hint())
     self.assertEqual(po.login_error_hint(), '帐号或密码错误')
     function.insert_img(self.driver, "user_pwd_error.jpg")
示例#2
0
 def test_login_pwd_null(self):
     '''密码为空登录'''
     po = LoginPage(self.driver)
     po.open()
     po.login_action('abc', '')
     sleep(2)
     self.assertEqual(po.login_error_hint(), '请输入密码')
     function.insert_img(self.driver, 'pwd_null.jpg')
示例#3
0
 def test_login_user_pwd_null(self):
     '''用户名密码为空登录'''
     po = LoginPage(self.driver, self.url, u'网易')
     po.open()
     po.login_action('', '')
     sleep(2)
     self.assertEqual(po.login_error_hint(), u'请输入帐号')
     function.insert_img(self.driver, 'user_pwd_null.png')