Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e8ae3d1b
Commit
e8ae3d1b
authored
Aug 01, 2014
by
polesye
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Group Configuration Page after rebase.
parent
61c417f7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
21 deletions
+27
-21
cms/djangoapps/contentstore/views/course.py
+1
-1
cms/static/js/views/pages/group_configurations.js
+2
-2
common/test/acceptance/pages/studio/utils.py
+3
-3
common/test/acceptance/tests/test_studio_split_test.py
+21
-15
No files found.
cms/djangoapps/contentstore/views/course.py
View file @
e8ae3d1b
...
@@ -1136,7 +1136,7 @@ class GroupConfiguration(object):
...
@@ -1136,7 +1136,7 @@ class GroupConfiguration(object):
continue
continue
unit_url
=
reverse_usage_url
(
unit_url
=
reverse_usage_url
(
'
unit
_handler'
,
'
container
_handler'
,
course
.
location
.
course_key
.
make_usage_key
(
unit
.
location
.
block_type
,
unit
.
location
.
name
)
course
.
location
.
course_key
.
make_usage_key
(
unit
.
location
.
block_type
,
unit
.
location
.
name
)
)
)
usage_info
[
split_test
.
user_partition_id
]
.
append
({
usage_info
[
split_test
.
user_partition_id
]
.
append
({
...
...
cms/static/js/views/pages/group_configurations.js
View file @
e8ae3d1b
...
@@ -14,9 +14,9 @@ function ($, _, gettext, BasePage, GroupConfigurationsList) {
...
@@ -14,9 +14,9 @@ function ($, _, gettext, BasePage, GroupConfigurationsList) {
renderPage
:
function
()
{
renderPage
:
function
()
{
var
hash
=
this
.
getLocationHash
();
var
hash
=
this
.
getLocationHash
();
this
.
$
el
.
append
(
this
.
listView
.
render
().
el
);
this
.
$
(
'.content-primary'
)
.
append
(
this
.
listView
.
render
().
el
);
this
.
addButtonActions
();
this
.
addButtonActions
();
this
.
addWindowActions
();
this
.
addWindowActions
();
if
(
hash
)
{
if
(
hash
)
{
// Strip leading '#' to get id string to match
// Strip leading '#' to get id string to match
this
.
expandConfiguration
(
hash
.
replace
(
'#'
,
''
));
this
.
expandConfiguration
(
hash
.
replace
(
'#'
,
''
));
...
...
common/test/acceptance/pages/studio/utils.py
View file @
e8ae3d1b
...
@@ -27,14 +27,14 @@ def click_css(page, css, source_index=0, require_notification=True):
...
@@ -27,14 +27,14 @@ def click_css(page, css, source_index=0, require_notification=True):
# Click on the element in the browser
# Click on the element in the browser
page
.
q
(
css
=
css
)
.
filter
(
lambda
el
:
_is_visible
(
el
))
.
nth
(
source_index
)
.
click
()
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
# Some buttons trigger ajax posts
# (e.g. .add-missing-groups-button as configured in split_test_author_view.js)
# (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
# so after you click anything wait for the ajax call to finish
page
.
wait_for_ajax
()
page
.
wait_for_ajax
()
if
require_notification
:
wait_for_notification
(
page
)
def
wait_for_notification
(
page
):
def
wait_for_notification
(
page
):
"""
"""
...
...
common/test/acceptance/tests/test_studio_split_test.py
View file @
e8ae3d1b
...
@@ -13,11 +13,10 @@ from bok_choy.promise import Promise, EmptyPromise
...
@@ -13,11 +13,10 @@ from bok_choy.promise import Promise, EmptyPromise
from
..fixtures.course
import
XBlockFixtureDesc
from
..fixtures.course
import
XBlockFixtureDesc
from
..pages.studio.component_editor
import
ComponentEditorView
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_advanced
import
AdvancedSettingsPage
from
..pages.studio.settings_group_configurations
import
GroupConfigurationsPage
from
..pages.studio.settings_group_configurations
import
GroupConfigurationsPage
from
..pages.studio.utils
import
add_advanced_component
from
..pages.studio.utils
import
add_advanced_component
from
..pages.studio.unit
import
UnitPage
from
..pages.xblock.utils
import
wait_for_xblock_initialization
from
..pages.xblock.utils
import
wait_for_xblock_initialization
from
.base_studio_test
import
StudioCourseTest
from
.base_studio_test
import
StudioCourseTest
...
@@ -45,7 +44,7 @@ class SplitTestMixin(object):
...
@@ -45,7 +44,7 @@ class SplitTestMixin(object):
def
check_xblock_names
(
expected_groups
,
actual_blocks
):
def
check_xblock_names
(
expected_groups
,
actual_blocks
):
self
.
assertEqual
(
len
(
expected_groups
),
len
(
actual_blocks
))
self
.
assertEqual
(
len
(
expected_groups
),
len
(
actual_blocks
))
for
idx
,
expected
in
enumerate
(
expected_groups
):
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
(
active_groups
,
container
.
active_xblocks
)
check_xblock_names
(
inactive_groups
,
container
.
inactive_xblocks
)
check_xblock_names
(
inactive_groups
,
container
.
inactive_xblocks
)
...
@@ -65,22 +64,29 @@ class SplitTestMixin(object):
...
@@ -65,22 +64,29 @@ class SplitTestMixin(object):
Promise
(
missing_groups_button_not_present
,
"Add missing groups button should not be showing."
)
.
fulfill
()
Promise
(
missing_groups_button_not_present
,
"Add missing groups button should not be showing."
)
.
fulfill
()
@attr
(
'shard_1'
)
@attr
(
'shard_1'
)
class
SplitTest
(
ContainerBase
):
class
SplitTest
(
ContainerBase
,
SplitTestMixin
):
"""
"""
Tests for creating and editing split test instances in Studio.
Tests for creating and editing split test instances in Studio.
"""
"""
__test__
=
True
__test__
=
True
def
populate_course_fixture
(
self
,
course_fixture
):
def
setUp
(
self
):
course_fixture
.
add_advanced_settings
(
super
(
SplitTest
,
self
)
.
setUp
()
{
# This line should be called once courseFixture is installed
u"advanced_modules"
:
{
"value"
:
[
"split_test"
]},
self
.
course_fixture
.
_update_xblock
(
self
.
course_fixture
.
_course_location
,
{
u"user_partitions"
:
{
"value"
:
[
"metadata"
:
{
u"user_partitions"
:
[
UserPartition
(
0
,
'Configuration alpha,beta'
,
'first'
,
[
Group
(
"0"
,
'alpha'
),
Group
(
"1"
,
'beta'
)])
.
to_json
(),
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
()
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
(
course_fixture
.
add_children
(
...
@@ -442,9 +448,9 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
...
@@ -442,9 +448,9 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
# Save the configuration
# Save the configuration
config
.
save
()
config
.
save
()
unit
=
self
.
go_to_unit_page
(
make_draft
=
True
)
unit
=
self
.
go_to_unit_page
()
add_advanced_component
(
unit
,
0
,
'split_test'
)
add_advanced_component
(
unit
,
0
,
'split_test'
)
container
=
self
.
go_to_container_page
()
container
=
self
.
go_to_
nested_
container_page
()
container
.
edit
()
container
.
edit
()
component_editor
=
ComponentEditorView
(
self
.
browser
,
container
.
locator
)
component_editor
=
ComponentEditorView
(
self
.
browser
,
container
.
locator
)
component_editor
.
set_select_value_and_save
(
'Group Configuration'
,
'New Group Configuration Name'
)
component_editor
.
set_select_value_and_save
(
'Group Configuration'
,
'New Group Configuration Name'
)
...
@@ -461,7 +467,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
...
@@ -461,7 +467,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
# Save the configuration
# Save the configuration
config
.
save
()
config
.
save
()
container
=
self
.
go_to_container_page
()
container
=
self
.
go_to_
nested_
container_page
()
container
.
edit
()
container
.
edit
()
component_editor
=
ComponentEditorView
(
self
.
browser
,
container
.
locator
)
component_editor
=
ComponentEditorView
(
self
.
browser
,
container
.
locator
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -646,7 +652,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
...
@@ -646,7 +652,7 @@ class GroupConfigurationsTest(ContainerBase, SplitTestMixin):
vertical
.
locator
,
vertical
.
locator
,
XBlockFixtureDesc
(
'split_test'
,
'Test Content Experiment'
,
metadata
=
{
'user_partition_id'
:
0
})
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
# Go to the Group Configuration Page and click unit anchor
self
.
page
.
visit
()
self
.
page
.
visit
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment