Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
e20f2109
Commit
e20f2109
authored
11 years ago
by
Will Daly
Browse files
Options
Downloads
Patches
Plain Diff
Updated static-pages test to add retry logic
parent
08168ec6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cms/djangoapps/contentstore/features/static-pages.py
+14
-7
14 additions, 7 deletions
cms/djangoapps/contentstore/features/static-pages.py
with
14 additions
and
7 deletions
cms/djangoapps/contentstore/features/static-pages.py
+
14
−
7
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment