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
d38b43cc
Commit
d38b43cc
authored
May 17, 2016
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set self.browser consistently in page objects.
parent
1bd2ec25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
common/test/acceptance/pages/lms/learner_profile.py
+8
-9
No files found.
common/test/acceptance/pages/lms/learner_profile.py
View file @
d38b43cc
...
@@ -25,25 +25,24 @@ class Badge(PageObject):
...
@@ -25,25 +25,24 @@ class Badge(PageObject):
url
=
None
url
=
None
def
__init__
(
self
,
element
,
browser
):
def
__init__
(
self
,
element
,
browser
):
self
.
full_view
=
browser
self
.
element
=
element
# Element API is similar to browser API, should allow subqueries.
super
(
Badge
,
self
)
.
__init__
(
browser
)
super
(
Badge
,
self
)
.
__init__
(
element
)
def
is_browser_on_page
(
self
):
def
is_browser_on_page
(
self
):
return
self
.
q
(
css
=
".badge-details"
)
.
visible
return
BrowserQuery
(
self
.
element
,
css
=
".badge-details"
)
.
visible
def
modal_displayed
(
self
):
def
modal_displayed
(
self
):
"""
"""
Verifies that the share modal is diplayed.
Verifies that the share modal is diplayed.
"""
"""
# The modal is on the page at large, and not a subelement of the badge div.
# The modal is on the page at large, and not a subelement of the badge div.
return
BrowserQuery
(
self
.
full_view
,
css
=
".badges-modal"
)
.
visible
return
self
.
q
(
css
=
".badges-modal"
)
.
visible
def
display_modal
(
self
):
def
display_modal
(
self
):
"""
"""
Click the share button to display the sharing modal for the badge.
Click the share button to display the sharing modal for the badge.
"""
"""
self
.
q
(
css
=
".share-button"
)
.
click
()
BrowserQuery
(
self
.
element
,
css
=
".share-button"
)
.
click
()
EmptyPromise
(
self
.
modal_displayed
,
"Share modal displayed"
)
.
fulfill
()
EmptyPromise
(
self
.
modal_displayed
,
"Share modal displayed"
)
.
fulfill
()
EmptyPromise
(
self
.
modal_focused
,
"Focus handed to modal"
)
.
fulfill
()
EmptyPromise
(
self
.
modal_focused
,
"Focus handed to modal"
)
.
fulfill
()
...
@@ -51,7 +50,7 @@ class Badge(PageObject):
...
@@ -51,7 +50,7 @@ class Badge(PageObject):
"""
"""
Return True if the badges model has focus, False otherwise.
Return True if the badges model has focus, False otherwise.
"""
"""
return
BrowserQuery
(
self
.
full_view
,
css
=
".badges-modal"
)
.
is_focused
()
return
self
.
q
(
css
=
".badges-modal"
)
.
is_focused
()
def
bring_model_inside_window
(
self
):
def
bring_model_inside_window
(
self
):
"""
"""
...
@@ -59,7 +58,7 @@ class Badge(PageObject):
...
@@ -59,7 +58,7 @@ class Badge(PageObject):
"""
"""
script_to_execute
=
(
"var popup = document.querySelectorAll('.badges-modal')[0];;"
script_to_execute
=
(
"var popup = document.querySelectorAll('.badges-modal')[0];;"
"popup.style.left = '20
%
';"
)
"popup.style.left = '20
%
';"
)
self
.
full_view
.
execute_script
(
script_to_execute
)
self
.
browser
.
execute_script
(
script_to_execute
)
def
close_modal
(
self
):
def
close_modal
(
self
):
"""
"""
...
@@ -69,7 +68,7 @@ class Badge(PageObject):
...
@@ -69,7 +68,7 @@ class Badge(PageObject):
# which causes click failures. To avoid this, just change
# which causes click failures. To avoid this, just change
# the position of the popup
# the position of the popup
self
.
bring_model_inside_window
()
self
.
bring_model_inside_window
()
BrowserQuery
(
self
.
full_view
,
css
=
".badges-modal .close"
)
.
click
()
self
.
q
(
css
=
".badges-modal .close"
)
.
click
()
EmptyPromise
(
lambda
:
not
self
.
modal_displayed
(),
"Share modal dismissed"
)
.
fulfill
()
EmptyPromise
(
lambda
:
not
self
.
modal_displayed
(),
"Share modal dismissed"
)
.
fulfill
()
...
...
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