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
11bb6ce0
Commit
11bb6ce0
authored
Jan 19, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scroll-to method should be more widely available.
parent
0c1fd7ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
common/test/acceptance/pages/studio/settings_advanced.py
+3
-15
common/test/acceptance/tests/helpers.py
+13
-0
No files found.
common/test/acceptance/pages/studio/settings_advanced.py
View file @
11bb6ce0
...
...
@@ -3,6 +3,7 @@ Course Advanced Settings page
"""
from
bok_choy.promise
import
EmptyPromise
from
...tests.helpers
import
coordinates_for_scrolling
from
.course_page
import
CoursePage
from
.utils
import
press_the_notification_button
,
type_in_codemirror
,
get_codemirror_value
...
...
@@ -48,26 +49,13 @@ class AdvancedSettingsPage(CoursePage):
self
.
browser
.
refresh
()
self
.
wait_for_page
()
def
coordinates_for_scrolling
(
self
,
coordinates_for
):
"""
Get the x and y coordinates of elements
"""
cordinates_dict
=
self
.
browser
.
find_element_by_css_selector
(
coordinates_for
)
location
=
cordinates_dict
.
location
for
key
,
val
in
location
.
iteritems
():
if
key
==
'x'
:
x_axis
=
val
elif
key
==
'y'
:
y_axis
=
val
return
x_axis
,
y_axis
def
undo_changes_via_modal
(
self
):
"""
Trigger clicking event of the undo changes button in the modal.
Wait for the undoing process to load via ajax call.
Before that Scroll so the button is clickable on all browsers
"""
self
.
browser
.
execute_script
(
"window.scrollTo"
+
str
(
self
.
coordinates_for_scrolling
(
UNDO_BUTTON_SELECTOR
)))
self
.
browser
.
execute_script
(
"window.scrollTo"
+
str
(
coordinates_for_scrolling
(
self
,
UNDO_BUTTON_SELECTOR
)))
self
.
q
(
css
=
UNDO_BUTTON_SELECTOR
)
.
click
()
self
.
wait_for_ajax
()
...
...
@@ -77,7 +65,7 @@ class AdvancedSettingsPage(CoursePage):
No need to wait for any ajax.
Before that Scroll so the button is clickable on all browsers
"""
self
.
browser
.
execute_script
(
"window.scrollTo"
+
str
(
self
.
coordinates_for_scrolling
(
MANUAL_BUTTON_SELECTOR
)))
self
.
browser
.
execute_script
(
"window.scrollTo"
+
str
(
coordinates_for_scrolling
(
self
,
MANUAL_BUTTON_SELECTOR
)))
self
.
q
(
css
=
MANUAL_BUTTON_SELECTOR
)
.
click
()
def
is_validation_modal_present
(
self
):
...
...
common/test/acceptance/tests/helpers.py
View file @
11bb6ce0
...
...
@@ -199,6 +199,19 @@ def enable_css_animations(page):
"""
)
def
coordinates_for_scrolling
(
page
,
coordinates_for
):
"""
Get the x and y coordinates of elements
"""
cordinates_dict
=
page
.
browser
.
find_element_by_css_selector
(
coordinates_for
)
location
=
cordinates_dict
.
location
for
key
,
val
in
location
.
iteritems
():
if
key
==
'x'
:
x_axis
=
val
elif
key
==
'y'
:
y_axis
=
val
return
x_axis
,
y_axis
def
select_option_by_text
(
select_browser_query
,
option_text
):
"""
Chooses an option within a select by text (helper method for Select's select_by_visible_text method).
...
...
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