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
b0106a41
Commit
b0106a41
authored
Mar 04, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make branch
parent
d0eefc6a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
14 deletions
+97
-14
cms/djangoapps/contentstore/features/section.feature
+8
-0
cms/djangoapps/contentstore/features/section.py
+40
-6
cms/djangoapps/contentstore/features/subsection.feature
+8
-0
cms/djangoapps/contentstore/features/subsection.py
+41
-8
No files found.
cms/djangoapps/contentstore/features/section.feature
View file @
b0106a41
...
...
@@ -11,6 +11,14 @@ Feature: Create Section
And
I see a release date for my section
And
I see a link to create a new subsection
Scenario
:
Add a new section (with a quote in the name) to a course (bug
#216)
Given
I have opened a new course in Studio
When
I click the New Section link
And
I enter a section name with a quote and click save
Then
I see my section name with a quote on the Courseware page
And
I click to edit the section name
Then
I see the complete section name with a quote in the editor
Scenario
:
Edit section release date
Given
I have opened a new course in Studio
And
I have added a new section
...
...
cms/djangoapps/contentstore/features/section.py
View file @
b0106a41
from
lettuce
import
world
,
step
from
common
import
*
from
nose.tools
import
assert_equal
############### ACTIONS ####################
...
...
@@ -12,10 +13,12 @@ def i_click_new_section_link(step):
@step
(
'I enter the section name and click save$'
)
def
i_save_section_name
(
step
):
name_css
=
'.new-section-name'
save_css
=
'.new-section-name-save'
css_fill
(
name_css
,
'My Section'
)
css_click
(
save_css
)
save_section_name
(
'My Section'
)
@step
(
'I enter a section name with a quote and click save$'
)
def
i_save_section_name_with_quote
(
step
):
save_section_name
(
'Section with "Quote"'
)
@step
(
'I have added a new section$'
)
...
...
@@ -45,8 +48,24 @@ def i_save_a_new_section_release_date(step):
@step
(
'I see my section on the Courseware page$'
)
def
i_see_my_section_on_the_courseware_page
(
step
):
section_css
=
'span.section-name-span'
assert_css_with_text
(
section_css
,
'My Section'
)
see_my_section_on_the_courseware_page
(
'My Section'
)
@step
(
'I see my section name with a quote on the Courseware page$'
)
def
i_see_my_section_name_with_quote_on_the_courseware_page
(
step
):
see_my_section_on_the_courseware_page
(
'Section with "Quote"'
)
@step
(
'I click to edit the section name$'
)
def
i_click_to_edit_section_name
(
step
):
css_click
(
'span.section-name-span'
)
@step
(
'I see the complete section name with a quote in the editor$'
)
def
i_see_complete_section_name_with_quote_in_editor
(
step
):
css
=
'.edit-section-name'
assert
world
.
browser
.
is_element_present_by_css
(
css
,
5
)
assert_equal
(
world
.
browser
.
find_by_css
(
css
)
.
value
,
'Section with "Quote"'
)
@step
(
'the section does not exist$'
)
...
...
@@ -88,3 +107,17 @@ def the_section_release_date_is_updated(step):
css
=
'span.published-status'
status_text
=
world
.
browser
.
find_by_css
(
css
)
.
text
assert
status_text
==
'Will Release: 12/25/2013 at 12:00am'
############ HELPER METHODS ###################
def
save_section_name
(
name
):
name_css
=
'.new-section-name'
save_css
=
'.new-section-name-save'
css_fill
(
name_css
,
name
)
css_click
(
save_css
)
def
see_my_section_on_the_courseware_page
(
name
):
section_css
=
'span.section-name-span'
assert_css_with_text
(
section_css
,
name
)
\ No newline at end of file
cms/djangoapps/contentstore/features/subsection.feature
View file @
b0106a41
...
...
@@ -9,6 +9,14 @@ Feature: Create Subsection
And
I enter the subsection name and click save
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
:
Delete a subsection
Given
I have opened a new course section in Studio
And
I have added a new subsection
...
...
cms/djangoapps/contentstore/features/subsection.py
View file @
b0106a41
from
lettuce
import
world
,
step
from
common
import
*
from
nose.tools
import
assert_equal
############### ACTIONS ####################
...
...
@@ -20,28 +21,60 @@ def i_click_the_new_subsection_link(step):
@step
(
'I enter the subsection name and click save$'
)
def
i_save_subsection_name
(
step
):
name_css
=
'input.new-subsection-name-input'
save_css
=
'input.new-subsection-name-save'
css_fill
(
name_css
,
'Subsection One'
)
css_click
(
save_css
)
save_subsection_name
(
'Subsection One'
)
@step
(
'I enter a subsection name with a quote and click save$'
)
def
i_save_subsection_name_with_quote
(
step
):
save_subsection_name
(
'Subsection With "Quote"'
)
@step
(
'I click to edit the subsection name$'
)
def
i_click_to_edit_subsection_name
(
step
):
css_click
(
'span.subsection-name-value'
)
@step
(
'I see the complete subsection name with a quote in the editor$'
)
def
i_see_complete_subsection_name_with_quote_in_editor
(
step
):
css
=
'.subsection-display-name-input'
assert
world
.
browser
.
is_element_present_by_css
(
css
,
5
)
assert_equal
(
world
.
browser
.
find_by_css
(
css
)
.
value
,
'Subsection With "Quote"'
)
@step
(
'I have added a new subsection$'
)
def
i_have_added_a_new_subsection
(
step
):
add_subsection
()
############ ASSERTIONS ###################
@step
(
'I see my subsection on the Courseware page$'
)
def
i_see_my_subsection_on_the_courseware_page
(
step
):
css
=
'span.subsection-name'
assert
world
.
browser
.
is_element_present_by_css
(
css
)
css
=
'span.subsection-name-value'
assert_css_with_text
(
css
,
'Subsection One'
)
see_subsection_name
(
'Subsection One'
)
@step
(
'I see my subsection name with a quote on the Courseware page$'
)
def
i_see_my_subsection_name_with_quote_on_the_courseware_page
(
step
):
see_subsection_name
(
'Subsection With "Quote"'
)
@step
(
'the subsection does not exist$'
)
def
the_subsection_does_not_exist
(
step
):
css
=
'span.subsection-name'
assert
world
.
browser
.
is_element_not_present_by_css
(
css
)
############ HELPER METHODS ###################
def
save_subsection_name
(
name
):
name_css
=
'input.new-subsection-name-input'
save_css
=
'input.new-subsection-name-save'
css_fill
(
name_css
,
name
)
css_click
(
save_css
)
def
see_subsection_name
(
name
):
css
=
'span.subsection-name'
assert
world
.
browser
.
is_element_present_by_css
(
css
)
css
=
'span.subsection-name-value'
assert_css_with_text
(
css
,
name
)
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