Beispiel #1
0
    def test_02_null_username_login(self):
        """
        空用户名称登录
        :return:
        """
        loginpage = LoginPage(self.driver)
        loginpage.clear_empspell()
        loginpage.type_empspell("")
        loginpage.type_emppassword('888888')
        loginpage.click_login_button()
        # loginpage.get_windows_img()
        try:
            self.assertTrue("请输入密码" in loginpage.null_empspell.text)
            assert '登陆失败!' in loginpage.get_text()
            print('Test Pass', loginpage.get_text())

        except Exception as e:
            print('Test Fail.', format(e), loginpage.get_text())
Beispiel #2
0
 def test_06_spear_login(self):
     """
     特殊字符登录测试用例
     :return:
     """
     loginpage = LoginPage(self.driver)
     # loginpage.clear_empspell()
     loginpage.type_empspell('~!@#¥%……&*()——+{}|:“《》?【】、;‘,。、')
     # loginpage.clear_emppassword()
     loginpage.type_emppassword('~!@#¥%……&*()——+{}|:“《》?【】、;‘,。、')
     loginpage.click_login_button()
     time.sleep(1)
     # loginpage.get_windows_img()
     try:
         assert '登陆失败!' in loginpage.get_text()
     except Exception as e:
         print('Test Fail', format(e), loginpage.get_text())
     loginpage.clear_empspell()
     loginpage.clear_emppassword()
Beispiel #3
0
    def test_04_error_username_login(self):
        """
        错误用户名登录测试用例
        :return:
        """

        loginpage = LoginPage(self.driver)
        loginpage.clear_empspell()
        loginpage.clear_emppassword()
        # loginpage.clear_empspell()
        loginpage.type_empspell('lili1111111')
        # loginpage.clear_emppassword()
        loginpage.type_emppassword('889989891111')
        loginpage.click_login_button()
        time.sleep(2)
        try:
            assert '登陆失败!' in loginpage.get_text()

        except Exception as e:
            print('Test Fail', format(e), loginpage.get_text())
Beispiel #4
0
    def test_05_error_password_login(self):
        """
        错误密码测试用例
        :return:
        """

        loginpage = LoginPage(self.driver)
        # loginpage.clear_empspell()
        loginpage.type_empspell('liliuyang')
        # loginpage.clear_emppassword()
        loginpage.type_emppassword('999999')
        loginpage.click_login_button()
        time.sleep(1)
        # loginpage.get_windows_img()
        try:
            assert '登陆失败!' in loginpage.get_text()
        except Exception as e:
            print('Test Fail', format(e), loginpage.get_text())
        loginpage.clear_empspell()
        loginpage.clear_emppassword()
Beispiel #5
0
    def test_03_null_password_login(self):
        """
        空密码名称登录
        :return:
        """

        loginpage = LoginPage(self.driver)
        loginpage.clear_empspell()
        loginpage.clear_emppassword()

        loginpage.type_empspell('liliuyang')

        loginpage.type_emppassword("")
        loginpage.click_login_button()
        # loginpage.get_windows_img()
        try:
            self.assertTrue("请输入密码" in loginpage.null_emppassword.text)
            assert '登陆失败!' in loginpage.get_text()
            loginpage.clear_empspell()
            loginpage.clear_emppassword()
            time.sleep(5)

        except Exception as e:
            print('Test Fail.', format(e), loginpage.get_text())