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
e77b4e9a
Commit
e77b4e9a
authored
Dec 08, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix TNL-5453
parent
5d4514d7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
common/test/acceptance/pages/common/utils.py
+8
-0
common/test/acceptance/pages/lms/discussion.py
+6
-1
No files found.
common/test/acceptance/pages/common/utils.py
View file @
e77b4e9a
...
...
@@ -3,6 +3,7 @@ Utility methods common to Studio and the LMS.
"""
from
bok_choy.promise
import
EmptyPromise
from
common.test.acceptance.tests.helpers
import
disable_animations
from
selenium.webdriver.common.action_chains
import
ActionChains
def
wait_for_notification
(
page
):
...
...
@@ -70,3 +71,10 @@ def confirm_prompt(page, cancel=False, require_notification=None):
page
.
wait_for_element_visibility
(
confirmation_button_css
,
'Confirmation button is visible'
)
require_notification
=
(
not
cancel
)
if
require_notification
is
None
else
require_notification
click_css
(
page
,
confirmation_button_css
,
require_notification
=
require_notification
)
def
hover
(
browser
,
element
):
"""
Hover over an element.
"""
ActionChains
(
browser
)
.
move_to_element
(
element
)
.
perform
()
common/test/acceptance/pages/lms/discussion.py
View file @
e77b4e9a
...
...
@@ -5,6 +5,7 @@ from bok_choy.page_object import PageObject
from
bok_choy.promise
import
EmptyPromise
,
Promise
from
common.test.acceptance.tests.helpers
import
is_focused_on_element
from
common.test.acceptance.pages.common.utils
import
hover
from
common.test.acceptance.pages.lms.course_page
import
CoursePage
...
...
@@ -185,10 +186,14 @@ class DiscussionThreadPage(PageObject, DiscussionPageMixin):
return
link_href
[
0
]
if
link_href
else
None
def
get_response_vote_count
(
self
,
response_id
):
vote_count_css
=
'.response_{} .discussion-response .action-vote'
.
format
(
response_id
)
vote_count_element
=
self
.
browser
.
find_element_by_css_selector
(
vote_count_css
)
# To get the vote count, one must hover over the element first.
hover
(
self
.
browser
,
vote_count_element
)
return
self
.
_get_element_text
(
".response_{} .discussion-response .action-vote .vote-count"
.
format
(
response_id
))
def
vote_response
(
self
,
response_id
):
current_count
=
self
.
_get_element_text
(
".response_{} .discussion-response .action-vote .vote-count"
.
format
(
response_id
)
)
current_count
=
self
.
get_response_vote_count
(
response_id
)
self
.
_find_within
(
".response_{} .discussion-response .action-vote"
.
format
(
response_id
))
.
first
.
click
()
self
.
wait_for
(
lambda
:
current_count
!=
self
.
get_response_vote_count
(
response_id
),
...
...
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