Ejemplo n.º 1
0
 def setUp(self, is_staff=False):  # pylint: disable=arguments-differ
     super(AssetIndexTest, self).setUp()
     self.asset_page = AssetIndexPage(
         self.browser,
         self.course_info['org'],
         self.course_info['number'],
         self.course_info['run']
     )
Ejemplo n.º 2
0
 def setUp(self, is_staff=False):
     super(AssetIndexTest, self).setUp()
     self.asset_page = AssetIndexPage(
         self.browser,
         self.course_info['org'],
         self.course_info['number'],
         self.course_info['run']
     )
Ejemplo n.º 3
0
 def setUp(self):  # pylint: disable=arguments-differ
     super(AssetIndexHelpTest, self).setUp()
     self.course_asset_index_page = AssetIndexPage(
         self.browser,
         self.course_info['org'],
         self.course_info['number'],
         self.course_info['run']
     )
     self.course_asset_index_page.visit()
Ejemplo n.º 4
0
class AssetIndexHelpTest(StudioCourseTest):
    """
    Test help links on Course 'Files & Uploads' page
    """
    def setUp(self):  # pylint: disable=arguments-differ
        super(AssetIndexHelpTest, self).setUp()
        self.course_asset_index_page = AssetIndexPage(
            self.browser, self.course_info['org'], self.course_info['number'],
            self.course_info['run'])
        self.course_asset_index_page.visit()

    @skip(
        "Disabled as edx.org help links are now different than Open edX (@catong can advise)"
    )
    def test_asset_index_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url(
            '/course_assets/course_files.html')

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.course_asset_index_page,
            href=expected_url,
        )

    @skip(
        "Disabled as edx.org help links are now different than Open edX (@catong can advise)"
    )
    def test_asset_index_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page.
        And I want help about the process
        And I click the 'Learn more about managing files' in the sidebar links
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url(
            '/course_assets/course_files.html')

        # Assert that help link is correct.
        assert_side_bar_help_link(test=self,
                                  page=self.course_asset_index_page,
                                  href=expected_url,
                                  help_text='Learn more about managing files')
Ejemplo n.º 5
0
class AssetIndexHelpTest(StudioCourseTest):
    """
    Test help links on Course 'Files & Uploads' page
    """
    def setUp(self):  # pylint: disable=arguments-differ
        super(AssetIndexHelpTest, self).setUp()
        self.course_asset_index_page = AssetIndexPage(
            self.browser,
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run']
        )
        self.course_asset_index_page.visit()

    def test_asset_index_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should end with 'course_assets/course_files.html'
        """
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \
               'en/open-release-ficus.master/course_assets/course_files.html'

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.course_asset_index_page,
            href=href
        )

    def test_asset_index_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page.
        And I want help about the process
        And I click the 'Learn more about managing files' in the sidebar links
        Then Help link should open.
        And help url should end with 'course_assets/course_files.html'
        """
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \
               'en/open-release-ficus.master/course_assets/course_files.html'

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.course_asset_index_page,
            href=href,
            help_text='Learn more about managing files'
        )
Ejemplo n.º 6
0
class AssetIndexHelpTest(StudioCourseTest):
    """
    Test help links on Course 'Files & Uploads' page
    """
    def setUp(self):  # pylint: disable=arguments-differ
        super(AssetIndexHelpTest, self).setUp()
        self.course_asset_index_page = AssetIndexPage(
            self.browser,
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run']
        )
        self.course_asset_index_page.visit()

    def test_asset_index_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url('/course_assets/course_files.html')

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.course_asset_index_page,
            href=expected_url,
        )

    def test_asset_index_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page.
        And I want help about the process
        And I click the 'Learn more about managing files' in the sidebar links
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url('/course_assets/course_files.html')

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.course_asset_index_page,
            href=expected_url,
            help_text='Learn more about managing files'
        )
Ejemplo n.º 7
0
 def setUp(self, is_staff=False):
     super(AssetIndexTest, self).setUp()
     self.asset_page = AssetIndexPage(
         self.browser,
         self.course_info['org'],
         self.course_info['number'],
         self.course_info['run']
     )
Ejemplo n.º 8
0
class AssetIndexHelpTest(StudioCourseTest):
    """
    Test help links on Course 'Files & Uploads' page
    """
    def setUp(self):  # pylint: disable=arguments-differ
        super(AssetIndexHelpTest, self).setUp()
        self.course_asset_index_page = AssetIndexPage(
            self.browser, self.course_info['org'], self.course_info['number'],
            self.course_info['run'])
        self.course_asset_index_page.visit()

    def test_asset_index_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should end with 'course_assets/course_files.html'
        """
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \
               'en/latest/course_assets/course_files.html'

        # Assert that help link is correct.
        assert_nav_help_link(test=self,
                             page=self.course_asset_index_page,
                             href=href)

    def test_asset_index_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on 'Files & Uploads' page
        Given that I am on the 'Files & Uploads' page.
        And I want help about the process
        And I click the 'Learn more about managing files' in the sidebar links
        Then Help link should open.
        And help url should end with 'course_assets/course_files.html'
        """
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \
               'en/latest/course_assets/course_files.html'

        # Assert that help link is correct.
        assert_side_bar_help_link(test=self,
                                  page=self.course_asset_index_page,
                                  href=href,
                                  help_text='Learn more about managing files')
Ejemplo n.º 9
0
 def setUp(self):  # pylint: disable=arguments-differ
     super(AssetIndexHelpTest, self).setUp()
     self.course_asset_index_page = AssetIndexPage(
         self.browser,
         self.course_info['org'],
         self.course_info['number'],
         self.course_info['run']
     )
     self.course_asset_index_page.visit()
Ejemplo n.º 10
0
class AssetIndexTest(StudioCourseTest):
    """
    Tests for the Asset index page.
    """
    def setUp(self, is_staff=False):
        super(AssetIndexTest, self).setUp()
        self.asset_page = AssetIndexPage(self.browser, self.course_info['org'],
                                         self.course_info['number'],
                                         self.course_info['run'])

    def populate_course_fixture(self, course_fixture):
        """
        Populate the children of the test course fixture.
        """
        self.course_fixture.add_asset(['image.jpg', 'textbook.pdf'])

    @skip_if_browser(
        'chrome'
    )  # TODO Need to fix test_page_existance for this for chrome browser
    @flaky  # TODO fix this FEDX-88
    def test_type_filter_exists(self):
        """
        Make sure type filter is on the page.
        """
        self.asset_page.visit()
        assert self.asset_page.type_filter_on_page() is True

    @skip_if_browser(
        'chrome'
    )  # TODO Need to fix test_page_existance for this for chrome browser
    @flaky  # TODO FEDX-88
    def test_filter_results(self):
        """
        Make sure type filter actually filters the results.
        """
        self.asset_page.visit()
        all_results = len(self.asset_page.return_results_set())
        if self.asset_page.select_type_filter(1):
            filtered_results = len(self.asset_page.return_results_set())
            assert self.asset_page.type_filter_header_label_visible()
            assert all_results > filtered_results
        else:
            msg = "Could not open select Type filter"
            raise StudioApiLoginError(msg)
Ejemplo n.º 11
0
class AssetIndexTest(StudioCourseTest):

    """
    Tests for the Asset index page.
    """
    def setUp(self, is_staff=False):
        super(AssetIndexTest, self).setUp()
        self.asset_page = AssetIndexPage(
            self.browser,
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run']
        )

    def populate_course_fixture(self, course_fixture):
        """
        Populate the children of the test course fixture.
        """
        self.course_fixture.add_asset(['image.jpg', 'textbook.pdf'])

    @skip_if_browser('chrome')  # TODO Need to fix test_page_existance for this for chrome browser
    @flaky      # TODO fix this FEDX-88
    def test_type_filter_exists(self):
        """
        Make sure type filter is on the page.
        """
        self.asset_page.visit()
        assert self.asset_page.type_filter_on_page() is True

    @skip_if_browser('chrome')  # TODO Need to fix test_page_existance for this for chrome browser
    @flaky    # TODO FEDX-88
    def test_filter_results(self):
        """
        Make sure type filter actually filters the results.
        """
        self.asset_page.visit()
        all_results = len(self.asset_page.return_results_set())
        if self.asset_page.select_type_filter(1):
            filtered_results = len(self.asset_page.return_results_set())
            assert self.asset_page.type_filter_header_label_visible()
            assert all_results > filtered_results
        else:
            msg = "Could not open select Type filter"
            raise StudioApiLoginError(msg)