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
c82e4ede
Commit
c82e4ede
authored
Feb 06, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2492 from edx/will/really-fix-tab-nav-test
Skip page check in promise for Tab Nav in bok-choy suite
parents
3336cc76
28c33a4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
common/test/acceptance/pages/lms/tab_nav.py
+21
-9
No files found.
common/test/acceptance/pages/lms/tab_nav.py
View file @
c82e4ede
...
...
@@ -36,15 +36,10 @@ class TabNavPage(PageObject):
def
is_on_tab
(
self
,
tab_name
):
"""
Return a boolean indicating whether the current tab is `tab_name`.
Because this is a public method, it checks that we're on the right page
before accessing the DOM.
"""
current_tab_list
=
self
.
css_text
(
'ol.course-tabs>li>a.active'
)
if
len
(
current_tab_list
)
==
0
:
self
.
warning
(
"Could not find current tab"
)
return
False
else
:
return
(
current_tab_list
[
0
]
.
strip
()
.
split
(
'
\n
'
)[
0
]
==
tab_name
)
return
self
.
_is_on_tab
(
tab_name
)
def
_tab_css
(
self
,
tab_name
):
"""
...
...
@@ -73,11 +68,28 @@ class TabNavPage(PageObject):
return
fulfill
(
Promise
(
_check_func
,
"Get all tab names"
))
def
_is_on_tab
(
self
,
tab_name
):
"""
Return a boolean indicating whether the current tab is `tab_name`.
This is a private method, so it does NOT enforce the page check,
which is what we want when we're polling the DOM in a promise.
"""
current_tab_list
=
self
.
css_text
(
'ol.course-tabs>li>a.active'
)
if
len
(
current_tab_list
)
==
0
:
self
.
warning
(
"Could not find current tab"
)
return
False
else
:
return
(
current_tab_list
[
0
]
.
strip
()
.
split
(
'
\n
'
)[
0
]
==
tab_name
)
def
_is_on_tab_promise
(
self
,
tab_name
):
"""
Return a `Promise` that the user is on the tab `tab_name`.
"""
# Use the private version of _is_on_tab to skip the page check
return
EmptyPromise
(
lambda
:
self
.
is_on_tab
(
tab_name
),
lambda
:
self
.
_
is_on_tab
(
tab_name
),
"{0} is the current tab"
.
format
(
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