コード例 #1
0
ファイル: test_rendering.py プロジェクト: edx/credentials
    def test_student_dashboard_with_revoked_certificate(self):
        """Verify that no links to XSeries credentials are displayed on the student dashboard if
        status of the credential is revoked."""
        self.change_credential_status('revoked')
        self.login_with_lms()
        student_dashboard = LMSDashboardPage(self.browser).wait_for_page()
        student_dashboard.is_browser_on_page()

        student_dashboard.go_to_programs_tab()
        program_listing_page = LMSProgramListingPage(self.browser).wait_for_page()
        program_listing_page.is_browser_on_page()

        self.assertFalse(program_listing_page.are_credential_links_present())
コード例 #2
0
    def test_student_dashboard_with_certificate(self):
        """Verify that links to XSeries credentials are displayed on the student dashboard."""
        self.login_with_lms()
        student_dashboard = LMSDashboardPage(self.browser).wait_for_page()
        student_dashboard.is_browser_on_page()

        student_dashboard.go_to_programs_tab()
        program_listing_page = LMSProgramListingPage(
            self.browser).wait_for_page()
        program_listing_page.is_browser_on_page()

        self.assertTrue(program_listing_page.are_credential_links_present())

        credential_link = program_listing_page.get_credential_link()

        program_listing_page.click_credential_link()
        WebDriverWait(self.browser, 10).until(
            EC.presence_of_element_located((By.ID, "action-print-view")))

        # check the credential hash-id matches with rendered credential page.
        self.assertIn(
            self.browser.find_elements_by_css_selector(
                ".accomplishment-stamp-validity span:nth-of-type(2)")[0].text,
            credential_link,
        )
コード例 #3
0
ファイル: test_rendering.py プロジェクト: edx/credentials
    def test_student_dashboard_with_certificate(self):
        """Verify that links to XSeries credentials are displayed on the student dashboard."""
        self.login_with_lms()
        student_dashboard = LMSDashboardPage(self.browser).wait_for_page()
        student_dashboard.is_browser_on_page()

        student_dashboard.go_to_programs_tab()
        program_listing_page = LMSProgramListingPage(self.browser).wait_for_page()
        program_listing_page.is_browser_on_page()

        self.assertTrue(program_listing_page.are_credential_links_present())

        credential_link = program_listing_page.get_credential_link()

        program_listing_page.click_credential_link()
        WebDriverWait(self.browser, 10).until(EC.presence_of_element_located((By.ID, 'action-print-view')))

        # check the credential hash-id matches with rendered credential page.
        self.assertIn(
            self.browser.find_elements_by_css_selector('.accomplishment-stamp-validity span:nth-of-type(2)')[0].text,
            credential_link
        )
コード例 #4
0
ファイル: mixins.py プロジェクト: siddhartharay007/ecommerce
    def unenroll_via_dashboard(self, course_id):
        """ Unenroll the current user from a course via the LMS dashboard. """
        LMSDashboardPage(self.browser).visit()

        # Find the (hidden) unenroll link
        unenroll_link = self.browser.find_element_by_css_selector(
            'a.action-unenroll[data-course-id="{}"]'.format(course_id))

        # Show the link by clicking on the parent element
        unenroll_link.find_element_by_xpath(".//ancestor::div[contains(@class, 'wrapper-action-more')]/button").click()

        # Unenroll
        unenroll_link.click()
        self.browser.find_element_by_css_selector('#unenroll_form input[name=submit]').click()
コード例 #5
0
    def test_student_dashboard_with_revoked_certificate(self):
        """Verify that no links to XSeries credentials are displayed on the student dashboard if
        status of the credential is revoked."""
        self.change_credential_status('revoked')
        self.login_with_lms()
        student_dashboard = LMSDashboardPage(self.browser).wait_for_page()
        student_dashboard.is_browser_on_page()

        student_dashboard.go_to_programs_tab()
        program_listing_page = LMSProgramListingPage(self.browser).wait_for_page()
        program_listing_page.is_browser_on_page()

        self.assertFalse(program_listing_page.are_credential_links_present())