Merge branch 'master' into dj18-release-merge

This commit is contained in:
Brian Beggs
2015-11-19 13:36:13 -05:00
21 changed files with 716 additions and 490 deletions

View File

@@ -3,6 +3,9 @@
Tests the "preview" selector in the LMS that allows changing between Staff, Student, and Content Groups.
"""
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, create_user_partition_json
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.lms.courseware import CoursewarePage
@@ -14,6 +17,7 @@ from xmodule.partitions.partitions import Group
from textwrap import dedent
@attr('shard_3')
class StaffViewTest(UniqueCourseTest):
"""
Tests that verify the staff view.
@@ -51,6 +55,7 @@ class StaffViewTest(UniqueCourseTest):
return staff_page
@attr('shard_3')
class CourseWithoutContentGroupsTest(StaffViewTest):
"""
Setup for tests that have no content restricted to specific content groups.
@@ -81,6 +86,7 @@ class CourseWithoutContentGroupsTest(StaffViewTest):
)
@attr('shard_3')
class StaffViewToggleTest(CourseWithoutContentGroupsTest):
"""
Tests for the staff view toggle button.
@@ -97,6 +103,7 @@ class StaffViewToggleTest(CourseWithoutContentGroupsTest):
self.assertFalse(course_page.has_tab('Instructor'))
@attr('shard_3')
class StaffDebugTest(CourseWithoutContentGroupsTest):
"""
Tests that verify the staff debug info.
@@ -228,6 +235,7 @@ class StaffDebugTest(CourseWithoutContentGroupsTest):
'for user {}'.format(self.USERNAME), msg)
@attr('shard_3')
class CourseWithContentGroupsTest(StaffViewTest):
"""
Verifies that changing the "View this course as" selector works properly for content groups.

View File

@@ -1,6 +1,7 @@
"""
Acceptance tests for the Import and Export pages
"""
from nose.plugins.attrib import attr
from datetime import datetime
from abc import abstractmethod
@@ -33,6 +34,7 @@ class ExportTestMixin(object):
self.assertTrue(is_tarball_mimetype)
@attr('shard_4')
class TestCourseExport(ExportTestMixin, StudioCourseTest):
"""
Export tests for courses.
@@ -55,6 +57,7 @@ class TestCourseExport(ExportTestMixin, StudioCourseTest):
self.assertEqual(self.export_page.header_text, 'Course Export')
@attr('shard_4')
class TestLibraryExport(ExportTestMixin, StudioLibraryTest):
"""
Export tests for libraries.
@@ -103,6 +106,7 @@ class BadExportMixin(object):
)
@attr('shard_4')
class TestLibraryBadExport(BadExportMixin, StudioLibraryTest):
"""
Verify exporting a bad library causes an error.
@@ -126,6 +130,7 @@ class TestLibraryBadExport(BadExportMixin, StudioLibraryTest):
)
@attr('shard_4')
class TestCourseBadExport(BadExportMixin, StudioCourseTest):
"""
Verify exporting a bad course causes an error.
@@ -157,6 +162,7 @@ class TestCourseBadExport(BadExportMixin, StudioCourseTest):
)
@attr('shard_4')
class ImportTestMixin(object):
"""
Tests to run for both course and library import pages.
@@ -271,6 +277,7 @@ class ImportTestMixin(object):
self.import_page.wait_for_tasks(fail_on='Updating')
@attr('shard_4')
class TestEntranceExamCourseImport(ImportTestMixin, StudioCourseTest):
"""
Tests the Course import page
@@ -316,6 +323,7 @@ class TestEntranceExamCourseImport(ImportTestMixin, StudioCourseTest):
)
@attr('shard_4')
class TestCourseImport(ImportTestMixin, StudioCourseTest):
"""
Tests the Course import page
@@ -357,6 +365,7 @@ class TestCourseImport(ImportTestMixin, StudioCourseTest):
self.assertEqual(self.import_page.header_text, 'Course Import')
@attr('shard_4')
class TestLibraryImport(ImportTestMixin, StudioLibraryTest):
"""
Tests the Library import page

View File

@@ -312,6 +312,7 @@ class EditContainerTest(NestedVerticalTest):
self.assertEqual(component.student_content, "modified content")
@attr('shard_3')
class EditVisibilityModalTest(ContainerBase):
"""
Tests of the visibility settings modal for components on the unit
@@ -397,6 +398,7 @@ class EditVisibilityModalTest(ContainerBase):
# Re-open the modal and inspect its selected inputs
visibility_editor = self.edit_component_visibility(component)
self.verify_selected_labels(visibility_editor, expected_labels)
visibility_editor.save()
def verify_component_validation_error(self, component):
"""
@@ -427,14 +429,13 @@ class EditVisibilityModalTest(ContainerBase):
self.browser.refresh()
self.container_page.wait_for_page()
def remove_missing_groups(self, component):
def remove_missing_groups(self, visibility_editor, component):
"""
Deselect the missing groups for a component. After save,
verify that there are no missing group messages in the modal
and that there is no validation error on the component.
"""
visibility_editor = self.edit_component_visibility(component)
for option in self.edit_component_visibility(component).selected_options:
for option in visibility_editor.selected_options:
if option.text == self.MISSING_GROUP_LABEL:
option.click()
visibility_editor.save()
@@ -541,7 +542,7 @@ class EditVisibilityModalTest(ContainerBase):
self.verify_component_validation_error(self.html_component)
visibility_editor = self.edit_component_visibility(self.html_component)
self.verify_selected_labels(visibility_editor, [self.MISSING_GROUP_LABEL] * 2)
self.remove_missing_groups(self.html_component)
self.remove_missing_groups(visibility_editor, self.html_component)
self.verify_visibility_set(self.html_component, False)
def test_found_and_missing_groups(self):
@@ -565,7 +566,7 @@ class EditVisibilityModalTest(ContainerBase):
self.verify_component_validation_error(self.html_component)
visibility_editor = self.edit_component_visibility(self.html_component)
self.verify_selected_labels(visibility_editor, ['Dogs', 'Cats'] + [self.MISSING_GROUP_LABEL] * 2)
self.remove_missing_groups(self.html_component)
self.remove_missing_groups(visibility_editor, self.html_component)
visibility_editor = self.edit_component_visibility(self.html_component)
self.verify_selected_labels(visibility_editor, ['Dogs', 'Cats'])
self.verify_visibility_set(self.html_component, True)
@@ -1041,6 +1042,7 @@ class UnitPublishingTest(ContainerBase):
# self.assertEqual('discussion', self.courseware.xblock_component_type(1))
@attr('shard_3')
class DisplayNameTest(ContainerBase):
"""
Test consistent use of display_name_with_default
@@ -1077,6 +1079,7 @@ class DisplayNameTest(ContainerBase):
self.assertEqual(container.name, title_on_unit_page)
@attr('shard_3')
class ProblemCategoryTabsTest(ContainerBase):
"""
Test to verify tabs in problem category.

View File

@@ -1755,6 +1755,7 @@ class DeprecationWarningMessageTest(CourseOutlineTest):
)
@attr('shard_4')
class SelfPacedOutlineTest(CourseOutlineTest):
"""Test the course outline for a self-paced course."""

View File

@@ -2,6 +2,7 @@
Acceptance tests for Studio's Settings Details pages
"""
from datetime import datetime, timedelta
from nose.plugins.attrib import attr
from unittest import skip
from .base_studio_test import StudioCourseTest
@@ -18,6 +19,7 @@ from ..helpers import (
)
@attr('shard_4')
class StudioSettingsDetailsTest(StudioCourseTest):
"""Base class for settings and details page tests."""
@@ -35,6 +37,7 @@ class StudioSettingsDetailsTest(StudioCourseTest):
self.assertTrue(self.settings_detail.is_browser_on_page())
@attr('shard_4')
class SettingsMilestonesTest(StudioSettingsDetailsTest):
"""
Tests for milestones feature in Studio's settings tab
@@ -201,6 +204,7 @@ class SettingsMilestonesTest(StudioSettingsDetailsTest):
))
@attr('shard_4')
class CoursePacingTest(StudioSettingsDetailsTest):
"""Tests for setting a course to self-paced."""