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
0d3b7edd
Commit
0d3b7edd
authored
Jun 20, 2013
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #223 from edx/christina/pep8
pep8 fixes.
parents
a6f697cc
9e69586b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
cms/djangoapps/contentstore/features/advanced-settings.py
+3
-4
common/djangoapps/terrain/ui_helpers.py
+13
-13
No files found.
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
0d3b7edd
...
...
@@ -31,11 +31,10 @@ def press_the_notification_button(step, name):
# Save was clicked if either the save notification bar is gone, or we have a error notification
# overlaying it (expected in the case of typing Object into display_name).
save_clicked
=
lambda
:
world
.
is_css_not_present
(
'.is-shown.wrapper-notification-warning'
)
or
\
world
.
is_css_present
(
'.is-shown.wrapper-notification-error'
)
save_clicked
=
lambda
:
world
.
is_css_not_present
(
'.is-shown.wrapper-notification-warning'
)
or
\
world
.
is_css_present
(
'.is-shown.wrapper-notification-error'
)
assert_true
(
world
.
css_click
(
css
,
success_condition
=
save_clicked
),
'The save button was not clicked after 5 attempts.'
)
assert_true
(
world
.
css_click
(
css
,
success_condition
=
save_clicked
),
'Save button not clicked after 5 attempts.'
)
@step
(
u'I edit the value of a policy key$'
)
...
...
common/djangoapps/terrain/ui_helpers.py
View file @
0d3b7edd
...
...
@@ -49,7 +49,7 @@ def css_has_text(css_selector, text):
@world.absorb
def
css_find
(
css
,
wait_time
=
5
):
def
is_visible
(
driver
):
def
is_visible
(
_
driver
):
return
EC
.
visibility_of_element_located
((
By
.
CSS_SELECTOR
,
css
,))
world
.
browser
.
is_element_present_by_css
(
css
,
wait_time
=
wait_time
)
...
...
@@ -58,7 +58,7 @@ def css_find(css, wait_time=5):
@world.absorb
def
css_click
(
css_selector
,
index
=
0
,
attempts
=
5
,
success_condition
=
lambda
:
True
):
def
css_click
(
css_selector
,
index
=
0
,
attempts
=
5
,
success_condition
=
lambda
:
True
):
"""
Perform a click on a CSS selector, retrying if it initially fails.
...
...
@@ -90,15 +90,15 @@ def css_click(css_selector, index=0, attempts=5, success_condition=lambda:True):
@world.absorb
def
css_click_at
(
css
,
x
=
10
,
y
=
10
):
def
css_click_at
(
css
,
x
_cord
=
10
,
y_cord
=
10
):
'''
A method to click at x,y coordinates of the element
rather than in the center of the element
'''
e
=
css_find
(
css
)
.
first
e
.
action_chains
.
move_to_element_with_offset
(
e
.
_element
,
x
,
y
)
e
.
action_chains
.
click
()
e
.
action_chains
.
perform
()
e
lement
=
css_find
(
css
)
.
first
e
lement
.
action_chains
.
move_to_element_with_offset
(
element
.
_element
,
x_cord
,
y_cord
)
e
lement
.
action_chains
.
click
()
e
lement
.
action_chains
.
perform
()
@world.absorb
...
...
@@ -143,7 +143,7 @@ def css_visible(css_selector):
@world.absorb
def
dialogs_closed
():
def
are_dialogs_closed
(
driver
):
def
are_dialogs_closed
(
_
driver
):
'''
Return True when no modal dialogs are visible
'''
...
...
@@ -154,12 +154,12 @@ def dialogs_closed():
@world.absorb
def
save_the_html
(
path
=
'/tmp'
):
u
=
world
.
browser
.
url
u
rl
=
world
.
browser
.
url
html
=
world
.
browser
.
html
.
encode
(
'ascii'
,
'ignore'
)
filename
=
'
%
s.html'
%
quote_plus
(
u
)
f
=
open
(
'
%
s/
%
s'
%
(
path
,
filename
),
'w'
)
f
.
write
(
html
)
f
.
close
()
filename
=
'
%
s.html'
%
quote_plus
(
u
rl
)
f
ile
=
open
(
'
%
s/
%
s'
%
(
path
,
filename
),
'w'
)
f
ile
.
write
(
html
)
f
ile
.
close
()
@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