def test_login_valid_credential(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "*****@*****.**", "demoadmin", 2) admin_page = page.AdminPage(self.driver) self.assertEqual(admin_page.get_page_title(), "Dashboard")
def test_login_invalid_email_format(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "admin", "demoadmin", 2) self.assertEqual( admin_login_page.get_invalid_login_alert_message(), "The Email field must contain a valid email address.")
def test_login_invalid_username_and_password(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "*****@*****.**", "badpassword", 2) self.assertEqual(admin_login_page.get_page_title(), "Administator Login")
def test_login_invalid_password(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "*****@*****.**", "badpassword", 2) self.assertIn(admin_login_page.get_invalid_login_alert_message(), "Invalid Login Credentials")
def test_admin(self): # right admin mypage1 = page.HomePage(self.driver) mypage1.click_admin() mypage = page.AdminLoginPage(self.driver) mypage.enter_username("Mosa99") mypage.enter_pass("123456789") mypage.check_show_pass() mypage.click_login_btn()
def test_login_empty_password(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "*****@*****.**", "", 2) self.assertEqual(admin_login_page.get_page_title(), "Administator Login")
def test_login_empty_username(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "", "demoadmin", 2) self.assertEqual(admin_login_page.get_page_title(), "Administator Login")
def test_login_empty_username_and_password(self): admin_login_page = page.AdminLoginPage(self.driver) self.login_helper(admin_login_page, "", "", 2) self.assertIn(admin_login_page.get_page_title(), "Administator Login")