Use waits because MathJax rendering is asynchronous.
TNL-2419
This commit is contained in:
@@ -6,7 +6,6 @@ import datetime
|
||||
from pytz import UTC
|
||||
from uuid import uuid4
|
||||
from nose.plugins.attrib import attr
|
||||
from flaky import flaky
|
||||
|
||||
from .helpers import BaseDiscussionTestCase
|
||||
from ..helpers import UniqueCourseTest
|
||||
@@ -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.visit()
|
||||
|
||||
@flaky # TODO fix this, see TNL-2419
|
||||
def test_mathjax_rendering(self):
|
||||
thread_id = "test_thread_{}".format(uuid4().hex)
|
||||
|
||||
@@ -233,8 +231,14 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa
|
||||
thread_fixture.push()
|
||||
self.setup_thread_page(thread_id)
|
||||
self.assertTrue(self.thread_page.is_discussion_body_visible())
|
||||
self.assertTrue(self.thread_page.is_mathjax_preview_available())
|
||||
self.assertTrue(self.thread_page.is_mathjax_rendered())
|
||||
self.thread_page.wait_for(
|
||||
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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user