Merge pull request #7718 from edx/aj/tnl1921-forgot-password-model-not-showing
Forgot password model not visible when user clicks 'Forgot Password' link on CMS.
This commit is contained in:
@@ -63,6 +63,30 @@ class RegisterPage(PageObject):
|
||||
return dashboard
|
||||
|
||||
|
||||
class ResetPasswordPage(PageObject):
|
||||
"""Initialize the page.
|
||||
|
||||
Arguments:
|
||||
browser (Browser): The browser instance.
|
||||
"""
|
||||
url = BASE_URL + "/login#forgot-password-modal"
|
||||
|
||||
def __init__(self, browser):
|
||||
super(ResetPasswordPage, self).__init__(browser)
|
||||
|
||||
def is_browser_on_page(self):
|
||||
return (
|
||||
self.q(css="#login-anchor").is_present() and
|
||||
self.q(css="#password-reset-anchor").is_present()
|
||||
)
|
||||
|
||||
def is_form_visible(self):
|
||||
return (
|
||||
not self.q(css="#login-anchor").visible and
|
||||
self.q(css="#password-reset-form").visible
|
||||
)
|
||||
|
||||
|
||||
class CombinedLoginAndRegisterPage(PageObject):
|
||||
"""Interact with combined login and registration page.
|
||||
|
||||
|
||||
@@ -30,13 +30,33 @@ from ...pages.lms.problem import ProblemPage
|
||||
from ...pages.lms.video.video import VideoPage
|
||||
from ...pages.lms.courseware import CoursewarePage
|
||||
from ...pages.studio.settings import SettingsPage
|
||||
from ...pages.lms.login_and_register import CombinedLoginAndRegisterPage
|
||||
from ...pages.lms.login_and_register import CombinedLoginAndRegisterPage, ResetPasswordPage
|
||||
from ...pages.lms.track_selection import TrackSelectionPage
|
||||
from ...pages.lms.pay_and_verify import PaymentAndVerificationFlow, FakePaymentPage
|
||||
from ...pages.lms.course_wiki import CourseWikiPage, CourseWikiEditPage
|
||||
from ...fixtures.course import CourseFixture, XBlockFixtureDesc, CourseUpdateDesc
|
||||
|
||||
|
||||
@attr('shard_1')
|
||||
class ForgotPasswordPageTest(UniqueCourseTest):
|
||||
"""
|
||||
Test that forgot password forms is rendered if url contains 'forgot-password-modal'
|
||||
in hash.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
""" Initialize the page object """
|
||||
super(ForgotPasswordPageTest, self).setUp()
|
||||
self.reset_password_page = ResetPasswordPage(self.browser)
|
||||
|
||||
def test_reset_password_form_visibility(self):
|
||||
# Navigate to the password reset page
|
||||
self.reset_password_page.visit()
|
||||
|
||||
# Expect that reset password form is visible on the page
|
||||
self.assertTrue(self.reset_password_page.is_form_visible())
|
||||
|
||||
|
||||
@attr('shard_1')
|
||||
class LoginFromCombinedPageTest(UniqueCourseTest):
|
||||
"""Test that we can log in using the combined login/registration page.
|
||||
|
||||
Reference in New Issue
Block a user