Commit 9968622c by cahrens

Use waits because MathJax rendering is asynchronous.

TNL-2419
parent a48d3ebe
...@@ -6,7 +6,6 @@ import datetime ...@@ -6,7 +6,6 @@ import datetime
from pytz import UTC from pytz import UTC
from uuid import uuid4 from uuid import uuid4
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from flaky import flaky
from .helpers import BaseDiscussionTestCase from .helpers import BaseDiscussionTestCase
from ..helpers import UniqueCourseTest from ..helpers import UniqueCourseTest
...@@ -218,7 +217,6 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa ...@@ -218,7 +217,6 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa
self.thread_page = self.create_single_thread_page(thread_id) # pylint: disable=attribute-defined-outside-init self.thread_page = self.create_single_thread_page(thread_id) # pylint: disable=attribute-defined-outside-init
self.thread_page.visit() self.thread_page.visit()
@flaky # TODO fix this, see TNL-2419
def test_mathjax_rendering(self): def test_mathjax_rendering(self):
thread_id = "test_thread_{}".format(uuid4().hex) thread_id = "test_thread_{}".format(uuid4().hex)
...@@ -233,8 +231,14 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa ...@@ -233,8 +231,14 @@ 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.assertTrue(self.thread_page.is_mathjax_preview_available()) self.thread_page.wait_for(
self.assertTrue(self.thread_page.is_mathjax_rendered()) self.thread_page.is_mathjax_preview_available,
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):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment