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
cb4f92ac
Commit
cb4f92ac
authored
Feb 05, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tab nav page object more robust
parent
7339f568
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
common/test/acceptance/pages/lms/tab_nav.py
+16
-2
No files found.
common/test/acceptance/pages/lms/tab_nav.py
View file @
cb4f92ac
...
...
@@ -3,7 +3,7 @@ High-level tab navigation.
"""
from
bok_choy.page_object
import
PageObject
from
bok_choy.promise
import
EmptyPromise
,
fulfill_after
from
bok_choy.promise
import
Promise
,
EmptyPromise
,
fulfill_after
,
fulfill
class
TabNavPage
(
PageObject
):
...
...
@@ -49,8 +49,9 @@ class TabNavPage(PageObject):
def
_tab_css
(
self
,
tab_name
):
"""
Return the CSS to click for `tab_name`.
If no tabs exist for that name, return `None`.
"""
all_tabs
=
self
.
css_text
(
'ol.course-tabs li a'
)
all_tabs
=
self
.
_tab_names
try
:
tab_index
=
all_tabs
.
index
(
tab_name
)
...
...
@@ -59,6 +60,19 @@ class TabNavPage(PageObject):
else
:
return
'ol.course-tabs li:nth-of-type({0}) a'
.
format
(
tab_index
+
1
)
@property
def
_tab_names
(
self
):
"""
Return the list of available tab names. If no tab names
are available, wait for them to load. Raises a `BrokenPromiseError`
if the tab names fail to load.
"""
def
_check_func
():
tab_names
=
self
.
css_text
(
'ol.course-tabs li a'
)
return
(
len
(
tab_names
)
>
0
,
tab_names
)
return
fulfill
(
Promise
(
_check_func
,
"Get all tab names"
))
def
_is_on_tab_promise
(
self
,
tab_name
):
"""
Return a `Promise` that the user is on the tab `tab_name`.
...
...
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