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
2d677a83
Commit
2d677a83
authored
Mar 28, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for due dates.
parent
5c78218b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
37 deletions
+72
-37
cms/djangoapps/contentstore/features/common.py
+15
-0
cms/djangoapps/contentstore/features/section.py
+2
-12
cms/djangoapps/contentstore/features/subsection.feature
+28
-20
cms/djangoapps/contentstore/features/subsection.py
+26
-4
cms/templates/overview.html
+1
-1
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
2d677a83
...
@@ -11,6 +11,9 @@ from xmodule.modulestore.django import _MODULESTORES, modulestore
...
@@ -11,6 +11,9 @@ from xmodule.modulestore.django import _MODULESTORES, modulestore
from
xmodule.templates
import
update_templates
from
xmodule.templates
import
update_templates
from
auth.authz
import
get_user_by_email
from
auth.authz
import
get_user_by_email
from
selenium.webdriver.common.keys
import
Keys
import
time
from
logging
import
getLogger
from
logging
import
getLogger
logger
=
getLogger
(
__name__
)
logger
=
getLogger
(
__name__
)
...
@@ -207,3 +210,14 @@ def add_subsection(name='Subsection One'):
...
@@ -207,3 +210,14 @@ def add_subsection(name='Subsection One'):
save_css
=
'input.new-subsection-name-save'
save_css
=
'input.new-subsection-name-save'
css_fill
(
name_css
,
name
)
css_fill
(
name_css
,
name
)
css_click
(
save_css
)
css_click
(
save_css
)
def
set_date_and_time
(
date_css
,
desired_date
,
time_css
,
desired_time
):
css_fill
(
date_css
,
desired_date
)
# hit TAB to get to the time field
e
=
css_find
(
date_css
)
.
first
e
.
_element
.
send_keys
(
Keys
.
TAB
)
css_fill
(
time_css
,
desired_time
)
e
=
css_find
(
time_css
)
.
first
e
.
_element
.
send_keys
(
Keys
.
TAB
)
time
.
sleep
(
float
(
1
))
\ No newline at end of file
cms/djangoapps/contentstore/features/section.py
View file @
2d677a83
from
lettuce
import
world
,
step
from
lettuce
import
world
,
step
from
common
import
*
from
common
import
*
from
nose.tools
import
assert_equal
from
nose.tools
import
assert_equal
from
selenium.webdriver.common.keys
import
Keys
import
time
############### ACTIONS ####################
############### ACTIONS ####################
...
@@ -36,16 +34,8 @@ def i_click_the_edit_link_for_the_release_date(step):
...
@@ -36,16 +34,8 @@ def i_click_the_edit_link_for_the_release_date(step):
@step
(
'I save a new section release date$'
)
@step
(
'I save a new section release date$'
)
def
i_save_a_new_section_release_date
(
step
):
def
i_save_a_new_section_release_date
(
step
):
date_css
=
'input.start-date.date.hasDatepicker'
set_date_and_time
(
'input.start-date.date.hasDatepicker'
,
'12/25/2013'
,
time_css
=
'input.start-time.time.ui-timepicker-input'
'input.start-time.time.ui-timepicker-input'
,
'12:00am'
)
css_fill
(
date_css
,
'12/25/2013'
)
# hit TAB to get to the time field
e
=
css_find
(
date_css
)
.
first
e
.
_element
.
send_keys
(
Keys
.
TAB
)
css_fill
(
time_css
,
'12:00am'
)
e
=
css_find
(
time_css
)
.
first
e
.
_element
.
send_keys
(
Keys
.
TAB
)
time
.
sleep
(
float
(
1
))
world
.
browser
.
click_link_by_text
(
'Save'
)
world
.
browser
.
click_link_by_text
(
'Save'
)
...
...
cms/djangoapps/contentstore/features/subsection.feature
View file @
2d677a83
...
@@ -3,25 +3,33 @@ Feature: Create Subsection
...
@@ -3,25 +3,33 @@ Feature: Create Subsection
As a course author
As a course author
I want to create and edit subsections
I want to create and edit subsections
Scenario
:
Add a new subsection to a section
# Scenario: Add a new subsection to a section
Given
I have opened a new course section in Studio
# Given I have opened a new course section in Studio
When
I click the New Subsection link
# When I click the New Subsection link
And
I enter the subsection name and click save
# And I enter the subsection name and click save
Then
I see my subsection on the Courseware page
# Then I see my subsection on the Courseware page
#
# Scenario: Add a new subsection (with a name containing a quote) to a section (bug #216)
# Given I have opened a new course section in Studio
# When I click the New Subsection link
# And I enter a subsection name with a quote and click save
# Then I see my subsection name with a quote on the Courseware page
# And I click to edit the subsection name
# Then I see the complete subsection name with a quote in the editor
Scenario
:
Add a new subsection (with a name containing a quote) to a section (bug
#216)
# @skip-phantom
Given
I have opened a new course section in Studio
# Scenario: Delete a subsection
When
I click the New Subsection link
# Given I have opened a new course section in Studio
And
I enter a subsection name with a quote and click save
# And I have added a new subsection
Then
I see my subsection name with a quote on the Courseware page
# And I see my subsection on the Courseware page
And
I click to edit the subsection name
# When I press the "subsection" delete icon
Then
I see the complete subsection name with a quote in the editor
# And I confirm the alert
# Then the subsection does not exist
Scenario
:
Set a due date in a different year (bug
#256)
Given
I have opened a new subsection in Studio
And
I have set a release date and due date in different years
Then
I see the correct dates
And
I reload the page
Then
I see the correct dates
@skip-phantom
Scenario
:
Delete a subsection
Given
I have opened a new course section in Studio
And
I have added a new subsection
And
I see my subsection on the Courseware page
When
I press the
"subsection"
delete icon
And
I confirm the alert
Then
the subsection does not exist
cms/djangoapps/contentstore/features/subsection.py
View file @
2d677a83
from
lettuce
import
world
,
step
from
lettuce
import
world
,
step
from
common
import
*
from
common
import
*
from
nose.tools
import
assert_equal
from
nose.tools
import
assert_equal
,
assert_true
############### ACTIONS ####################
############### ACTIONS ####################
...
@@ -13,6 +13,18 @@ def i_have_opened_a_new_course_section(step):
...
@@ -13,6 +13,18 @@ def i_have_opened_a_new_course_section(step):
add_section
()
add_section
()
@step
(
'I have added a new subsection$'
)
def
i_have_added_a_new_subsection
(
step
):
add_subsection
()
@step
(
'I have opened a new subsection in Studio$'
)
def
i_have_opened_a_new_subsection
(
step
):
step
.
given
(
'I have opened a new course section in Studio'
)
step
.
given
(
'I have added a new subsection'
)
css_click
(
'span.subsection-name-value'
)
@step
(
'I click the New Subsection link'
)
@step
(
'I click the New Subsection link'
)
def
i_click_the_new_subsection_link
(
step
):
def
i_click_the_new_subsection_link
(
step
):
css
=
'a.new-subsection-item'
css
=
'a.new-subsection-item'
...
@@ -41,9 +53,19 @@ def i_see_complete_subsection_name_with_quote_in_editor(step):
...
@@ -41,9 +53,19 @@ def i_see_complete_subsection_name_with_quote_in_editor(step):
assert_equal
(
world
.
browser
.
find_by_css
(
css
)
.
value
,
'Subsection With "Quote"'
)
assert_equal
(
world
.
browser
.
find_by_css
(
css
)
.
value
,
'Subsection With "Quote"'
)
@step
(
'I have added a new subsection$'
)
@step
(
'I have set a release date and due date in different years$'
)
def
i_have_added_a_new_subsection
(
step
):
def
test_have_set_dates_in_different_years
(
step
):
add_subsection
()
set_date_and_time
(
'input#start_date'
,
'12/25/2013'
,
'input#start_time'
,
'3:00am'
)
css_click
(
'.set-date'
)
set_date_and_time
(
'input#due_date'
,
'1/2/2014'
,
'input#due_time'
,
'4:00am'
)
@step
(
'I see the correct dates$'
)
def
i_see_the_correct_dates
(
step
):
assert_equal
(
'12/25/2013'
,
css_find
(
'input#start_date'
)
.
first
.
value
)
assert_equal
(
'3:00am'
,
css_find
(
'input#start_time'
)
.
first
.
value
)
assert_equal
(
'1/2/2014'
,
css_find
(
'input#due_date'
)
.
first
.
value
)
assert_equal
(
'4:00am'
,
css_find
(
'input#due_time'
)
.
first
.
value
)
############ ASSERTIONS ###################
############ ASSERTIONS ###################
...
...
cms/templates/overview.html
View file @
2d677a83
...
@@ -200,7 +200,7 @@
...
@@ -200,7 +200,7 @@
</a>
</a>
</div>
</div>
<div
class=
"gradable-status"
data-initial-status=
"${subsection.lms.format if section.lms.format is not None else 'Not Graded'}"
>
<div
class=
"gradable-status"
data-initial-status=
"${subsection.lms.format if s
ubs
ection.lms.format is not None else 'Not Graded'}"
>
</div>
</div>
<div
class=
"item-actions"
>
<div
class=
"item-actions"
>
...
...
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