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
e20f2109
Commit
e20f2109
authored
Sep 05, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated static-pages test to add retry logic
parent
08168ec6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
cms/djangoapps/contentstore/features/static-pages.py
+14
-7
No files found.
cms/djangoapps/contentstore/features/static-pages.py
View file @
e20f2109
...
...
@@ -3,6 +3,7 @@
from
lettuce
import
world
,
step
from
selenium.webdriver.common.keys
import
Keys
from
nose.tools
import
assert_true
# pylint: disable=E0611
@step
(
u'I go to the static pages page'
)
...
...
@@ -21,18 +22,21 @@ def add_page(_step):
@step
(
u'I should( not)? see a "([^"]*)" static page$'
)
def
see_page
(
_step
,
doesnt
,
page
):
index
=
get_index
(
page
)
if
doesnt
:
assert
index
==
-
1
else
:
assert
index
!=
-
1
should_exist
=
not
doesnt
# Need to retry here because the element
# will sometimes exist before the HTML content is loaded
exists_func
=
lambda
(
driver
):
page_exists
(
page
)
==
should_exist
world
.
wait_for
(
exists_func
)
assert_true
(
exists_func
(
None
))
@step
(
u'I "([^"]*)" the "([^"]*)" page$'
)
def
click_edit_delete
(
_step
,
edit_delete
,
page
):
button_css
=
'a.
%
s-button'
%
edit_delete
index
=
get_index
(
page
)
assert
index
!=
-
1
assert
index
is
not
None
world
.
css_click
(
button_css
,
index
=
index
)
...
...
@@ -54,4 +58,7 @@ def get_index(name):
for
i
in
range
(
len
(
all_pages
)):
if
world
.
css_html
(
page_name_css
,
index
=
i
)
==
'
\n
{name}
\n
'
.
format
(
name
=
name
):
return
i
return
-
1
return
None
def
page_exists
(
page
):
return
get_index
(
page
)
is
not
None
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