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
3cec8f1a
Commit
3cec8f1a
authored
Mar 04, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch WebDriverException
parent
b9e5ed95
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
cms/djangoapps/contentstore/features/advanced-settings.py
+5
-0
cms/djangoapps/contentstore/features/common.py
+9
-2
No files found.
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
3cec8f1a
from
lettuce
import
world
,
step
from
lettuce
import
world
,
step
from
common
import
*
from
common
import
*
import
time
import
time
from
selenium.common.exceptions
import
WebDriverException
from
nose.tools
import
assert_equal
from
nose.tools
import
assert_equal
from
nose.tools
import
assert_true
from
nose.tools
import
assert_true
...
@@ -42,7 +43,11 @@ def edit_the_name_of_a_policy_key(step):
...
@@ -42,7 +43,11 @@ def edit_the_name_of_a_policy_key(step):
@step
(
u'I press the "([^"]*)" notification button$'
)
@step
(
u'I press the "([^"]*)" notification button$'
)
def
press_the_notification_button
(
step
,
name
):
def
press_the_notification_button
(
step
,
name
):
try
:
world
.
browser
.
click_link_by_text
(
name
)
world
.
browser
.
click_link_by_text
(
name
)
except
WebDriverException
,
e
:
css
=
'a.
%
s-button'
%
name
.
lower
()
css_click_at
(
css
)
@step
(
u'I edit the value of a policy key$'
)
@step
(
u'I edit the value of a policy key$'
)
...
...
cms/djangoapps/contentstore/features/common.py
View file @
3cec8f1a
...
@@ -3,6 +3,7 @@ from lettuce.django import django_url
...
@@ -3,6 +3,7 @@ from lettuce.django import django_url
from
nose.tools
import
assert_true
from
nose.tools
import
assert_true
from
nose.tools
import
assert_equal
from
nose.tools
import
assert_equal
from
selenium.webdriver.support.ui
import
WebDriverWait
from
selenium.webdriver.support.ui
import
WebDriverWait
from
selenium.common.exceptions
import
WebDriverException
from
terrain.factories
import
UserFactory
,
RegistrationFactory
,
UserProfileFactory
from
terrain.factories
import
UserFactory
,
RegistrationFactory
,
UserProfileFactory
from
terrain.factories
import
CourseFactory
,
GroupFactory
from
terrain.factories
import
CourseFactory
,
GroupFactory
...
@@ -95,9 +96,15 @@ def assert_css_with_text(css, text):
...
@@ -95,9 +96,15 @@ def assert_css_with_text(css, text):
def
css_click
(
css
):
def
css_click
(
css
):
'''
'''
Rather than click in the middle of an element,
First try to use the regular click method,
click in the upper left
but if clicking in the middle of an element
doesn't work it might be that it thinks some other
element is on top of it there so click in the upper left
'''
'''
try
:
assert_true
(
world
.
browser
.
is_element_present_by_css
(
css
,
5
))
world
.
browser
.
find_by_css
(
css
)
.
first
.
click
()
except
WebDriverException
,
e
:
css_click_at
(
css
)
css_click_at
(
css
)
...
...
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