Extract hint from html instead of text

This commit is contained in:
Muddasser
2016-03-22 16:28:43 +05:00
parent 76b8e2e897
commit 6da296e454
2 changed files with 9 additions and 2 deletions

View File

@@ -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):
"""

View File

@@ -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()