예제 #1
0
 def test4_wrong_password(self):
     """错误密码登录测试"""
     num = str(random.randint(0, 199))
     pl = PageLogin(self.driver)
     pl.test_login(num + "*****@*****.**", num * 3)
     sleep(3)
     self.assertEqual(pl.login_error(), "你输入的帐号或密码不正确,请重新输入。")
예제 #2
0
 def test3_null_password(self):
     """测试空密码登录"""
     num = str(random.randint(0, 199))
     pl = PageLogin(self.driver)
     pl.test_login(num + "*****@*****.**", "")
     sleep(3)
     self.assertEqual(pl.login_error(), "你还没有输入密码!")
예제 #3
0
 def test_null_password(self):
     """测试空密码登录"""
     pl = PageLogin(self.driver)
     pl.test_login(self.num + "*****@*****.**", "")
     sleep(3)
     get_screenshot(self.driver,
                    "./mail_auto_test/report/img/null_password_login.jpg")
     self.assertEqual(pl.login_error(), "你还没有输入密码!")
예제 #4
0
 def test_null_username(self):
     """测试空户名和空密码登录"""
     pl = PageLogin(self.driver)
     pl.test_login("", "")
     sleep(3)
     get_screenshot(self.driver,
                    "./mail_auto_test/report/img/null_username_login1.jpg")
     self.assertEqual(pl.login_error(), "你还没有输入帐号!")
예제 #5
0
 def test_login_ok(self):
     """正确的用户名和密码登录测试"""
     pl = PageLogin(self.driver)
     pl.test_login()
     self.driver.switch_to.default_content()
     sleep(3)
     get_screenshot(self.driver, "./mail_auto_test/report/img/login_ok.jpg")
     assert(self.text == pl.login_success_hint()), '登录失败!'
예제 #6
0
 def test5_login_ok(self):
     """正确的用户名和密码登录测试"""
     text = '*****@*****.**'
     pl = PageLogin(self.driver)
     pl.test_login()
     self.driver.switch_to.default_content()
     sleep(3)
     assert (text == pl.login_success_hint()), '登录失败!'
예제 #7
0
    def test_wrong_password(self):
        """错误密码登录测试"""

        pl = PageLogin(self.driver)
        pl.test_login(self.num + "*****@*****.**", self.num * 3)
        sleep(3)
        get_screenshot(self.driver,
                       "./mail_auto_test/report/img/wrong_password_login.jpg")
        self.assertEqual(pl.login_error(), "你输入的帐号或密码不正确,请重新输入。")
예제 #8
0
 def test2_null_username(self):
     """测试空户名和密码非空登录"""
     pl = PageLogin(self.driver)
     pl.test_login("", "xxxxxxxxx")
     sleep(3)
     self.assertEqual(pl.login_error(), "你还没有输入帐号!")