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
b3271e3b
Commit
b3271e3b
authored
9 years ago
by
raeeschachar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes test_page_scroll_on_thread_change_view failing on chrome
parent
a0db0d82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
common/test/acceptance/pages/lms/discussion.py
+7
-8
common/test/acceptance/tests/discussion/test_discussion.py
+3
-3
No files found.
common/test/acceptance/pages/lms/discussion.py
View file @
b3271e3b
...
...
@@ -354,12 +354,11 @@ class DiscussionTabSingleThreadPage(CoursePage):
with
self
.
thread_page
.
_secondary_action_menu_open
(
".forum-thread-main-wrapper"
):
self
.
_find_within
(
".forum-thread-main-wrapper .action-close"
)
.
first
.
click
()
@wait_for_js
def
is_window_on_top
(
self
):
def
is_focused_on_element
(
self
,
selector
):
"""
Check if
window's scroll is at top
Check if
the focus is on element
"""
return
self
.
browser
.
execute_script
(
"return $('
html, body').offset().top"
)
==
0
return
self
.
browser
.
execute_script
(
"return $('
{}').is(':focus')"
.
format
(
selector
))
def
_thread_is_rendered_successfully
(
self
,
thread_id
):
return
self
.
q
(
css
=
".discussion-article[data-id='{}']"
.
format
(
thread_id
))
.
visible
...
...
@@ -381,13 +380,13 @@ class DiscussionTabSingleThreadPage(CoursePage):
"""
return
len
(
self
.
q
(
css
=
".forum-nav-thread"
)
.
results
)
==
thread_count
def
check_
window_is_on_top
(
self
):
def
check_
focus_is_set
(
self
,
selector
):
"""
Check
window is on top of the page
Check
focus is set
"""
EmptyPromise
(
self
.
is_window_on_top
,
"
Window is on top
"
lambda
:
self
.
is_focused_on_element
(
selector
)
,
"
Focus is on other element
"
)
.
fulfill
()
...
...
This diff is collapsed.
Click to expand it.
common/test/acceptance/tests/discussion/test_discussion.py
View file @
b3271e3b
...
...
@@ -316,7 +316,7 @@ class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase):
def
test_page_scroll_on_thread_change_view
(
self
):
"""
Check switching between threads changes the page
to scroll to bottom
Check switching between threads changes the page
focus
"""
# verify threads are rendered on the page
self
.
assertTrue
(
...
...
@@ -327,8 +327,8 @@ class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase):
self
.
thread_page_1
.
click_and_open_thread
(
thread_id
=
self
.
thread_ids
[
1
])
self
.
assertTrue
(
self
.
thread_page_2
.
is_browser_on_page
())
# Verify that
window is on top of page.
self
.
thread_page_2
.
check_
window_is_on_top
(
)
# Verify that
the focus is changed
self
.
thread_page_2
.
check_
focus_is_set
(
selector
=
".discussion-article"
)
@attr
(
'shard_2'
)
...
...
This diff is collapsed.
Click to expand it.
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