コード例 #1
0
 def test_login_with_invalid_redirect(self):
     """
     Scenario: Login with an invalid redirect
     Given I have opened a new course in Studio
     And I am not logged in
     And I visit the url "/signin?next=http://www.google.com/"
     When I fill in and submit the signin form
     Then I should see that the path is "/home/"
     """
     self.install_course_fixture()
     # Visit course
     self.course_outline_sign_in_redirect_page.visit()
     # Change redirect url
     self.browser.get(self.browser.current_url.split('=')[0] + '=http://www.google.com')
     # Login
     self.course_outline_sign_in_redirect_page.login(self.user['email'], self.user['password'])
     home = HomePage(self.browser)
     home.wait_for_page()
     self.assertEqual(self.browser.current_url, home.url)
コード例 #2
0
    def test_sign_up_from_home(self):
        """
        Scenario: Sign up from the homepage
        Given I visit the Studio homepage
        When I click the link with the text "Sign Up"
        And I fill in the registration form
        And I press the Create My Account button on the registration form
        Then I should see an email verification prompt
        """
        index_page = IndexPage(self.browser)
        index_page.visit()
        index_page.click_sign_up()

        # Register the user.
        unique_number = uuid.uuid4().hex[:4]
        self.sign_up_page.sign_up_user(
            '{}[email protected]'.format(unique_number),
            '{}-name'.format(unique_number),
            '{}-username'.format(unique_number),
            '{}-password'.format(unique_number),
        )
        home = HomePage(self.browser)
        home.wait_for_page()
コード例 #3
0
 def setUp(self):  # pylint: disable=arguments-differ
     super(HomeHelpTest, self).setUp()
     self.home_page = HomePage(self.browser)
     self.home_page.visit()
コード例 #4
0
 def setUp(self):
     super(LoggedInPagesTest, self).setUp()
     self.auth_page = AutoAuthPage(self.browser, staff=True)
     self.dashboard_page = DashboardPage(self.browser)
     self.home_page = HomePage(self.browser)