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
eb14a078
Commit
eb14a078
authored
Jun 11, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for course updates and handouts
parent
81b06d5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
0 deletions
+126
-0
cms/djangoapps/contentstore/features/course-updates.feature
+44
-0
cms/djangoapps/contentstore/features/course-updates.py
+82
-0
No files found.
cms/djangoapps/contentstore/features/course-updates.feature
0 → 100644
View file @
eb14a078
Feature
:
Course updates
As a course author, I want to be able to provide updates to my students
Scenario
:
Users can add updates
Given
I have opened a new course in Studio
And
I go to the course updates page
When
I add a new update
And
I make the text
"Hello"
Then
I should see the update
"Hello"
Scenario
:
Users can edit updates
Given
I have opened a new course in Studio
And
I go to the course updates page
When
I add a new update
And
I make the text
"Hello"
And
I click the
"edit"
button
And
I make the text
"Goodbye"
Then
I should see the update
"Goodbye"
Scenario
:
Users can delete updates
Given
I have opened a new course in Studio
And
I go to the course updates page
And
I add a new update
And
I make the text
"Hello"
When
I will confirm all alerts
And
I click the
"delete"
button
Then
I should not see the update
"Hello"
Scenario
:
Users can edit update dates
Given
I have opened a new course in Studio
And
I go to the course updates page
And
I add a new update
And
I make the text
"Hello"
When
I click the
"edit"
button
And
I make the date
"June 1, 2013"
Then
I should see the date
"June 1, 2013"
Scenario
:
Users can change handouts
Given
I have opened a new course in Studio
And
I go to the course updates page
When
I edit the handouts
And
I make the text
"<ol>Test</ol>"
Then
I see the handout
"Test"
cms/djangoapps/contentstore/features/course-updates.py
0 → 100644
View file @
eb14a078
#pylint: disable=C0111
#pylint: disable=W0621
from
lettuce
import
world
,
step
from
selenium.webdriver.common.keys
import
Keys
@step
(
u'I go to the course updates page'
)
def
go_to_uploads
(
step
):
menu_css
=
'li.nav-course-courseware'
uploads_css
=
'.nav-course-courseware-updates'
world
.
css_find
(
menu_css
)
.
click
()
world
.
css_find
(
uploads_css
)
.
click
()
@step
(
u'I add a new update'
)
def
add_update
(
step
):
update_css
=
'.new-update-button'
world
.
css_find
(
update_css
)
.
click
()
@step
(
u'I make the text "([^"]*)"$'
)
def
change_text
(
step
,
text
):
text_css
=
'div.CodeMirror > div > textarea'
prev_css
=
'div.CodeMirror-lines > div > div:last-child > pre'
all_lines
=
world
.
css_find
(
prev_css
)
all_text
=
''
for
i
in
range
(
len
(
all_lines
)):
all_text
=
all_lines
[
i
]
.
html
text_area
=
world
.
css_find
(
text_css
)
for
i
in
range
(
len
(
all_text
)):
text_area
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
text_area
.
_element
.
send_keys
(
text
)
save_css
=
'.save-button'
world
.
css_find
(
save_css
)
.
click
()
@step
(
u'I should( not)? see the update "([^"]*)"$'
)
def
check_update
(
step
,
doesnt
,
text
):
update_css
=
'.update-contents'
update
=
world
.
css_find
(
update_css
)
if
doesnt
:
assert
len
(
update
)
==
0
or
not
text
in
update
.
html
else
:
assert
text
in
update
.
html
@step
(
u'I click the "([^"]*)" button$'
)
def
click_button
(
step
,
edit_delete
):
button_css
=
'.post-preview .
%
s-button'
%
edit_delete
world
.
css_find
(
button_css
)
.
click
()
@step
(
u'I make the date "([^"]*)"$'
)
def
change_date
(
step
,
new_date
):
date_css
=
'input.date'
date
=
world
.
css_find
(
date_css
)
for
i
in
range
(
len
(
date
.
value
)):
date
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
date
.
_element
.
send_keys
(
new_date
)
save_css
=
'.save-button'
world
.
css_find
(
save_css
)
.
click
()
@step
(
u'I should see the date "([^"]*)"$'
)
def
check_date
(
step
,
date
):
date_css
=
'.date-display'
date_html
=
world
.
css_find
(
date_css
)
assert
date
==
date_html
.
html
@step
(
u'I edit the handouts'
)
def
edit_handouts
(
step
):
edit_css
=
'.course-handouts > .edit-button'
world
.
css_find
(
edit_css
)
.
click
()
@step
(
u'I see the handout "([^"]*)"$'
)
def
check_handout
(
step
,
handout
):
handout_css
=
'.handouts-content'
handouts
=
world
.
css_find
(
handout_css
)
assert
handout
in
handouts
.
html
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