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
dd39ebec
Commit
dd39ebec
authored
Jul 03, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If success_condition fails, raise an exception
parent
8d809dba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
common/djangoapps/terrain/ui_helpers.py
+5
-2
No files found.
common/djangoapps/terrain/ui_helpers.py
View file @
dd39ebec
...
...
@@ -73,8 +73,9 @@ def css_click(css_selector, index=0, max_attempts=5, success_condition=lambda: T
for
_
in
range
(
max_attempts
):
try
:
world
.
css_find
(
css_selector
)[
index
]
.
click
()
if
success_condition
():
return
if
not
success_condition
():
raise
Exception
(
"unsuccessful click"
)
return
except
WebDriverException
:
# Occasionally, MathJax or other JavaScript can cover up
# an element temporarily.
...
...
@@ -85,6 +86,8 @@ def css_click(css_selector, index=0, max_attempts=5, success_condition=lambda: T
else
:
# try once more, letting exceptions raise
world
.
css_find
(
css_selector
)[
index
]
.
click
()
if
not
success_condition
():
raise
Exception
(
"unsuccessful click"
)
@world.absorb
...
...
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