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
a3a7d1d5
Commit
a3a7d1d5
authored
Jun 06, 2013
by
Jonah Stanley
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77 from edx/jonahstanley/fix-alert-tests
Jonahstanley/fix alert tests
parents
228b5014
477f29d5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
67 deletions
+91
-67
cms/djangoapps/contentstore/features/section.feature
+2
-4
cms/djangoapps/contentstore/features/section.py
+2
-2
cms/djangoapps/contentstore/features/studio-overview-togglesection.feature
+55
-57
cms/djangoapps/contentstore/features/subsection.feature
+2
-4
common/djangoapps/terrain/steps.py
+30
-0
No files found.
cms/djangoapps/contentstore/features/section.feature
View file @
a3a7d1d5
...
...
@@ -26,11 +26,9 @@ Feature: Create Section
And
I save a new section release date
Then
the section release date is updated
# Skipped because Ubuntu ChromeDriver hangs on alert
@skip
Scenario
:
Delete section
Given
I have opened a new course in Studio
And
I have added a new section
When
I
press the
"section"
delete icon
And
I
confirm the alert
When
I
will confirm all alerts
And
I
press the
"section"
delete icon
Then
the section does not exist
cms/djangoapps/contentstore/features/section.py
View file @
a3a7d1d5
...
...
@@ -69,8 +69,8 @@ def i_see_complete_section_name_with_quote_in_editor(step):
@step
(
'the section does not exist$'
)
def
section_does_not_exist
(
step
):
css
=
'
span.section-name-span
'
assert
world
.
browser
.
is_element_not_present_by_css
(
css
)
css
=
'
h3[data-name="My Section"]
'
assert
world
.
is_css_not_present
(
css
)
@step
(
'I see a release date for my section$'
)
...
...
cms/djangoapps/contentstore/features/studio-overview-togglesection.feature
View file @
a3a7d1d5
Feature
:
Overview Toggle Section
In order to quickly view the details of a course's section or to scan the inventory of sections
In order to quickly view the details of a course's section or to scan the inventory of sections
As a course author
I want to toggle the visibility of each section's subsection details in the overview listing
Scenario
:
The default layout for the overview page is to show sections in expanded view
Given
I have a course with multiple sections
When
I navigate to the course overview page
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
Scenario
:
Expand /collapse for a course with no sections
Given
I have a course with no sections
When
I navigate to the course overview page
Then
I do not see the
"Collapse All Sections"
link
Scenario
:
Collapse link appears after creating first section of a course
Given
I have a course with no sections
When
I navigate to the course overview page
And
I add a section
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
# Skipped because Ubuntu ChromeDriver hangs on alert
@skip
Scenario
:
Collapse link is not removed after last section of a course is deleted
Given
I have a course with 1 section
And
I navigate to the course overview page
When
I press the
"section"
delete icon
And
I confirm the alert
Then
I see the
"Collapse All Sections"
link
Scenario
:
Collapsing all sections when all sections are expanded
Given
I navigate to the courseware page of a course with multiple sections
And
all sections are expanded
When
I click the
"Collapse All Sections"
link
Then
I see the
"Expand All Sections"
link
And
all sections are collapsed
Scenario
:
Collapsing all sections when 1 or more sections are already collapsed
Given
I navigate to the courseware page of a course with multiple sections
And
all sections are expanded
When
I collapse the first section
And
I click the
"Collapse All Sections"
link
Then
I see the
"Expand All Sections"
link
And
all sections are collapsed
Scenario
:
Expanding all sections when all sections are collapsed
Given
I navigate to the courseware page of a course with multiple sections
And
I click the
"Collapse All Sections"
link
When
I click the
"Expand All Sections"
link
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
Scenario
:
Expanding all sections when 1 or more sections are already expanded
Given
I navigate to the courseware page of a course with multiple sections
And
I click the
"Collapse All Sections"
link
When
I expand the first section
And
I click the
"Expand All Sections"
link
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
Scenario
:
The default layout for the overview page is to show sections in expanded view
Given
I have a course with multiple sections
When
I navigate to the course overview page
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
Scenario
:
Expand /collapse for a course with no sections
Given
I have a course with no sections
When
I navigate to the course overview page
Then
I do not see the
"Collapse All Sections"
link
Scenario
:
Collapse link appears after creating first section of a course
Given
I have a course with no sections
When
I navigate to the course overview page
And
I add a section
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
Scenario
:
Collapse link is not removed after last section of a course is deleted
Given
I have a course with 1 section
And
I navigate to the course overview page
When
I will confirm all alerts
And
I press the
"section"
delete icon
Then
I see the
"Collapse All Sections"
link
Scenario
:
Collapsing all sections when all sections are expanded
Given
I navigate to the courseware page of a course with multiple sections
And
all sections are expanded
When
I click the
"Collapse All Sections"
link
Then
I see the
"Expand All Sections"
link
And
all sections are collapsed
Scenario
:
Collapsing all sections when 1 or more sections are already collapsed
Given
I navigate to the courseware page of a course with multiple sections
And
all sections are expanded
When
I collapse the first section
And
I click the
"Collapse All Sections"
link
Then
I see the
"Expand All Sections"
link
And
all sections are collapsed
Scenario
:
Expanding all sections when all sections are collapsed
Given
I navigate to the courseware page of a course with multiple sections
And
I click the
"Collapse All Sections"
link
When
I click the
"Expand All Sections"
link
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
Scenario
:
Expanding all sections when 1 or more sections are already expanded
Given
I navigate to the courseware page of a course with multiple sections
And
I click the
"Collapse All Sections"
link
When
I expand the first section
And
I click the
"Expand All Sections"
link
Then
I see the
"Collapse All Sections"
link
And
all sections are expanded
cms/djangoapps/contentstore/features/subsection.feature
View file @
a3a7d1d5
...
...
@@ -32,12 +32,10 @@ Feature: Create Subsection
And
I reload the page
Then
I see the correct dates
# Skipped because Ubuntu ChromeDriver hangs on alert
@skip
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
When
I
will confirm all alerts
And
I
press the
"subsection"
delete icon
Then
the subsection does not exist
common/djangoapps/terrain/steps.py
View file @
a3a7d1d5
...
...
@@ -159,3 +159,33 @@ def registered_edx_user(step, uname):
@step
(
u'All dialogs should be closed$'
)
def
dialogs_are_closed
(
step
):
assert
world
.
dialogs_closed
()
@step
(
'I will confirm all alerts'
)
def
i_confirm_all_alerts
(
step
):
"""
Please note: This method must be called RIGHT BEFORE an expected alert
Window variables are page local and thus all changes are removed upon navigating to a new page
In addition, this method changes the functionality of ONLY future alerts
"""
world
.
browser
.
execute_script
(
'window.confirm = function(){return true;} ; window.alert = function(){return;}'
)
@step
(
'I will cancel all alerts'
)
def
i_cancel_all_alerts
(
step
):
"""
Please note: This method must be called RIGHT BEFORE an expected alert
Window variables are page local and thus all changes are removed upon navigating to a new page
In addition, this method changes the functionality of ONLY future alerts
"""
world
.
browser
.
execute_script
(
'window.confirm = function(){return false;} ; window.alert = function(){return;}'
)
@step
(
'I will answer all prompts with "([^"]*)"'
)
def
i_answer_prompts_with
(
step
,
prompt
):
"""
Please note: This method must be called RIGHT BEFORE an expected alert
Window variables are page local and thus all changes are removed upon navigating to a new page
In addition, this method changes the functionality of ONLY future alerts
"""
world
.
browser
.
execute_script
(
'window.prompt = function(){return
%
s;}'
)
%
prompt
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