Пример #1
0
 def setUp(self):
     self.driver = webdriver.Chrome()
     self.driver.get(Data.url)
     time.sleep(5)
     l = loginPage.login(self.driver)
     l.login("*****@*****.**", "123456")
     print("Start=====")
Пример #2
0
 def setUp(self):
     self.driver = browser()
     self.driver.get(Data.url)
     time.sleep(5)
     l = login(self.driver)
     l.login(Data.username, Data.password)
     print("Start=====")
Пример #3
0
 def test_login(self):
     '''登录成功并登出'''
     l = loginPage.login(self.driver)
     l.login(Data.username, Data.password)
     time.sleep(3)
     self.assertEqual(l.verify(), True)
     function.screenshot(self.driver, "mainpage.jpg")
     s = sidemenuPage.sidemenu(self.driver)
     s.logout()
     self.assertEqual(s.verify_page(), True)
     function.screenshot(self.driver, "loginpage.jpg")
Пример #4
0
 def test_login_error1(self):
     '''账号格式错误'''
     l = login(self.driver)
     l.login("1", Data.password)
     self.assertEqual(l.error_hint(), "登录:账号格式错误")
     function.screenshot(self.driver, "username_invalid.jpg")
Пример #5
0
 def test_login_error6(self):
     ''' 密码不足6位'''
     l = login(self.driver)
     l.login(Data.username, "1")
     self.assertEqual(l.pop_error_hint(), "最少 6 个字")
     function.screenshot(self.driver, "blank.jpg")
Пример #6
0
 def test_login_error5(self):
     '''输入为空'''
     l = login(self.driver)
     l.login()
     self.assertEqual(l.pop_error_hint(), "不能为空哦")
     function.screenshot(self.driver, "blank.jpg")
Пример #7
0
 def test_login_error4(self):
     '''用户被删除'''
     l = login(self.driver)
     l.login(Data.username_deleted, Data.password_deleted)
     self.assertEqual(l.error_hint(), "登录:账号或密码不正确")
     function.screenshot(self.driver, "account_deleted.jpg")
Пример #8
0
 def test_login_error3(self):
     '''验证码不正确'''
     l = login(self.driver)
     l.login(Data.username, Data.password, "aaaaa")
     self.assertEqual(l.error_hint(), "登录:验证码不正确")
     function.screenshot(self.driver, "code_invalid.jpg")
Пример #9
0
 def test_login_error2(self):
     '''账号密码不正确'''
     l = login(self.driver)
     l.login(Data.username, "111111")
     self.assertEqual(l.error_hint(), "登录:账号或密码不正确")
     function.screenshot(self.driver, "account_invalid.jpg")