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
c53aac45
Commit
c53aac45
authored
Jul 08, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMS acceptance tests now should not get stale element exception errors
parent
f1dd81a6
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
36 additions
and
24 deletions
+36
-24
cms/djangoapps/contentstore/features/advanced-settings.py
+2
-2
cms/djangoapps/contentstore/features/checklists.py
+1
-1
cms/djangoapps/contentstore/features/common.py
+6
-0
cms/djangoapps/contentstore/features/course-settings.py
+1
-1
cms/djangoapps/contentstore/features/course-team.py
+1
-1
cms/djangoapps/contentstore/features/course-updates.py
+1
-1
cms/djangoapps/contentstore/features/grading.py
+6
-6
cms/djangoapps/contentstore/features/problem-editor.py
+2
-2
cms/djangoapps/contentstore/features/section.py
+2
-2
cms/djangoapps/contentstore/features/signup.py
+6
-0
cms/djangoapps/contentstore/features/studio-overview-togglesection.py
+5
-5
cms/djangoapps/contentstore/features/subsection.py
+2
-2
cms/djangoapps/contentstore/features/video.py
+1
-1
No files found.
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
c53aac45
...
@@ -99,7 +99,7 @@ def assert_policy_entries(expected_keys, expected_values):
...
@@ -99,7 +99,7 @@ def assert_policy_entries(expected_keys, expected_values):
def
get_index_of
(
expected_key
):
def
get_index_of
(
expected_key
):
for
counter
in
range
(
len
(
world
.
css_find
(
KEY_CSS
))):
for
counter
in
range
(
len
(
world
.
css_find
(
KEY_CSS
))):
# Sometimes get stale reference if I hold on to the array of elements
# Sometimes get stale reference if I hold on to the array of elements
key
=
world
.
css_
find
(
KEY_CSS
)[
counter
]
.
value
key
=
world
.
css_
value
(
KEY_CSS
,
index
=
counter
)
if
key
==
expected_key
:
if
key
==
expected_key
:
return
counter
return
counter
...
@@ -108,7 +108,7 @@ def get_index_of(expected_key):
...
@@ -108,7 +108,7 @@ def get_index_of(expected_key):
def
get_display_name_value
():
def
get_display_name_value
():
index
=
get_index_of
(
DISPLAY_NAME_KEY
)
index
=
get_index_of
(
DISPLAY_NAME_KEY
)
return
world
.
css_
find
(
VALUE_CSS
)[
index
]
.
value
return
world
.
css_
value
(
VALUE_CSS
,
index
=
index
)
def
change_display_name_value
(
step
,
new_value
):
def
change_display_name_value
(
step
,
new_value
):
...
...
cms/djangoapps/contentstore/features/checklists.py
View file @
c53aac45
...
@@ -61,7 +61,7 @@ def i_select_a_link_to_the_course_outline(step):
...
@@ -61,7 +61,7 @@ def i_select_a_link_to_the_course_outline(step):
@step
(
'I am brought to the course outline page$'
)
@step
(
'I am brought to the course outline page$'
)
def
i_am_brought_to_course_outline
(
step
):
def
i_am_brought_to_course_outline
(
step
):
assert_in
(
'Course Outline'
,
world
.
css_
find
(
'.outline .page-header'
)[
0
]
.
text
)
assert_in
(
'Course Outline'
,
world
.
css_
text
(
'.outline .page-header'
)
)
assert_equal
(
1
,
len
(
world
.
browser
.
windows
))
assert_equal
(
1
,
len
(
world
.
browser
.
windows
))
...
...
cms/djangoapps/contentstore/features/common.py
View file @
c53aac45
...
@@ -144,10 +144,16 @@ def log_into_studio(
...
@@ -144,10 +144,16 @@ def log_into_studio(
world
.
is_css_present
(
signin_css
)
world
.
is_css_present
(
signin_css
)
world
.
css_click
(
signin_css
)
world
.
css_click
(
signin_css
)
attempt
=
0
while
attempt
<
5
:
try
:
login_form
=
world
.
browser
.
find_by_css
(
'form#login_form'
)
login_form
=
world
.
browser
.
find_by_css
(
'form#login_form'
)
login_form
.
find_by_name
(
'email'
)
.
fill
(
email
)
login_form
.
find_by_name
(
'email'
)
.
fill
(
email
)
login_form
.
find_by_name
(
'password'
)
.
fill
(
password
)
login_form
.
find_by_name
(
'password'
)
.
fill
(
password
)
login_form
.
find_by_name
(
'submit'
)
.
click
()
login_form
.
find_by_name
(
'submit'
)
.
click
()
break
except
:
attempt
+=
1
assert_true
(
world
.
is_css_present
(
'.new-course-button'
))
assert_true
(
world
.
is_css_present
(
'.new-course-button'
))
...
...
cms/djangoapps/contentstore/features/course-settings.py
View file @
c53aac45
...
@@ -162,7 +162,7 @@ def verify_date_or_time(css, date_or_time):
...
@@ -162,7 +162,7 @@ def verify_date_or_time(css, date_or_time):
"""
"""
Verifies date or time field.
Verifies date or time field.
"""
"""
assert_equal
(
date_or_time
,
world
.
css_
find
(
css
)
.
first
.
value
)
assert_equal
(
date_or_time
,
world
.
css_
value
(
css
)
)
def
i_see_the_set_dates
():
def
i_see_the_set_dates
():
...
...
cms/djangoapps/contentstore/features/course-team.py
View file @
c53aac45
...
@@ -47,7 +47,7 @@ def other_user_login(_step, name):
...
@@ -47,7 +47,7 @@ def other_user_login(_step, name):
@step
(
u's?he does( not)? see the course on (his|her) page'
)
@step
(
u's?he does( not)? see the course on (his|her) page'
)
def
see_course
(
_step
,
doesnt_see_course
,
gender
):
def
see_course
(
_step
,
doesnt_see_course
,
gender
):
class_css
=
'span.class-name'
class_css
=
'span.class-name'
all_courses
=
world
.
css_find
(
class_css
)
all_courses
=
world
.
css_find
(
class_css
,
wait_time
=
1
)
all_names
=
[
item
.
html
for
item
in
all_courses
]
all_names
=
[
item
.
html
for
item
in
all_courses
]
if
doesnt_see_course
:
if
doesnt_see_course
:
assert
not
_COURSE_NAME
in
all_names
assert
not
_COURSE_NAME
in
all_names
...
...
cms/djangoapps/contentstore/features/course-updates.py
View file @
c53aac45
...
@@ -24,7 +24,7 @@ def add_update(_step, text):
...
@@ -24,7 +24,7 @@ def add_update(_step, text):
@step
(
u'I should( not)? see the update "([^"]*)"$'
)
@step
(
u'I should( not)? see the update "([^"]*)"$'
)
def
check_update
(
_step
,
doesnt_see_update
,
text
):
def
check_update
(
_step
,
doesnt_see_update
,
text
):
update_css
=
'div.update-contents'
update_css
=
'div.update-contents'
update
=
world
.
css_find
(
update_css
)
update
=
world
.
css_find
(
update_css
,
wait_time
=
1
)
if
doesnt_see_update
:
if
doesnt_see_update
:
assert
len
(
update
)
==
0
or
not
text
in
update
.
html
assert
len
(
update
)
==
0
or
not
text
in
update
.
html
else
:
else
:
...
...
cms/djangoapps/contentstore/features/grading.py
View file @
c53aac45
...
@@ -90,8 +90,8 @@ def add_assignment_type(step, new_name):
...
@@ -90,8 +90,8 @@ def add_assignment_type(step, new_name):
add_button_css
=
'.add-grading-data'
add_button_css
=
'.add-grading-data'
world
.
css_click
(
add_button_css
)
world
.
css_click
(
add_button_css
)
name_id
=
'#course-grading-assignment-name'
name_id
=
'#course-grading-assignment-name'
f
=
world
.
css_find
(
name_id
)[
4
]
new_assignment
=
world
.
css_find
(
name_id
)[
-
1
]
f
.
_element
.
send_keys
(
new_name
)
new_assignment
.
_element
.
send_keys
(
new_name
)
@step
(
u'I have populated the course'
)
@step
(
u'I have populated the course'
)
...
@@ -118,8 +118,8 @@ def i_see_the_assignment_type(_step, name):
...
@@ -118,8 +118,8 @@ def i_see_the_assignment_type(_step, name):
def
get_type_index
(
name
):
def
get_type_index
(
name
):
name_id
=
'#course-grading-assignment-name'
name_id
=
'#course-grading-assignment-name'
f
=
world
.
css_find
(
name_id
)
all_types
=
world
.
css_find
(
name_id
)
for
i
in
range
(
len
(
f
)):
for
i
ndex
in
range
(
len
(
all_types
)):
if
f
[
i
]
.
value
==
name
:
if
world
.
css_value
(
name_id
,
index
=
index
)
==
name
:
return
i
return
i
ndex
return
-
1
return
-
1
cms/djangoapps/contentstore/features/problem-editor.py
View file @
c53aac45
...
@@ -169,7 +169,7 @@ def edit_latex_source(step):
...
@@ -169,7 +169,7 @@ def edit_latex_source(step):
@step
(
'my change to the High Level Source is persisted'
)
@step
(
'my change to the High Level Source is persisted'
)
def
high_level_source_persisted
(
step
):
def
high_level_source_persisted
(
step
):
def
verify_text
(
driver
):
def
verify_text
(
driver
):
return
world
.
css_
find
(
'.problem'
)
.
text
==
'hi'
return
world
.
css_
text
(
'.problem'
)
==
'hi'
world
.
wait_for
(
verify_text
)
world
.
wait_for
(
verify_text
)
...
@@ -177,7 +177,7 @@ def high_level_source_persisted(step):
...
@@ -177,7 +177,7 @@ def high_level_source_persisted(step):
@step
(
'I view the High Level Source I see my changes'
)
@step
(
'I view the High Level Source I see my changes'
)
def
high_level_source_in_editor
(
step
):
def
high_level_source_in_editor
(
step
):
open_high_level_source
()
open_high_level_source
()
assert_equal
(
'hi'
,
world
.
css_
find
(
'.source-edit-box'
)
.
value
)
assert_equal
(
'hi'
,
world
.
css_
value
(
'.source-edit-box'
)
)
def
verify_high_level_source_links
(
step
,
visible
):
def
verify_high_level_source_links
(
step
,
visible
):
...
...
cms/djangoapps/contentstore/features/section.py
View file @
c53aac45
...
@@ -70,7 +70,7 @@ def i_click_to_edit_section_name(_step):
...
@@ -70,7 +70,7 @@ def i_click_to_edit_section_name(_step):
def
i_see_complete_section_name_with_quote_in_editor
(
_step
):
def
i_see_complete_section_name_with_quote_in_editor
(
_step
):
css
=
'.section-name-edit input[type=text]'
css
=
'.section-name-edit input[type=text]'
assert
world
.
is_css_present
(
css
)
assert
world
.
is_css_present
(
css
)
assert_equal
(
world
.
browser
.
find_by_css
(
css
)
.
value
,
'Section with "Quote"'
)
assert_equal
(
world
.
css_value
(
css
)
,
'Section with "Quote"'
)
@step
(
'the section does not exist$'
)
@step
(
'the section does not exist$'
)
...
@@ -85,7 +85,7 @@ def i_see_a_release_date_for_my_section(_step):
...
@@ -85,7 +85,7 @@ def i_see_a_release_date_for_my_section(_step):
css
=
'span.published-status'
css
=
'span.published-status'
assert
world
.
is_css_present
(
css
)
assert
world
.
is_css_present
(
css
)
status_text
=
world
.
browser
.
find_by_css
(
css
)
.
text
status_text
=
world
.
css_text
(
css
)
# e.g. 11/06/2012 at 16:25
# e.g. 11/06/2012 at 16:25
msg
=
'Will Release:'
msg
=
'Will Release:'
...
...
cms/djangoapps/contentstore/features/signup.py
View file @
c53aac45
...
@@ -7,12 +7,18 @@ from common import *
...
@@ -7,12 +7,18 @@ from common import *
@step
(
'I fill in the registration form$'
)
@step
(
'I fill in the registration form$'
)
def
i_fill_in_the_registration_form
(
step
):
def
i_fill_in_the_registration_form
(
step
):
attempt
=
0
while
attempt
<
5
:
try
:
register_form
=
world
.
browser
.
find_by_css
(
'form#register_form'
)
register_form
=
world
.
browser
.
find_by_css
(
'form#register_form'
)
register_form
.
find_by_name
(
'email'
)
.
fill
(
'robot+studio@edx.org'
)
register_form
.
find_by_name
(
'email'
)
.
fill
(
'robot+studio@edx.org'
)
register_form
.
find_by_name
(
'password'
)
.
fill
(
'test'
)
register_form
.
find_by_name
(
'password'
)
.
fill
(
'test'
)
register_form
.
find_by_name
(
'username'
)
.
fill
(
'robot-studio'
)
register_form
.
find_by_name
(
'username'
)
.
fill
(
'robot-studio'
)
register_form
.
find_by_name
(
'name'
)
.
fill
(
'Robot Studio'
)
register_form
.
find_by_name
(
'name'
)
.
fill
(
'Robot Studio'
)
register_form
.
find_by_name
(
'terms_of_service'
)
.
check
()
register_form
.
find_by_name
(
'terms_of_service'
)
.
check
()
break
except
:
attempt
+=
1
@step
(
'I press the Create My Account button on the registration form$'
)
@step
(
'I press the Create My Account button on the registration form$'
)
...
...
cms/djangoapps/contentstore/features/studio-overview-togglesection.py
View file @
c53aac45
...
@@ -92,7 +92,7 @@ def i_expand_a_section(step):
...
@@ -92,7 +92,7 @@ def i_expand_a_section(step):
def
i_see_the_span_with_text
(
step
,
text
):
def
i_see_the_span_with_text
(
step
,
text
):
span_locator
=
'.toggle-button-sections span'
span_locator
=
'.toggle-button-sections span'
assert_true
(
world
.
is_css_present
(
span_locator
))
assert_true
(
world
.
is_css_present
(
span_locator
))
assert_equal
(
world
.
css_
find
(
span_locator
)
.
value
,
text
)
assert_equal
(
world
.
css_
value
(
span_locator
)
,
text
)
assert_true
(
world
.
css_visible
(
span_locator
))
assert_true
(
world
.
css_visible
(
span_locator
))
...
@@ -108,13 +108,13 @@ def i_do_not_see_the_span_with_text(step, text):
...
@@ -108,13 +108,13 @@ def i_do_not_see_the_span_with_text(step, text):
def
all_sections_are_expanded
(
step
):
def
all_sections_are_expanded
(
step
):
subsection_locator
=
'div.subsection-list'
subsection_locator
=
'div.subsection-list'
subsections
=
world
.
css_find
(
subsection_locator
)
subsections
=
world
.
css_find
(
subsection_locator
)
for
s
in
subsections
:
for
index
in
range
(
len
(
subsections
))
:
assert_true
(
s
.
visible
)
assert_true
(
world
.
css_visible
(
subsection_locator
,
index
=
index
)
)
@step
(
u'all sections are collapsed$'
)
@step
(
u'all sections are collapsed$'
)
def
all_sections_are_collapsed
(
step
):
def
all_sections_are_collapsed
(
step
):
subsection_locator
=
'div.subsection-list'
subsection_locator
=
'div.subsection-list'
subsections
=
world
.
css_find
(
subsection_locator
)
subsections
=
world
.
css_find
(
subsection_locator
)
for
s
in
subsections
:
for
index
in
range
(
len
(
subsections
))
:
assert_false
(
s
.
visible
)
assert_false
(
world
.
css_visible
(
subsection_locator
,
index
=
index
)
)
cms/djangoapps/contentstore/features/subsection.py
View file @
c53aac45
...
@@ -50,7 +50,7 @@ def i_click_to_edit_subsection_name(step):
...
@@ -50,7 +50,7 @@ def i_click_to_edit_subsection_name(step):
def
i_see_complete_subsection_name_with_quote_in_editor
(
step
):
def
i_see_complete_subsection_name_with_quote_in_editor
(
step
):
css
=
'.subsection-display-name-input'
css
=
'.subsection-display-name-input'
assert
world
.
is_css_present
(
css
)
assert
world
.
is_css_present
(
css
)
assert_equal
(
world
.
css_
find
(
css
)
.
value
,
'Subsection With "Quote"'
)
assert_equal
(
world
.
css_
value
(
css
)
,
'Subsection With "Quote"'
)
@step
(
'I have set a release date and due date in different years$'
)
@step
(
'I have set a release date and due date in different years$'
)
...
@@ -69,7 +69,7 @@ def i_mark_it_as_homework(step):
...
@@ -69,7 +69,7 @@ def i_mark_it_as_homework(step):
@step
(
'I see it marked as Homework$'
)
@step
(
'I see it marked as Homework$'
)
def
i_see_it_marked__as_homework
(
step
):
def
i_see_it_marked__as_homework
(
step
):
assert_equal
(
world
.
css_
find
(
".status-label"
)
.
value
,
'Homework'
)
assert_equal
(
world
.
css_
value
(
".status-label"
)
,
'Homework'
)
############ ASSERTIONS ###################
############ ASSERTIONS ###################
...
...
cms/djangoapps/contentstore/features/video.py
View file @
c53aac45
...
@@ -8,7 +8,7 @@ from lettuce import world, step
...
@@ -8,7 +8,7 @@ from lettuce import world, step
@step
(
'when I view the video it does not have autoplay enabled'
)
@step
(
'when I view the video it does not have autoplay enabled'
)
def
does_not_autoplay
(
_step
):
def
does_not_autoplay
(
_step
):
assert
world
.
css_find
(
'.video'
)[
0
][
'data-autoplay'
]
==
'False'
assert
world
.
css_find
(
'.video'
)[
0
][
'data-autoplay'
]
==
'False'
assert
world
.
css_
find
(
'.video_control'
)[
0
]
.
has_class
(
'play'
)
assert
world
.
css_
has_class
(
'.video_control'
,
'play'
)
@step
(
'creating a video takes a single click'
)
@step
(
'creating a video takes a single click'
)
...
...
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