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
f7e2830a
Commit
f7e2830a
authored
Oct 22, 2015
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move waits into the page objects.
parent
9968622c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
33 deletions
+37
-33
common/test/acceptance/pages/lms/discussion.py
+12
-4
common/test/acceptance/pages/lms/problem.py
+20
-8
common/test/acceptance/tests/discussion/test_discussion.py
+2
-8
common/test/acceptance/tests/lms/test_lms_problems.py
+3
-13
No files found.
common/test/acceptance/pages/lms/discussion.py
View file @
f7e2830a
...
@@ -116,11 +116,19 @@ class DiscussionThreadPage(PageObject, DiscussionPageMixin):
...
@@ -116,11 +116,19 @@ class DiscussionThreadPage(PageObject, DiscussionPageMixin):
def
is_discussion_body_visible
(
self
):
def
is_discussion_body_visible
(
self
):
return
self
.
_is_element_visible
(
".post-body"
)
return
self
.
_is_element_visible
(
".post-body"
)
def
is_mathjax_preview_available
(
self
):
def
verify_mathjax_preview_available
(
self
):
return
self
.
q
(
css
=
".MathJax_Preview"
)
.
text
[
0
]
==
""
""" Checks that MathJax Preview css class is present """
self
.
wait_for
(
lambda
:
len
(
self
.
q
(
css
=
".MathJax_Preview"
)
.
text
)
>
0
and
self
.
q
(
css
=
".MathJax_Preview"
)
.
text
[
0
]
==
""
,
description
=
"MathJax Preview is rendered"
)
def
is_mathjax_rendered
(
self
):
def
verify_mathjax_rendered
(
self
):
return
self
.
_is_element_visible
(
".MathJax"
)
""" Checks that MathJax css class is present """
self
.
wait_for
(
lambda
:
self
.
_is_element_visible
(
".MathJax"
),
description
=
"MathJax Preview is rendered"
)
def
is_response_visible
(
self
,
comment_id
):
def
is_response_visible
(
self
,
comment_id
):
"""Returns true if the response is viewable onscreen"""
"""Returns true if the response is viewable onscreen"""
...
...
common/test/acceptance/pages/lms/problem.py
View file @
f7e2830a
...
@@ -42,21 +42,33 @@ class ProblemPage(PageObject):
...
@@ -42,21 +42,33 @@ class ProblemPage(PageObject):
"""
"""
return
self
.
q
(
css
=
"div.problem div.problem-hint"
)
.
text
[
0
]
return
self
.
q
(
css
=
"div.problem div.problem-hint"
)
.
text
[
0
]
@property
def
verify_mathjax_rendered_in_problem
(
self
):
def
mathjax_rendered_in_problem
(
self
):
"""
"""
Check that MathJax have been rendered in problem hint
Check that MathJax have been rendered in problem hint
"""
"""
mathjax_container
=
self
.
q
(
css
=
"div.problem p .MathJax .math"
)
def
mathjax_present
():
return
mathjax_container
.
visible
and
mathjax_container
.
present
""" Returns True if MathJax css is present in the problem body """
mathjax_container
=
self
.
q
(
css
=
"div.problem p .MathJax .math"
)
return
mathjax_container
.
visible
and
mathjax_container
.
present
@property
self
.
wait_for
(
def
mathjax_rendered_in_hint
(
self
):
mathjax_present
,
description
=
"MathJax rendered in problem body"
)
def
verify_mathjax_rendered_in_hint
(
self
):
"""
"""
Check that MathJax have been rendered in problem hint
Check that MathJax have been rendered in problem hint
"""
"""
mathjax_container
=
self
.
q
(
css
=
"div.problem div.problem-hint .MathJax .math"
)
def
mathjax_present
():
return
mathjax_container
.
visible
and
mathjax_container
.
present
""" Returns True if MathJax css is present in the problem body """
mathjax_container
=
self
.
q
(
css
=
"div.problem div.problem-hint .MathJax .math"
)
return
mathjax_container
.
visible
and
mathjax_container
.
present
self
.
wait_for
(
mathjax_present
,
description
=
"MathJax rendered in hint"
)
def
fill_answer
(
self
,
text
):
def
fill_answer
(
self
,
text
):
"""
"""
...
...
common/test/acceptance/tests/discussion/test_discussion.py
View file @
f7e2830a
...
@@ -231,14 +231,8 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa
...
@@ -231,14 +231,8 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa
thread_fixture
.
push
()
thread_fixture
.
push
()
self
.
setup_thread_page
(
thread_id
)
self
.
setup_thread_page
(
thread_id
)
self
.
assertTrue
(
self
.
thread_page
.
is_discussion_body_visible
())
self
.
assertTrue
(
self
.
thread_page
.
is_discussion_body_visible
())
self
.
thread_page
.
wait_for
(
self
.
thread_page
.
verify_mathjax_preview_available
()
self
.
thread_page
.
is_mathjax_preview_available
,
self
.
thread_page
.
verify_mathjax_rendered
()
description
=
"MathJax Preview is rendered"
)
self
.
thread_page
.
wait_for
(
self
.
thread_page
.
is_mathjax_rendered
,
description
=
"MathJax is rendered"
)
def
test_markdown_reference_link
(
self
):
def
test_markdown_reference_link
(
self
):
"""
"""
...
...
common/test/acceptance/tests/lms/test_lms_problems.py
View file @
f7e2830a
...
@@ -275,28 +275,18 @@ class ProblemWithMathjax(ProblemsTest):
...
@@ -275,28 +275,18 @@ class ProblemWithMathjax(ProblemsTest):
problem_page
=
ProblemPage
(
self
.
browser
)
problem_page
=
ProblemPage
(
self
.
browser
)
self
.
assertEqual
(
problem_page
.
problem_name
,
"MATHJAX TEST PROBLEM"
)
self
.
assertEqual
(
problem_page
.
problem_name
,
"MATHJAX TEST PROBLEM"
)
# Verify MathJax has been rendered
problem_page
.
verify_mathjax_rendered_in_problem
()
problem_page
.
wait_for
(
lambda
:
problem_page
.
mathjax_rendered_in_problem
,
description
=
"MathJax rendered in body"
)
# The hint button rotates through multiple hints
# The hint button rotates through multiple hints
problem_page
.
click_hint
()
problem_page
.
click_hint
()
self
.
assertIn
(
"Hint (1 of 2): mathjax should work1"
,
problem_page
.
hint_text
)
self
.
assertIn
(
"Hint (1 of 2): mathjax should work1"
,
problem_page
.
hint_text
)
problem_page
.
wait_for
(
problem_page
.
verify_mathjax_rendered_in_hint
()
lambda
:
problem_page
.
mathjax_rendered_in_hint
,
description
=
"MathJax rendered in hint"
)
# Rotate the hint and check the problem hint
# Rotate the hint and check the problem hint
problem_page
.
click_hint
()
problem_page
.
click_hint
()
self
.
assertIn
(
"Hint (2 of 2): mathjax should work2"
,
problem_page
.
hint_text
)
self
.
assertIn
(
"Hint (2 of 2): mathjax should work2"
,
problem_page
.
hint_text
)
problem_page
.
wait_for
(
problem_page
.
verify_mathjax_rendered_in_hint
()
lambda
:
problem_page
.
mathjax_rendered_in_hint
,
description
=
"MathJax rendered in hint"
)
class
ProblemPartialCredit
(
ProblemsTest
):
class
ProblemPartialCredit
(
ProblemsTest
):
...
...
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