Fix Group Configuration Page after rebase.
This commit is contained in:
@@ -1136,7 +1136,7 @@ class GroupConfiguration(object):
|
||||
continue
|
||||
|
||||
unit_url = reverse_usage_url(
|
||||
'unit_handler',
|
||||
'container_handler',
|
||||
course.location.course_key.make_usage_key(unit.location.block_type, unit.location.name)
|
||||
)
|
||||
usage_info[split_test.user_partition_id].append({
|
||||
|
||||
@@ -14,9 +14,9 @@ function ($, _, gettext, BasePage, GroupConfigurationsList) {
|
||||
|
||||
renderPage: function() {
|
||||
var hash = this.getLocationHash();
|
||||
this.$el.append(this.listView.render().el);
|
||||
this.$('.content-primary').append(this.listView.render().el);
|
||||
this.addButtonActions();
|
||||
this.addWindowActions();
|
||||
this.addWindowActions();
|
||||
if (hash) {
|
||||
// Strip leading '#' to get id string to match
|
||||
this.expandConfiguration(hash.replace('#', ''));
|
||||
|
||||
@@ -27,14 +27,14 @@ def click_css(page, css, source_index=0, require_notification=True):
|
||||
# Click on the element in the browser
|
||||
page.q(css=css).filter(lambda el: _is_visible(el)).nth(source_index).click()
|
||||
|
||||
if require_notification:
|
||||
wait_for_notification(page)
|
||||
|
||||
# Some buttons trigger ajax posts
|
||||
# (e.g. .add-missing-groups-button as configured in split_test_author_view.js)
|
||||
# so after you click anything wait for the ajax call to finish
|
||||
page.wait_for_ajax()
|
||||
|
||||
if require_notification:
|
||||
wait_for_notification(page)
|
||||
|
||||
|
||||
def wait_for_notification(page):
|
||||
"""
|
||||
|
||||
@@ -13,11 +13,10 @@ from bok_choy.promise import Promise, EmptyPromise
|
||||
|
||||
from ..fixtures.course import XBlockFixtureDesc
|
||||
from ..pages.studio.component_editor import ComponentEditorView
|
||||
from ..pages.studio.overview import CourseOutlinePage
|
||||
from ..pages.studio.overview import CourseOutlinePage, CourseOutlineUnit
|
||||
from ..pages.studio.settings_advanced import AdvancedSettingsPage
|
||||
from ..pages.studio.settings_group_configurations import GroupConfigurationsPage
|
||||
from ..pages.studio.utils import add_advanced_component
|
||||
from ..pages.studio.unit import UnitPage
|
||||
from ..pages.xblock.utils import wait_for_xblock_initialization
|
||||
|
||||
from .base_studio_test import StudioCourseTest
|
||||
@@ -45,7 +44,7 @@ class SplitTestMixin(object):
|
||||
def check_xblock_names(expected_groups, actual_blocks):
|
||||
self.assertEqual(len(expected_groups), len(actual_blocks))
|
||||
for idx, expected in enumerate(expected_groups):
|
||||
self.assertEqual('Expand or Collapse\n{}'.format(expected), actual_blocks[idx].name)
|
||||
self.assertEqual(expected, actual_blocks[idx].name)
|
||||
|
||||
check_xblock_names(active_groups, container.active_xblocks)
|
||||
check_xblock_names(inactive_groups, container.inactive_xblocks)
|
||||
@@ -65,22 +64,29 @@ class SplitTestMixin(object):
|
||||
|
||||
Promise(missing_groups_button_not_present, "Add missing groups button should not be showing.").fulfill()
|
||||
|
||||
|
||||
@attr('shard_1')
|
||||
class SplitTest(ContainerBase):
|
||||
class SplitTest(ContainerBase, SplitTestMixin):
|
||||
"""
|
||||
Tests for creating and editing split test instances in Studio.
|
||||
"""
|
||||
__test__ = True
|
||||
|
||||
def populate_course_fixture(self, course_fixture):
|
||||
course_fixture.add_advanced_settings(
|
||||
{
|
||||
u"advanced_modules": {"value": ["split_test"]},
|
||||
u"user_partitions": {"value": [
|
||||
def setUp(self):
|
||||
super(SplitTest, self).setUp()
|
||||
# This line should be called once courseFixture is installed
|
||||
self.course_fixture._update_xblock(self.course_fixture._course_location, {
|
||||
"metadata": {
|
||||
u"user_partitions": [
|
||||
UserPartition(0, 'Configuration alpha,beta', 'first', [Group("0", 'alpha'), Group("1", 'beta')]).to_json(),
|
||||
UserPartition(1, 'Configuration 0,1,2', 'second', [Group("0", 'Group 0'), Group("1", 'Group 1'), Group("2", 'Group 2')]).to_json()
|
||||
]}
|
||||
}
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
def populate_course_fixture(self, course_fixture):
|
||||
course_fixture.add_advanced_settings(
|
||||
{u"advanced_modules": {"value": ["split_test"]}}
|
||||
)
|
||||
|
||||
course_fixture.add_children(
|
||||
@@ -442,9 +448,9 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
|
||||
# Save the configuration
|
||||
config.save()
|
||||
|
||||
unit = self.go_to_unit_page(make_draft=True)
|
||||
unit = self.go_to_unit_page()
|
||||
add_advanced_component(unit, 0, 'split_test')
|
||||
container = self.go_to_container_page()
|
||||
container = self.go_to_nested_container_page()
|
||||
container.edit()
|
||||
component_editor = ComponentEditorView(self.browser, container.locator)
|
||||
component_editor.set_select_value_and_save('Group Configuration', 'New Group Configuration Name')
|
||||
@@ -461,7 +467,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
|
||||
# Save the configuration
|
||||
config.save()
|
||||
|
||||
container = self.go_to_container_page()
|
||||
container = self.go_to_nested_container_page()
|
||||
container.edit()
|
||||
component_editor = ComponentEditorView(self.browser, container.locator)
|
||||
self.assertEqual(
|
||||
@@ -646,7 +652,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
|
||||
vertical.locator,
|
||||
XBlockFixtureDesc('split_test', 'Test Content Experiment', metadata={'user_partition_id': 0})
|
||||
)
|
||||
unit = UnitPage(self.browser, vertical.locator)
|
||||
unit = CourseOutlineUnit(self.browser, vertical.locator)
|
||||
|
||||
# Go to the Group Configuration Page and click unit anchor
|
||||
self.page.visit()
|
||||
|
||||
Reference in New Issue
Block a user