Extract hint from html instead of text
This commit is contained in:
@@ -36,6 +36,13 @@ class ProblemPage(PageObject):
|
||||
"""
|
||||
return self.q(css="div.problem span.message").text[0]
|
||||
|
||||
@property
|
||||
def extract_hint_text_from_html(self):
|
||||
"""
|
||||
Return the "hint" text of the problem from html
|
||||
"""
|
||||
return self.q(css="div.problem div.problem-hint").html[0].split(' <', 1)[0]
|
||||
|
||||
@property
|
||||
def hint_text(self):
|
||||
"""
|
||||
|
||||
@@ -288,13 +288,13 @@ class ProblemWithMathjax(ProblemsTest):
|
||||
|
||||
# The hint button rotates through multiple hints
|
||||
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.extract_hint_text_from_html)
|
||||
problem_page.verify_mathjax_rendered_in_hint()
|
||||
|
||||
# Rotate the hint and check the problem 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.extract_hint_text_from_html)
|
||||
problem_page.verify_mathjax_rendered_in_hint()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user