Wait for MathJax to render.
This commit is contained in:
@@ -275,19 +275,28 @@ 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 have been rendered
|
# Verify MathJax has been rendered
|
||||||
self.assertTrue(problem_page.mathjax_rendered_in_problem, "MathJax did not rendered in body")
|
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)
|
||||||
self.assertTrue(problem_page.mathjax_rendered_in_hint, "MathJax did not rendered in problem hint")
|
problem_page.wait_for(
|
||||||
|
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)
|
||||||
self.assertTrue(problem_page.mathjax_rendered_in_hint, "MathJax did not rendered in problem hint")
|
problem_page.wait_for(
|
||||||
|
lambda: problem_page.mathjax_rendered_in_hint,
|
||||||
|
description="MathJax rendered in hint"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ProblemPartialCredit(ProblemsTest):
|
class ProblemPartialCredit(ProblemsTest):
|
||||||
|
|||||||
Reference in New Issue
Block a user