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
9d44417c
Commit
9d44417c
authored
Jul 29, 2014
by
Ben McMorran
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for course outline warning messages
Fix failing bokchoy tests
parent
2118453e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
241 additions
and
9 deletions
+241
-9
cms/templates/js/course-outline.underscore
+3
-1
common/test/acceptance/pages/studio/container.py
+6
-2
common/test/acceptance/pages/studio/overview.py
+26
-6
common/test/acceptance/tests/test_studio_outline.py
+206
-0
No files found.
cms/templates/js/course-outline.underscore
View file @
9d44417c
...
...
@@ -14,8 +14,10 @@ if (visibilityState === 'staff_only') {
statusType = 'warning';
if (published && releasedToStudents) {
statusMessage = gettext('Unpublished changes to live content');
} else {
} else
if (!published)
{
statusMessage = gettext('Unpublished units will not be released');
} else {
statusMessage = gettext('Unpublished changes to content that will release in the future');
}
}
}
...
...
common/test/acceptance/pages/studio/container.py
View file @
9d44417c
...
...
@@ -139,14 +139,18 @@ class ContainerPage(PageObject):
confirm_prompt
(
self
)
self
.
wait_for_ajax
()
@property
def
is_staff_locked
(
self
):
""" Returns True if staff lock is currently enabled, False otherwise """
return
'icon-check'
in
self
.
q
(
css
=
'a.action-staff-lock>i'
)
.
attrs
(
'class'
)
def
toggle_staff_lock
(
self
):
"""
Toggles "hide from students" which enables or disables a staff-only lock.
Returns True if the lock is now enabled, else False.
"""
class_attribute_values
=
self
.
q
(
css
=
'a.action-staff-lock>i'
)
.
attrs
(
'class'
)
was_locked_initially
=
'icon-check'
in
class_attribute_values
was_locked_initially
=
self
.
is_staff_locked
if
not
was_locked_initially
:
self
.
q
(
css
=
'a.action-staff-lock'
)
.
first
.
click
()
else
:
...
...
common/test/acceptance/pages/studio/overview.py
View file @
9d44417c
...
...
@@ -18,6 +18,7 @@ class CourseOutlineItem(object):
NAME_SELECTOR
=
'.xblock-title .xblock-field-value'
NAME_INPUT_SELECTOR
=
'.xblock-field-input'
NAME_FIELD_WRAPPER_SELECTOR
=
'.xblock-title .wrapper-xblock-field'
STATUS_MESSAGE_SELECTOR
=
'> div[class$="status"] .status-message'
def
__repr__
(
self
):
# CourseOutlineItem is also used as a mixin for CourseOutlinePage, which doesn't have a locator
...
...
@@ -29,11 +30,16 @@ class CourseOutlineItem(object):
"""
Returns `selector`, but limited to this particular `CourseOutlineItem` context
"""
return
'{}[data-locator="{}"] {}'
.
format
(
self
.
BODY_SELECTOR
,
self
.
locator
,
selector
)
# If the item doesn't have a body selector or locator, then it can't be bounded
# This happens in the context of the CourseOutlinePage
if
self
.
BODY_SELECTOR
and
hasattr
(
self
,
'locator'
):
return
'{}[data-locator="{}"] {}'
.
format
(
self
.
BODY_SELECTOR
,
self
.
locator
,
selector
)
else
:
return
selector
@property
def
name
(
self
):
...
...
@@ -46,6 +52,20 @@ class CourseOutlineItem(object):
else
:
return
None
@property
def
has_status_message
(
self
):
"""
Returns True if the item has a status message, False otherwise.
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
self
.
STATUS_MESSAGE_SELECTOR
))
.
first
.
visible
@property
def
status_message
(
self
):
"""
Returns the status message of this item.
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
self
.
STATUS_MESSAGE_SELECTOR
))
.
text
[
0
]
def
edit_name
(
self
):
"""
Puts the item's name into editable form.
...
...
@@ -106,7 +126,7 @@ class CourseOutlineContainer(CourseOutlineItem):
"""
if
not
child_class
:
child_class
=
self
.
CHILD_CLASS
return
self
.
q
(
css
=
child_class
.
BODY_SELECTOR
)
.
map
(
return
self
.
q
(
css
=
self
.
_bounded_selector
(
child_class
.
BODY_SELECTOR
)
)
.
map
(
lambda
el
:
child_class
(
self
.
browser
,
el
.
get_attribute
(
'data-locator'
)))
.
results
def
child_at
(
self
,
index
,
child_class
=
None
):
...
...
common/test/acceptance/tests/test_studio_outline.py
View file @
9d44417c
This diff is collapsed.
Click to expand it.
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