Commit 586d7980 by Jesse Zoldak

Fix flakiness on annotation selenium test

parent c9381796
......@@ -65,8 +65,16 @@ class AnnotationComponentPage(PageObject):
Submit correct answer for active problem.
"""
self.q(css=self.active_problem_selector('.comment')).fill('Test Response')
self.q(css=self.active_problem_selector('.tag[data-id="{}"]'.format(self.active_problem))).click()
answer_css = self.active_problem_selector('.tag[data-id="{}"]'.format(self.active_problem))
# Selenium will first move the element into view then click on it.
self.q(css=answer_css).click()
# Wait for the click to take effect, which is after the class is applied.
self.wait_for(lambda: 'selected' in self.q(css=answer_css).attrs('class')[0], description='answer selected')
# Click the "Check" button.
self.q(css=self.active_problem_selector('.check')).click()
# This will trigger a POST to problem_check so wait until the response is returned.
self.wait_for_ajax()
def check_feedback(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